Documentation ¶
Index ¶
- Constants
- func GenerateSign(params map[string]string, appKey string) string
- func PushParamMD5(paramstr string) string
- type AdvanceInfo
- type ClickTypeInfo
- type NoticeBarInfo
- type NoticeExpandInfo
- type NotificationMessage
- type NotificationType
- type PushResponse
- func ChangeAllSwitch(appId string, pushId string, subSwitch bool, appKey string) PushResponse
- func ChangeRegisterSwitch(appId string, pushId string, msgType string, subSwitch bool, appKey string) PushResponse
- func GetRegisterSwitch(appId string, pushId string, appKey string) PushResponse
- func GetSubAlias(appId string, pushId string, appKey string) PushResponse
- func GetSubTags(appId string, pushId string, appKey string) PushResponse
- func GetTaskStatistics(appId string, taskId string, appKey string) PushResponse
- func PushNotificationMessageByAlias(appId string, alias string, messageJson string, appKey string) PushResponse
- func PushNotificationMessageByPushId(appId string, pushIds string, messageJson string, appKey string) PushResponse
- func PushThroughMessageByAlias(appId string, alias string, messageJson string, appKey string) PushResponse
- func PushThroughMessageByPushId(appId string, pushIds string, messageJson string, appKey string) PushResponse
- func Register(appId string, appKey string, deviceId string) PushResponse
- func ResolvePushResponse(res *httpclient.Response, err error) PushResponse
- func SubscribeAlias(appId string, pushId string, alias string, appKey string) PushResponse
- func SubscribeTags(appId string, pushId string, tags string, appKey string) PushResponse
- func UnSubAllTags(appId string, pushId string, appKey string) PushResponse
- func UnSubscribeAlias(appId string, pushId string, appKey string) PushResponse
- func UnSubscribeTags(appId string, pushId string, tags string, appKey string) PushResponse
- type PushTimeInfo
- type T_AdvanceInfo
- type T_PushTimeInfo
- type ThroughMessage
Constants ¶
View Source
const ( SERVER = "https://api-push.meizu.com/garcia/api/client/" STATUS_CODE = 200 //服务端SDK调用API的应用的私钥Secret Key为 appSecret PUSH_API_SERVER = "https://api-push.meizu.com" )
View Source
const ( APP_ID = "100999" APP_KEY = "531732bc45324098978bf41c6954c09e" PUSH_ID = "862891030007404100999" NOTIFICATION_SWITCH = "0" THROUGH_MESSAGE_SWITCH = "1" )
Variables ¶
This section is empty.
Functions ¶
func PushParamMD5 ¶
Types ¶
type AdvanceInfo ¶
type AdvanceInfo struct { Suspend int `json:"suspend"` ClearNoticeBar int `json:"clearNoticeBar"` FixDisplay int `json:"fixDisplay"` FixStartDisplayTime string `json:"fixStartDisplayTime"` FixEndDisplayTime string `json:"fixEndDisplayTime"` NotificationType NotificationType `json:"notificationType"` }
"advanceInfo": { "suspend":是否通知栏悬浮窗显示 (1 显示 0 不显示) 【int 非必填,默认1】 "clearNoticeBar":是否可清除通知栏 (1 可以 0 不可以) 【int 非必填,默认1】 "fixDisplay":是否定时展示 (1 是 0 否) 【int 非必填,默认0】 "fixStartDisplayTime": 定时展示开始时间(yyyy-MM-dd HH:mm:ss) 【str 非必填】 "fixEndDisplayTime ": 定时展示结束时间(yyyy-MM-dd HH:mm:ss) 【str 非必填】 "notificationType": { "vibrate": 震动 (0关闭 1 开启) , 【int 非必填,默认1】 "lights": 闪光 (0关闭 1 开启), 【int 非必填,默认1】 "sound": 声音 (0关闭 1 开启), 【int 非必填,默认1】 } }
type ClickTypeInfo ¶
type ClickTypeInfo struct { ClickType int `json:"clickType"` Url string `json:"url"` Parameters map[string]interface{} `json:"parameters"` Activity string `json:"activity"` CustomAttribute string `json:"customAttribute"` }
"clickTypeInfo": { "clickType": 点击动作 (0,"打开应用"),(1,"打开应用页面"),(2,"打开URI页面"),(3, "应用客户端自定义")【int 非必填,默认为0】 "url": URI页面地址, 【string clickType为打开URI页面时,必填, 长度限制1000字节】 "parameters":参数 【JSON格式】【非必填】 "activity":应用页面地址 【string clickType为打开应用页面时,必填, 长度限制1000字节】 "customAttribute":应用客户端自定义【string clickType为应用客户端自定义时,必填, 输入长度为1000字节以内】 }
type NoticeBarInfo ¶
type NoticeBarInfo struct { NoticeBarType int `json:"noticeBarType"` Title string `json:"title"` Content string `json:"content"` }
"noticeBarInfo": { "noticeBarType": 通知栏样式(0, "标准"),(2, "安卓原生")【int 非必填,值为0】 "title": 推送标题, 【string 必填,字数限制1~32字符】 "content": 推送内容, 【string 必填,字数限制1~100字符】 }
type NoticeExpandInfo ¶
type NotificationMessage ¶
type NotificationMessage struct { NoticeBarInfo NoticeBarInfo `json:"noticeBarInfo"` NoticeExpandInfo NoticeExpandInfo `json:"noticeExpandInfo"` ClickTypeInfo ClickTypeInfo `json:"clickTypeInfo"` PushTimeInfo PushTimeInfo `json:"pushTimeInfo"` AdvanceInfo AdvanceInfo `json:"advanceInfo"` }
func BuildNotificationMessage ¶
func BuildNotificationMessage() NotificationMessage
type NotificationType ¶
type PushResponse ¶
type PushResponse struct {
// contains filtered or unexported fields
}
func ChangeAllSwitch ¶
func ChangeAllSwitch(appId string, pushId string, subSwitch bool, appKey string) PushResponse
修改所有开关状态
func ChangeRegisterSwitch ¶
func ChangeRegisterSwitch(appId string, pushId string, msgType string, subSwitch bool, appKey string) PushResponse
修改订阅开关状态
func GetRegisterSwitch ¶
func GetRegisterSwitch(appId string, pushId string, appKey string) PushResponse
获取订阅开关状态
func GetTaskStatistics ¶
func GetTaskStatistics(appId string, taskId string, appKey string) PushResponse
获取任务推送统计
func PushNotificationMessageByAlias ¶
func PushNotificationMessageByAlias(appId string, alias string, messageJson string, appKey string) PushResponse
别名推送接口(通知栏消息)
func PushNotificationMessageByPushId ¶
func PushNotificationMessageByPushId(appId string, pushIds string, messageJson string, appKey string) PushResponse
pushId推送接口(通知栏消息)
func PushThroughMessageByAlias ¶
func PushThroughMessageByAlias(appId string, alias string, messageJson string, appKey string) PushResponse
别名推送接口(透传消息
func PushThroughMessageByPushId ¶
func PushThroughMessageByPushId(appId string, pushIds string, messageJson string, appKey string) PushResponse
*
- 通过PushId推送透传消息
func Register ¶
func Register(appId string, appKey string, deviceId string) PushResponse
android 客户端订阅接口
func ResolvePushResponse ¶
func ResolvePushResponse(res *httpclient.Response, err error) PushResponse
resolve push response
func SubscribeAlias ¶
func SubscribeAlias(appId string, pushId string, alias string, appKey string) PushResponse
别名订阅
func SubscribeTags ¶
func SubscribeTags(appId string, pushId string, tags string, appKey string) PushResponse
标签订阅
func UnSubAllTags ¶
func UnSubAllTags(appId string, pushId string, appKey string) PushResponse
取消订阅所有标签
func UnSubscribeAlias ¶
func UnSubscribeAlias(appId string, pushId string, appKey string) PushResponse
取消别名订阅
func UnSubscribeTags ¶
func UnSubscribeTags(appId string, pushId string, tags string, appKey string) PushResponse
取消标签订阅
type PushTimeInfo ¶
"pushTimeInfo": { "offLine": 是否进离线消息(0 否 1 是[validTime]) 【int 非必填,默认值为1】 "validTime": 有效时长 (1到72 小时内的正整数) 【int offLine值为1时,必填,默认24】 }
type T_AdvanceInfo ¶
type T_PushTimeInfo ¶
type ThroughMessage ¶
type ThroughMessage struct { Title string `json:"title"` Content string `json:"content"` PushTimeInfo T_PushTimeInfo `json:"pushTimeInfo"` AdvanceInfo T_AdvanceInfo `json:"advanceInfo"` }
这里所有的字段都是头字母大写
Click to show internal directories.
Click to hide internal directories.