How to achieve the alarm clock

hi all

i want to achieve the alarm clock.But i don’t how to rang per day from my app.

thanks [import]uid: 94020 topic_id: 31412 reply_id: 331412[/import]

You should look at using the corona function os.date( [format [, time] ] ) – it can return both the date and time on the device.

To determine the difference in two times, you can use coronas os.difftime()…

I haven’t done much with the time functions, but hopefully someone else can provide more details as needed. [import]uid: 79933 topic_id: 31412 reply_id: 125593[/import]

 local function notificationListener( event )  
 -- display alert that shows the event name and type:  
 native.showAlert( event.name, event.custom.foo, { "OK" } )  
  
 -- do something here  
 end  
  
 --------1  
  
 -- Options for iOS   
 local badge\_num = native.getProperty( "applicationIconBadgeNumber" ) or 0  
 local options = {  
 alert = "test",  
 badge = 1,  
 sound = "beep\_caf.caf",  
 custom = { foo = "1" }  
 }  
  
 -- schedule using seconds from now  
 local no = system.scheduleNotification( 15, options )  
  
 --------  
  
 -- Listen for notification events:  
 Runtime:addEventListener( "notification", notificationListener )  

i regist a notification , it works the first’s day.but i don’t how to achieve for second’s day [import]uid: 94020 topic_id: 31412 reply_id: 125690[/import]

You should look at using the corona function os.date( [format [, time] ] ) – it can return both the date and time on the device.

To determine the difference in two times, you can use coronas os.difftime()…

I haven’t done much with the time functions, but hopefully someone else can provide more details as needed. [import]uid: 79933 topic_id: 31412 reply_id: 125593[/import]

 local function notificationListener( event )  
 -- display alert that shows the event name and type:  
 native.showAlert( event.name, event.custom.foo, { "OK" } )  
  
 -- do something here  
 end  
  
 --------1  
  
 -- Options for iOS   
 local badge\_num = native.getProperty( "applicationIconBadgeNumber" ) or 0  
 local options = {  
 alert = "test",  
 badge = 1,  
 sound = "beep\_caf.caf",  
 custom = { foo = "1" }  
 }  
  
 -- schedule using seconds from now  
 local no = system.scheduleNotification( 15, options )  
  
 --------  
  
 -- Listen for notification events:  
 Runtime:addEventListener( "notification", notificationListener )  

i regist a notification , it works the first’s day.but i don’t how to achieve for second’s day [import]uid: 94020 topic_id: 31412 reply_id: 125690[/import]