Corona sdk Multi-Channel Notification

I have some notifications in Corona. The problem is that the text is too large, and I will need to show large (multi-line) notifications, for example, the Gmail application. Here's what the notifications look like now: enter image description here

Here is my code:

local notificationOptions = { alert = text, badge = 2, sound = "alarm.caf", custom = { foo = "bar" } } local notification = notifications.scheduleNotification( nextScheduleTime + ( day + math.floor(day/7)) * 24 * 60 * 60, notificationOptions ) 

Any idea how to do this?

+8
android lua push-notification notifications corona
source share
1 answer

Default notifications do not provide multi-line spacing.

To use multiple lines, you must NotificationCompat.BigTextStyle() in Java ( sample ) or use your own or your own custom view ( example ).

Unfortunately, I did not find how you can touch the default view to override

Tutorial: https://docs.coronalabs.com/daily/guide/events/appNotification/index.html#TOC

and here: https://docs.coronalabs.com/daily/plugin/notifications/scheduleNotification.html

in the second link you will see that only these properties are used:

alert (optional) String. A notification message to be displayed on the User. If the application is not currently running, a system warning will display this message. icon (optional) Number. Icon number to display on the application icon when scheduled triggers notification. This replaces the last icon number that was applied. Set to 0 to omit the icon number. This option is not supported on Android. sound (optional) String. The name of the sound file in system.ResourceDirectory that will play when scheduled notification triggers. This sound is only played if the application is not currently in the foreground. In iOS, there are restrictions on the types of sound that can be played (see Apple's documentation for more details). custom (optional) Table. The table to be delivered with the notification. This allows you notification information.

In conclusion, there is no right way to do this these days.

0
source share

All Articles