繁体   English   中英

iOS推送通知:发送此有效负载时未获得任何推送

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM