So i’m trying to go to a certain Scene after the notification is clicked, but it seems that it’s always going to main.lua.
Here’s what I have. This code is not in the main.lua but in another scene where the notification can be set. How can this be done?
local notiOptions = { alert = row.baslik, badge = 1, sound = "alarm.mp3", custom = { scene = "scene2" } } local onNotification = function( event ) print( event.name ) if ( event.custom ) then local options = { isModal = true, params = { id = myApp.id, baslik = myApp.baslik } } -- SHOW SCENE AFTER PRESS composer.removeHidden() composer.gotoScene( event.custom.scene, options ) end end Runtime:addEventListener( "notification", onNotification )
if ( launchArgs and launchArgs.notification ) then
onNotification( launchArgs.notification )
end