Local Notification question

Hey there. I’m trying to to add a local notification in my project but I don’t know what I need to put into “lauchArg”… someone can give me an example for what should I put in this variable?

local launchArgs = ...  
   
local function notificationListener( event )  
 -- display alert that shows the event name and type:  
 native.showAlert( event.name, event.type, { "OK" } )  
   
 -- do something here  
end  
   
-- Listen for notification events:  
Runtime:addEventListener( "notification", notificationListener )  
   
if launchArgs and launchArgs.notification then  
 -- call the event listener manually:  
 notificationListener( launchArgs.notification )  
end  
  

and can I change this launchArg after ?

Reeealy need this information, so please help me

Thanks [import]uid: 23063 topic_id: 17803 reply_id: 317803[/import]

No one knows what it is? o.O [import]uid: 23063 topic_id: 17803 reply_id: 68008[/import]

please somebody help me!

this notification its freaking me out [import]uid: 23063 topic_id: 17803 reply_id: 68042[/import]

local launchArgs = {  
 dia = 16,  
 mes = 11,  
 notification = system.scheduleNotification(   
 {  
 alert = "Nova Festa!",  
 badge = 1,  
 sound = "wee.wav",  
 custom = { anythingYouWant = "Novo Evento" }  
 }   
 ),  
}  
print( launchArgs.dia, launchArgs.mes )  
  
local date = os.date( "\*t" )  
local function notificationListener( event )  
 -- display alert that shows the event name and type:  
 native.showAlert( event.name, event.custom, { "OK" } )  
   
 -- do something here  
end  
   
-- Listen for notification events:  
Runtime:addEventListener( "notification", notificationListener )  
  
if launchArgs and date.day == launchArgs.dia and date.month == launchArgs.mes then  
 -- call the event listener manually:  
 print( "teste notificacao" )  
 notificationListener( launchArgs.notification )  
end  
  

I’m trying this but I get errors: “main.lua:22: attempt to index local ‘event’ (a nil value)”
someone? [import]uid: 23063 topic_id: 17803 reply_id: 68044[/import]

Applications > CoronaSDK > SampleCode > Interface > Alert

That will help you, just modify the code provided :slight_smile:

Peach [import]uid: 52491 topic_id: 17803 reply_id: 68099[/import]

peach my realy problem is this “launchArgs” and no the alert
my app crash when I tried to use this code on device

I realy don’t know what I need to put into launchArgs

I have read the 2 posts for this but I still don’t understanding

if you can help me =T [import]uid: 23063 topic_id: 17803 reply_id: 68170[/import]

really? nobody knows?? [import]uid: 23063 topic_id: 17803 reply_id: 68276[/import]

Provide a sample that can be tested by users if you want help without just bumping, please - it’s much easier that way.

If you have an urgent problem please use this link; http://www.anscamobile.com/corona/support/

If you upload something though I’m sure someone will try to take a look for you.

Peach :slight_smile: [import]uid: 52491 topic_id: 17803 reply_id: 68322[/import]