Search code examples
androidiosandroid-c2dm

What is the maximum number of characters that can be displayed in Android and iOS push notification?


What is the maximum number of characters that can be displayed in push notification in Android without the text being truncated?

The documentation for iPhone states that the notification payload has to be under 256 bytes in total, but I was unable to find something similar for Android.


Solution

  • Android

    The message size limit in Firebase Cloud Messaging (FCM) is 4 kbytes. https://firebase.google.com/docs/cloud-messaging/concept-options#notification-messages-with-optional-data-payload

    https://firebase.google.com/docs/cloud-messaging/server#choose

    The message size limit in GCM is 4 kbytes. (DEPRECATED) https://developer.android.com/google/gcm/server.html#params

    The message size limit in C2DM is 1024 bytes. (DEPRECATED) https://developers.google.com/android/c2dm/#limitations


    iOS

    For regular remote notifications, the maximum size is 4KB (4096 bytes)

    https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html

    Since the introduction of iOS 8 has changed to 2 kbytes!

    https://forums.aws.amazon.com/ann.jspa?annID=2626

    With iOS 8, Apple introduced new features that enable some rich new use cases for mobile push notifications — interactive push notifications, third party widgets, and larger (2 KB) payloads. Today, we are pleased to announce support for the new mobile push capabilities announced with iOS 8. We are publishing a new iOS 8 Sample App that demonstrates how these new features can be implemented with SNS, and have also implemented support for larger 2KB payloads.

    in iOS the size limit is 256 bytes