推送通知未在ios 9中显示2kb

时间:2022-09-10 20:29:23

Check this following push notification response. I have passed longer text in the "alert", but it is cut to "Riddham Pan". It exceeds the limit of payload.

检查以下推送通知响应。我在“警报”中传递了较长的文字,但它被剪切为“Riddham Pan”。它超出了有效载荷的限制。

Can any one please tell me how they counted 256 bytes in the following notification.

任何人都可以告诉我他们在以下通知中如何计算256个字节。

I am checking in ios 9 so limit should be 2kb. Do I have to do any custom settings in code for getting the notification upto 2kb length?

我正在检查ios 9,所以限制应该是2kb。我是否必须在代码中进行任何自定义设置才能获得长达2kb的通知?

{
    EmailID = "";
    Message = "";
    NotificationType = Offline;
    RefId = 0;
    RefType = "3f588d5b-dbbd-4a65-b800-d863f8eb684d@conference.dev.time.appleapps.in";
    UserName = New1;
    aps =     {
        alert = "Riddham Pan";
        badge = 2;
        "content-available" = 1;
        sound = "sms-received5.caf";
    };
}

Thanks in advance.

提前致谢。

1 个解决方案

#1


0  

The JSON is invalid. If payload limit exceeds than 2kb notification would not be handled. From Apple docs

JSON无效。如果有效负载限制超过2kb,则不会处理通知。来自Apple文档

Apple Push Notification service refuses any notification that exceeds this limit. Reference

Apple推送通知服务拒绝任何超出此限制的通知。参考

Since you are receiving notifications this means your payload limit is not exceeding but JSON format is invalid.

由于您收到通知,这意味着您的有效负载限制不会超过,但JSON格式无效。

#1


0  

The JSON is invalid. If payload limit exceeds than 2kb notification would not be handled. From Apple docs

JSON无效。如果有效负载限制超过2kb,则不会处理通知。来自Apple文档

Apple Push Notification service refuses any notification that exceeds this limit. Reference

Apple推送通知服务拒绝任何超出此限制的通知。参考

Since you are receiving notifications this means your payload limit is not exceeding but JSON format is invalid.

由于您收到通知,这意味着您的有效负载限制不会超过,但JSON格式无效。