dousuochu7291 2013-03-31 21:29
浏览 31
已采纳

IOS推送通知:发送此有效负载时没有任何推动

When i am trying to send the following payload for generating a push notification on iphone, i receive a successful message but i do not receive any push notifications.

I want to know if this payload in valid format?

{
    "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"
    }
}

The push is working when i am only sending this payload:

{
    "aps": {
        "alert": "green commented on your post: 'push post for tim'. Comment is: hey hi!",
        "sound": "default"
    }
}

Any ideas?

  • 写回答

1条回答 默认 最新

  • doulan6150 2013-03-31 21:46
    关注

    The maximum size for a notification payload is 256 bytes. APNS will refuse any notification that exceeds the limit. Your payload is 567 bytes which is why it's you're not seeing the notification go through.

    Source: http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 在获取boss直聘的聊天的时候只能获取到前40条聊天数据
  • ¥20 关于URL获取的参数,无法执行二选一查询
  • ¥15 液位控制,当液位超过高限时常开触点59闭合,直到液位低于低限时,断开
  • ¥15 marlin编译错误,如何解决?
  • ¥15 有偿四位数,节约算法和扫描算法
  • ¥15 VUE项目怎么运行,系统打不开
  • ¥50 pointpillars等目标检测算法怎么融合注意力机制
  • ¥20 Vs code Mac系统 PHP Debug调试环境配置
  • ¥60 大一项目课,微信小程序
  • ¥15 求视频摘要youtube和ovp数据集