Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Given that 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?

like image 274
ghostfly Avatar asked Apr 22 '11 19:04

ghostfly


1 Answers

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.

like image 188
ghostfly Avatar answered Nov 14 '22 21:11

ghostfly