正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -157,6 +157,7 @@ type Result struct { | @@ -157,6 +157,7 @@ type Result struct { | ||
| 157 | func NewPushInfo(options *push.Options) (v *PushInfo) { | 157 | func NewPushInfo(options *push.Options) (v *PushInfo) { |
| 158 | v = &PushInfo{ | 158 | v = &PushInfo{ |
| 159 | Aps: NewAps(options), | 159 | Aps: NewAps(options), |
| 160 | + Payload: options.TransmissionContent, | ||
| 160 | } | 161 | } |
| 161 | return | 162 | return |
| 162 | } | 163 | } |
| @@ -165,7 +166,6 @@ func NewAps(options *push.Options) (v *Aps) { | @@ -165,7 +166,6 @@ func NewAps(options *push.Options) (v *Aps) { | ||
| 165 | Alert: NewAlert(options), | 166 | Alert: NewAlert(options), |
| 166 | AutoBadge: "+1", | 167 | AutoBadge: "+1", |
| 167 | ContentAvailable: 1, | 168 | ContentAvailable: 1, |
| 168 | - Payload: options.TransmissionContent, | ||
| 169 | } | 169 | } |
| 170 | return | 170 | return |
| 171 | } | 171 | } |
| @@ -179,12 +179,12 @@ func NewAlert(options *push.Options) (v *Alert) { | @@ -179,12 +179,12 @@ func NewAlert(options *push.Options) (v *Alert) { | ||
| 179 | 179 | ||
| 180 | type PushInfo struct { | 180 | type PushInfo struct { |
| 181 | Aps *Aps `json:"aps"` | 181 | Aps *Aps `json:"aps"` |
| 182 | + Payload string `json:"payload,omitempty"` | ||
| 182 | } | 183 | } |
| 183 | type Aps struct { | 184 | type Aps struct { |
| 184 | Alert *Alert `json:"alert"` | 185 | Alert *Alert `json:"alert"` |
| 185 | AutoBadge string `json:"autoBadge"` //用于计算应用上面未读数字 | 186 | AutoBadge string `json:"autoBadge"` //用于计算应用上面未读数字 |
| 186 | ContentAvailable int `json:"content-available"` //推送直接带有透传数据 0:有通知栏消息 1:无通知栏消息 | 187 | ContentAvailable int `json:"content-available"` //推送直接带有透传数据 0:有通知栏消息 1:无通知栏消息 |
| 187 | - Payload string `json:"payload,omitempty"` | ||
| 188 | } | 188 | } |
| 189 | type Alert struct { | 189 | type Alert struct { |
| 190 | Title string `json:"title"` | 190 | Title string `json:"title"` |
-
请 注册 或 登录 后发表评论