Iam using PHP to push notification to Android and iOS device. It perfect worked. But notifcaiton cannot be show on multi-lines.
I used '\n' character but it only working on iOS, not working on Android.
How to show notification on multi-lines on Android device ?
Yes, the android notification don't use \n
in default style, you should set a text in normal mode (single line) but if you want to use \n
in your text, the NotificationCompat.BigTextStyle()
should set,
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(thisActivity)
.setSmallIcon(resourceDrowable)
.setContentTitle("My notification")
.setContentText("Hello World")
.setAutoCancel(true)
.setStyle(new NotificationCompat.BigTextStyle().bigText("My\nMessage"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With