I can’t listener notification event if the app was started(background, foreground, etc) when the user tapped on a notification, and the notification its fired from Java (The listeners works fine when notifications fired from lua code).
Anyone have idea if this is a restriction, or i’m doing something wrong ?
I send a local notificacion from a service of my java api.
The user tap the notification and the app is open
The method of handle the notification don’t work :
local launchArgs = … if ( launchArgs and launchArgs.notification ) then – Code end
I tested with a notification fired with Corona(notifications.scheduleNotification( 1, options )) and works, but a notification fired on java i dont know if the app start by notification-tap.
Regarding Android notifications via Corona Enterprise, it definitely works. Just note that our Lua notification handling will only work for notifications generated by Corona. Any other notifications that you’ve generated via Java code will not be handled Corona… and this is by design.
That said, the Android intent that launched your app can be received via the “main.lua” file’s “…” launch arguments. The launch arguments will provide an “androidIntent” table providing all of the intent fields that can be copied over safely into Lua. We also provide “androidIntent” information via “system” event type “applicationOpen”. Have a look at the posting here for more details…
Also note that there is one limitation on Corona Enterprise for Android. The Corona generated notifications can only launch a “CoronaActivity” when tapped on. If you derive your own class from our “CoronaActivity” class, then tapping a status bar notification will not work right.
I send a local notificacion from a service of my java api.
The user tap the notification and the app is open
The method of handle the notification don’t work :
local launchArgs = … if ( launchArgs and launchArgs.notification ) then – Code end
I tested with a notification fired with Corona(notifications.scheduleNotification( 1, options )) and works, but a notification fired on java i dont know if the app start by notification-tap.
Regarding Android notifications via Corona Enterprise, it definitely works. Just note that our Lua notification handling will only work for notifications generated by Corona. Any other notifications that you’ve generated via Java code will not be handled Corona… and this is by design.
That said, the Android intent that launched your app can be received via the “main.lua” file’s “…” launch arguments. The launch arguments will provide an “androidIntent” table providing all of the intent fields that can be copied over safely into Lua. We also provide “androidIntent” information via “system” event type “applicationOpen”. Have a look at the posting here for more details…
Also note that there is one limitation on Corona Enterprise for Android. The Corona generated notifications can only launch a “CoronaActivity” when tapped on. If you derive your own class from our “CoronaActivity” class, then tapping a status bar notification will not work right.