2016-08-19 159 views
0

iOS通过AWS SNS推送通知。 Payload在iOS设备通知面板中显示而不是消息。iOS通过AWS SNS推送通知

例如:

{ 
"default": "Sample message", 
"APNS": { 
"aps": { 
"alert": { 
"body": "You have new message", 
"title": "Sample message" 
} 
} 
} 
} 
+0

那么你的问题是什么? –

回答

0

问题是你一直apsAPNS

按照苹果的文档,有效载荷应该是这样的,

{ 
    "aps" : { 
     "alert" : { 
      "title" : "Game Request", 
      "body" : "Bob wants to play poker", 
      "action-loc-key" : "PLAY" 
     }, 
     "badge" : 5 
    }, 
    "acme1" : "bar", 
    "acme2" : [ "bang", "whiz" ] 
} 

注:“APS”应在按键可直接,你不应该将其括其他值内。

文档:https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW1),