Browse Source

极光推送

master
huangjiajun 1 month ago
parent
commit
ee85ee3b2b
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      jPush/push.go
  2. +2
    -1
      jPush/sdk/push_request.go

+ 1
- 1
jPush/push.go View File

@@ -34,7 +34,7 @@ func PushAllUser(key, secret, title, content string, platform string, extras map
}
func getMsg(title, content string, platform string, audience interface{}, extras map[string]interface{}) *jpush.PushRequest {
req := &jpush.PushRequest{
Platform: jpush.Platform(platform),
Platform: platform,
Audience: audience,
Notification: &jpush.PushNotification{
Alert: content,


+ 2
- 1
jPush/sdk/push_request.go View File

@@ -5,6 +5,7 @@ import "encoding/json"
type Platform string

const (
All Platform = "all"
PlatformAndroid Platform = "android"
PlatformIOS Platform = "ios"
PlatformWinPhone Platform = "winphone"
@@ -85,7 +86,7 @@ type PushOptions struct {

type PushRequest struct {
Cid string `json:"cid,omitempty"`
Platform Platform `json:"platform"`
Platform string `json:"platform"`
Audience interface{} `json:"audience,omitempty"`
Notification *PushNotification `json:"notification,omitempty"`
Message *PushMessage `json:"message,omitempty"`


Loading…
Cancel
Save