リマインダーアプリを開発し、timer.performWithDelay関数を使用して、タスクを指定した関数を呼び出しました。それはシミュレータ上で正常に動作します。私はそれを私はsystem.scheduleNotificationを使用する必要があるためにデバイス上で実行したい。
私はそれを使用してシミュレータをチェックインする方法を理解できません。私は書いたコードを共有しています。
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()
終わり
終わり
終わり
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)
終わり
forAlarm = timer.performWithDelay (delay*1000, compareTime)
誰かが私のコードをデバイス上で実行するように変更する必要があることを教えてもらえますか?