[英]IOS Push Notifications: Not getting any push when sending this payload
當我嘗試發送以下有效載荷以在iPhone上生成推送通知時,我收到一條成功消息,但沒有收到任何推送通知。
我想知道此有效載荷是否為有效格式?
{
"aps": {
"alert": "green commented on your post: 'push post for tim'. Comment is: hey hi!",
"sound": "default"
},
"type": "comment",
"post": {
"post_id": "168",
"post_title": "push post for tim",
"post_content": "testing push",
"post_status": "1",
"is_favorite": "0",
"post_comment_count": "9",
"username": "test1",
"category": "uncategorized",
"relevancy": "0%",
"creator_num": "85",
"type": "Manual",
"lat": "0.000000",
"lon": "0.000000",
"auto_end_date": "0000-00-00",
"access": "Private",
"post_image": "http://thepost.com/admin/uploads/thumb/post_default.jpg",
"post_comments": "9"
}
}
當我僅發送此有效負載時,推送有效:
{
"aps": {
"alert": "green commented on your post: 'push post for tim'. Comment is: hey hi!",
"sound": "default"
}
}
有任何想法嗎?
通知有效負載的最大大小為256個字節。 APNS將拒絕任何超出限制的通知。 您的有效載荷為567字節,這就是為什么您沒有看到通知通過的原因。
來源: http : //developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.