作者 yangfu

1.推送修改 :透传 赋值payload

... ... @@ -157,6 +157,7 @@ type Result struct {
func NewPushInfo(options *push.Options) (v *PushInfo) {
v = &PushInfo{
Aps: NewAps(options),
Payload: options.TransmissionContent,
}
return
}
... ... @@ -165,7 +166,6 @@ func NewAps(options *push.Options) (v *Aps) {
Alert: NewAlert(options),
AutoBadge: "+1",
ContentAvailable: 1,
Payload: options.TransmissionContent,
}
return
}
... ... @@ -179,12 +179,12 @@ func NewAlert(options *push.Options) (v *Alert) {
type PushInfo struct {
Aps *Aps `json:"aps"`
Payload string `json:"payload,omitempty"`
}
type Aps struct {
Alert *Alert `json:"alert"`
AutoBadge string `json:"autoBadge"` //用于计算应用上面未读数字
ContentAvailable int `json:"content-available"` //推送直接带有透传数据 0:有通知栏消息 1:无通知栏消息
Payload string `json:"payload,omitempty"`
}
type Alert struct {
Title string `json:"title"`
... ...