Scheduling a notification

I developed a reminder app and i used timer.performWithDelay function to call the function in which i specified the tasks to be done. it works fine on the simulator. i want to run it on device for that i need to use system.scheduleNotification .
I am unable to understand how to use it and check in simulator. i’m sharing the code that i’ve written.

local function onComplete( event )
print( "index => "… event.index … " action => " … event.action )

local action = event.action
if “clicked” == event.action then

if 2 == event.index then --pressing snooze and setting snooze time to 1mins
audio.stop()
print("**SNOOZED**")
forAlarm1 = timer.performWithDelay (60*1000, compareTime)

elseif 1==event.index then --pressing ok and setting the alarm to repeat mode
print("**ALARM SET TO REPEAT**")
audio.stop()
end
end
end

function compareTime()
print(“CompareTime is called”)
timer.performWithDelay (7*24*3600*1000, compareTime)
audio.play(alarm)
local alert = native.showAlert( “Garbage Collection Reminder”, “It’s Time”, { “OK”, “SNOOZE” },onComplete)

end

forAlarm = timer.performWithDelay (delay*1000, compareTime)

Can somebody please tell me how should i modify my code to run it on the device??? [import]uid: 209696 topic_id: 35416 reply_id: 335416[/import]

Please see sample app “Notifications/LocalNotifications” that is included with the Corona SDK for an example on how to use the [lua]system.scheduleNotification()[/lua] API.

You can also find documentation about this API here…
http://docs.coronalabs.com/api/library/system/scheduleNotification.html
http://docs.coronalabs.com/api/library/system/cancelNotification.html

Also note that this API is not supported by the Corona Simulator. It only works on iOS and Android.
[import]uid: 32256 topic_id: 35416 reply_id: 140791[/import]

thankyou so much Joshua. got it. and its working :slight_smile: [import]uid: 209696 topic_id: 35416 reply_id: 140860[/import]

Please see sample app “Notifications/LocalNotifications” that is included with the Corona SDK for an example on how to use the [lua]system.scheduleNotification()[/lua] API.

You can also find documentation about this API here…
http://docs.coronalabs.com/api/library/system/scheduleNotification.html
http://docs.coronalabs.com/api/library/system/cancelNotification.html

Also note that this API is not supported by the Corona Simulator. It only works on iOS and Android.
[import]uid: 32256 topic_id: 35416 reply_id: 140791[/import]

thankyou so much Joshua. got it. and its working :slight_smile: [import]uid: 209696 topic_id: 35416 reply_id: 140860[/import]