aliyun_mobile_pusher

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2021 License: MIT Imports: 5 Imported by: 0

README

aliyun-mobile-pusher

阿里云移动推送

Documentation

Overview

*

  • @Author: Resynz
  • @Date: 2021/6/11 15:10

*

  • @Author: Resynz
  • @Date: 2021/6/11 14:55

*

  • @Author: Resynz
  • @Date: 2021/6/11 14:56

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AliMobilePusher

type AliMobilePusher struct {
	Config *Config
	// contains filtered or unexported fields
}

func NewAliMobilePusher

func NewAliMobilePusher(conf *Config) (*AliMobilePusher, error)

func (*AliMobilePusher) Push

func (s *AliMobilePusher) Push(param *PushParam) (*PushResponse, error)

推送

type ApnsEnv

type ApnsEnv string
const (
	ApnsEnvDev  ApnsEnv = "DEV"
	ApnsEnvProd ApnsEnv = "PRODUCT"
)

type Config

type Config struct {
	AccessKeyId  string `json:"access_key_id"`
	AccessSecret string `json:"access_secret"`
	IsDebug      bool   `json:"is_debug"`
}

type PushParam

type PushParam struct {
	Platform                         PushPlatform `json:"platform"`
	Type                             PushType     `json:"type"`
	ApnsEnv                          ApnsEnv      `json:"apns_env"`
	AppKey                           string       `json:"app_key"`
	Title                            string       `json:"title"`
	Body                             string       `json:"body"`
	TargetType                       Target       `json:"target_type"`
	TargetValue                      string       `json:"target_value"`
	Ext                              string       `json:"ext"`
	AndroidNotifyChannel             string       `json:"android_notify_channel"`
	AndroidNotificationXiaomiChannel string       `json:"android_notification_xiaomi_channel"`
	AndroidNotificationVivoChannel   string       `json:"android_notification_vivo_channel"`
	AndroidNotificationHuaweiChannel string       `json:"android_notification_huawei_channel"`
}

推送参数

type PushPlatform

type PushPlatform uint8
const (
	PushPlatformIOS PushPlatform = iota
	PushPlatformAndroid
)

type PushResponse

type PushResponse struct {
	RequestId string `json:"request_id"`
	MessageId string `json:"message_id"`
}

推送响应

type PushType

type PushType uint8
const (
	PushMessage PushType = iota
	PushNotice
)

type Target

type Target string
const (
	TargetDevice  Target = "DEVICE"
	TargetAccount Target = "ACCOUNT"
	TargetAlias   Target = "ALIAS"
	TargetTag     Target = "TAG"
	TargetAll     Target = "ALL"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL