aliyun_mobile_pusher

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 6 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: 2023/2/9 16:27

*

  • @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)

推送

func (*AliMobilePusher) QueryPushStatByMsg added in v0.1.2

func (s *AliMobilePusher) QueryPushStatByMsg(appKey, msgId string) (*PushStat, 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"`
	AndroidPopupActivity             string       `json:"android_popup_activity"`
}

推送参数

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 PushStat added in v0.1.2

type PushStat struct {
	AcceptCount   int64 `json:"accept_count"`   // 推送服务端接收到的推送数目
	OpenedCount   int64 `json:"opened_count"`   // 通知在设备上被点击的数目
	DeletedCount  int64 `json:"deleted_count"`  // 通知在设备上被清除的数目
	SentCount     int64 `json:"sent_count"`     // 推送服务端实际发出的数目
	ReceivedCount int64 `json:"received_count"` // 实际送达到设备的数目
}

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