Ver código fonte

极光推送

master
huangjiajun 3 dias atrás
pai
commit
ee85ee3b2b
2 arquivos alterados com 3 adições e 2 exclusões
  1. +1
    -1
      jPush/push.go
  2. +2
    -1
      jPush/sdk/push_request.go

+ 1
- 1
jPush/push.go Ver arquivo

@@ -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 Ver arquivo

@@ -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"`


Carregando…
Cancelar
Salvar