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]