What is the maximum number of characters that can be displayed in Android and iOS push notification?
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)
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
As kabuko said there are a lot of variables. But I did testing on a Galaxy S5 and a Nexus 5, with Android 4.4, and got similar results. If you are looking for ballpark figures I got
Title: 16 charsText: 27 charsTicker: 300+ chars (I stopped at 300 characters)
NotificationCompat.Builder builder = new NotificationCompat.Builder(application.getApplicationContext());Notification n = builder .setContentTitle("XXXXXXXXXXWWWWWWWWWW") .setContentText("XXXXXXXXXXWWWWWWWWWWXXXXXXXXXX") .setTicker("XXXXXXXXXXWWWWWWWWWWXXXXXXXXXXWWWWWWWWWWXXXXXXXXXWWWWWWWWWW...") // cut short for brevity .setSmallIcon(R.drawable.ic_launcher) .build();
C2DM messages are limited in size to 1024
bytes and are intended to inform the device about new data not to transfer it.
Links:
http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.htmlhttp://code.google.com/android/c2dm/