umeng

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UMENG_RET_SUCCESS = "SUCCESS" //成功返回
	UMENG_RET_FAIL    = "FAIL"    //失败返回
)
View Source
var (
	DISPLAY_TYPE_MESSAGE      = "message"
	DISPLAY_TYPE_NOTIFICATION = "notification"
)
View Source
var (
	UMENG_PUSH_TYPE_UNICAST        = "unicast"        //单播, 针对某个设备推送
	UMENG_PUSH_TYPE_LISTCAST       = "listcast"       //列播,要求不超过500个device_token
	UMENG_PUSH_TYPE_FILECAST       = "filecast"       //文件播,多个device_token可通过文件形式批量发送
	UMENG_PUSH_TYPE_BROADCAST      = "broadcast"      //广播,针对所有设备推送
	UMENG_PUSH_TYPE_GROUPCAST      = "groupcast"      //组播,按照filter筛选用户群, 请参照filter参数
	UMENG_PUSH_TYPE_CUSTOMIZEDCAST = "customizedcast" //通过alias进行推送,包括以下两种case: - alias: 对单个或者多个alias进行推送  - file_id: 将alias存放到文件后,根据file_id来推送
)
View Source
var UMENG_METHOD_POST = "POST"
View Source
var UMENG_PARAMS_COUNT = 2
View Source
var UMENG_PUSH_API_URL = "https://msgapi.umeng.com/api/send"

http://msg.umeng.com/api/send?sign=mysign https://msgapi.umeng.com/api/send?sign=mysign

Functions

This section is empty.

Types

type Audience

type Audience struct {
	RegId []string //接收者的设备注册id/token(单播/列播 MAX=500)
	Tag   []string //按照filter筛选用户群(组播)
	Alias []string //通过alias进行推送(需客户端SDK设置别名)
}

type Message

type Message struct {
	Audience Audience    //消息接收者
	Title    string      //标题
	Content  string      //内容
	Extra    interface{} //自定义数据结构
}

type Response

type Response struct {
	Ret  string `json:"ret"` //成功返回"SUCCESS" 失败返回"FAIL"
	Data struct {
		MsgID     string `json:"msg_id"`     //单播类消息(type为unicast、listcast、customizedcast且不带file_id)返回:
		TaskID    string `json:"task_id"`    //任务类消息(type为broadcast、groupcast、filecast、customizedcast且file_id不为空)返回
		ErrorCode string `json:"error_code"` //当ret返回值为FAIL时指示错误码
		ErrorMsg  string `json:"error_msg"`  //当ret返回值为FAIL时指示错误细信息
	} `json:"data"`
}

type Umeng

type Umeng struct {
	// contains filtered or unexported fields
}

func (*Umeng) Debug

func (u *Umeng) Debug(enable bool)

enable or disable debug output

func (*Umeng) PushNotification

func (u *Umeng) PushNotification(msg *push.Notification) (MsgID string, err error)

推送消息(当前只支持Android单播和列播)

Jump to

Keyboard shortcuts

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