开发者

How many characters can you squeeze into a Apple Push Notification?

Given tha开发者_运维技巧t you have a super simple notification such as

{
"aps": { 
    "alert" : <MY_MESSAGE>
     }
}

and the 256 byte limit to deal with how many characters can MY_MESSAGE be? Or the related question could be phrased as, how many bytes are in each character?

Is it as simple as assuming UTF-8 encoding which adds up to 18 bytes worth of non content characters in my example?


Empirically, the alert box will let you have 141 character before truncating the rest of the message. The full message can be much larger than that but for my purposes I only need the alert box limit.

Update for iOS 5

If the new style of list view notifications is enabled, you get about 62 characters.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜