Search code examples
iospush-notification

iPhone Push Notification Character Limit


I'm brand new to IOS push notifications. I have been reading about them and can't seem to find this information anywhere. I have read that the size limit on a push notification is 256 Bytes. Does this size limit include things such as the device token that have to be sent and other overhead information about the notification. If so what is the actual size I have avaliable for my content.

Also what format are they using to interpret the text that I send? Is the conversion 1 character = 1 byte or is it more than that. Really I want to know how many characters can I send in a push notifications.

Thanks for any help in understanding the limitations of push notification payloads.


Solution

  • Each push notification carries with it a payload. The payload specifies how users are to be alerted to the data waiting to be downloaded to the client application. The maximum size allowed for a notification payload is 256 bytes; Apple Push Notification Service refuses any notification that exceeds this limit.

    For each notification, providers must compose a JSON dictionary object that strictly adheres to RFC 4627. This dictionary must contain another dictionary identified by the key aps. The aps dictionary contains one or more properties that specify the following actions:

    • An alert message to display to the user
    • A number to badge the application icon with
    • A sound to play

    - Local and Push Notifications Programming Guide

    So, answering your question,

    Does this size limit include things such as the device token that have to be sent and other overhead information about the notification.

    Yes, this size limit includes device token and other overhead information.

    Is the conversion 1 character = 1 byte or is it more than that.

    This is true if you're using only Latin letters in your notification.