CodenameOne icon indicating copy to clipboard operation
CodenameOne copied to clipboard

RFE: Newline support in push notifications

Open shannah opened this issue 5 years ago • 1 comments

Push notifications with newline characters (\n) should result in line break in push notifications.

Android

The cursory research I've done so far on this issue is not conclusive on how this is to be achieved on Android.

For example this SO post suggests using HTML for formatting of the body. This would require some processing before displaying the notification -- i.e. this isn't supported currently in our Android port.

However this SO post suggests that you can just embed \n in the message with BigTextStyle (which we do already) it should work. A user has reported that this is not working for him, though, and that the \n gets rendered as a literal \n.

iOS

This SO post suggests that newlines should just work on iOS - but the replies do seem like the blind leading the blind.

I haven't tested on either platform yet.

shannah avatar Jul 07 '20 14:07 shannah

Correct me if I'm wrong: in the latest versions of Android and iOS, only iOS supports displaying Push notifications composed of multiple lines, while Android only displays a single line (cutting it off if too long).

jsfan3 avatar Nov 11 '21 08:11 jsfan3