N
N
Nikolas_Williams2016-05-23 15:55:23
Android
Nikolas_Williams, 2016-05-23 15:55:23

Why are push notifications incomplete?

Good afternoon!
Push notifications sent are displayed incompletely (20-30 characters maximum). The problem is typical only for android (on IOS everything is fine).
What can be done to achieve the correct display?
The problem is diagnosed on all android devices.
21bd8341eacf41c6be4cd1b839c58ebf.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
lazard105, 2016-05-24
@Nikolas_Williams

To display, use Notification.BigTextStyle
It is done like this:

Notification notif = new Notification.Builder(mContext)
     .setContentTitle("New mail from " + sender.toString())
     .setContentText(subject)
     .setSmallIcon(R.drawable.new_mail)
     .setLargeIcon(aBitmap)
     .setStyle(new Notification.BigTextStyle()
         .bigText(aVeryLongString))
     .build();

Then the text will be displayed in multiple lines.
Except for devices with version 4.0 and below (no way for these phones)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question