作者 yangfu

推送增加配置,设置响铃文件 sound

... ... @@ -48,8 +48,13 @@ func Notification(header *protocol.RequestHeader, request *protocol.PushInfoRequ
return
}
if extInfo, ok := appInfo.GetExtInfo(); ok {
if len(extInfo.Intent) > 0 {
requestOriginal.Ext["intent"] = extInfo.Intent
}
if len(extInfo.Sound) > 0 {
requestOriginal.Ext["sound"] = extInfo.Sound
}
}
if len(deviceList) == 0 {
err = protocol.NewSuccessWithMessage(fmt.Sprintf("接收人:%v 未查询到注册的设备信息!", request.Receivers))
return
... ...
... ... @@ -65,6 +65,7 @@ type AppInfo struct {
type ExtInfo struct {
Intent string `json:"intent"`
Sound string `json:"sound,omitempty"`
}
func (t *AppInfo) GetExtInfo() (*ExtInfo, bool) {
... ...