2016-08-19 201 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),