Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9212043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:26:07+00:00 2026-06-18T01:26:07+00:00

I developed a reminder app and i used timer.performWithDelay function to call the function

  • 0

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???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:26:09+00:00Added an answer on June 18, 2026 at 1:26 am

    I figured it out. it can be done using the below code
    local options = {
    alert = “Alert!!!”,
    badge = 2,
    sound = “alarm.caf”,
    }

            -- schedule using seconds from now
            local notification = system.scheduleNotification( delay, options )
    
    
            local listener = function( event )
                    local notification = system.scheduleNotification( 7*24*3600*1000, options )
                local alert = native.showAlert( "Garbage Collection Reminder", "It's Time", { "OK", "SNOOZE" },onComplete)
    
            end
    
            Runtime:addEventListener( "notification", listener )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I developed one Simple app, which contains one textview.and my problem is that I
I developed an app which takes 2-3 seconds to start up. I want to
I developed a app which has lot of UIWebView displaying HTML data. One of
I developed a PHP web app which interacts with MS SQL 2005 database. User
I developed my site and it works like a charm on my local machine.
I developed a module to display submenus as stand alone module, every thing works
I developed a simple jQuery animation first and later I create a jQuery function
I developed a screen in which there are fields like first name,username,password and email.
I developed a command-line utility which needs to be called from a Java GUI
I developed something in flex. It works great on FF and Safari. But on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.