reminder

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Nana
Posts: 38
Joined: Sat Aug 11, 2012 8:01 pm

reminder

Post by Nana » Thu Aug 23, 2012 9:51 am

Hi guys,

i am building a reminder for my mobile and i am using
mobileCreateLocalNotification "The Alert Body", "Show Me", "It is time to do some Exercise", the seconds + 10, true, "1"

With this i get a reminder after 10 seconds. How can i make it to repeat the reminder every 2 hours for example.

Thanks

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2376
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: reminder

Post by jmburnod » Thu Aug 23, 2012 10:40 am

Hi Nana,
Why not

Code: Select all

mobileCreateLocalNotification "The Alert Body", "Show Me", "It is time to do some Exercise", the seconds + 7200, true, "1"
(no tested)

Best regards

Jean-Marc

Nana
Posts: 38
Joined: Sat Aug 11, 2012 8:01 pm

Re: reminder

Post by Nana » Thu Aug 23, 2012 11:05 am

Hi Jean-Marc,

this will send the notification in 2 hours. But i want this to happend every two hours.

Thank you for the reply.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2376
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: reminder

Post by jmburnod » Thu Aug 23, 2012 11:25 am

Hi Nana,


Maybe this one is better.
It use a pendingmessage
You can stop it with the optionkey

Code: Select all

on StartLoopNotification
   DoLoopNotification
end StartLoopNotification

on DoLoopNotification
   if the optionkey is down then 
      stopPending DoLoopNotification
      exit DoLoopNotification
   end if
  
   mobileCreateLocalNotification "The Alert Body", "Show Me", "It is time to do some Exercise", the seconds + 1, true, "1"
   if "DoLoopNotification" is not in the pendingmessages then
      send DoLoopNotification to me in 7200 seconds
   end if
end DoLoopNotification

on stopPending pPending
      repeat for each line aLine in the pendingmessages
      if aLine contains pPending then
         cancel item 1 of aLine
      end if
   end repeat
end stopPending

Nana
Posts: 38
Joined: Sat Aug 11, 2012 8:01 pm

Re: reminder

Post by Nana » Thu Aug 23, 2012 1:46 pm

That is what exactly i wanted! Thank you very much! I just have a last question about this. How can i made it work even if the app window is closed?

Nana
Posts: 38
Joined: Sat Aug 11, 2012 8:01 pm

Re: reminder

Post by Nana » Thu Aug 23, 2012 2:30 pm

Do i have to use Push Notifications???

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2376
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: reminder

Post by jmburnod » Thu Aug 23, 2012 3:22 pm

Nana,
How can i made it work even if the app window is closed
Sorry no idea, but certainly someone have one

Best regards

Jean-Marc

BlaBlaBliBli
Posts: 37
Joined: Sat Oct 06, 2012 12:22 pm

Re: reminder

Post by BlaBlaBliBli » Sat Nov 10, 2012 4:41 pm

Hey guys im looking badly for a reminder , can you please tell me what I have to do for making one ?

Thanks alot!

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”