Send message when certain time past the hour is reached
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Send message when certain time past the hour is reached
Hi Everyone,
I would like to make an IOS app that runs in the background and check the current time and have it send a message when 15 past the hour has been reached.
Can you show me the coding to make this work?
Thanks.
I would like to make an IOS app that runs in the background and check the current time and have it send a message when 15 past the hour has been reached.
Can you show me the coding to make this work?
Thanks.
Re: Send message when certain time past the hour is reached
Hi.
Try something like this in a button somewhere:
Now, do you see how this works?
Craig Newman
Try something like this in a button somewhere:
Code: Select all
on mouseUp
doItIn15after
end mouseUp
on doItIn15after
set the itemDel to ":"
if word 1 of item 2 of the short time = "15" then
doYourThing
exit to top
end if
send "doItIn15after" to me in 1 seconds
end doItIn15after
on doYourthing
answer "See how this works?"
end doYourthing
Craig Newman
Re: Send message when certain time past the hour is reached
Funny this just came up on the list today:
http://runtime-revolution.278305.n4.nab ... 58145.html
Simon
http://runtime-revolution.278305.n4.nab ... 58145.html
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Send message when certain time past the hour is reached
Hi friends,
are you sure that Livecode can really run iOS apps in the background?
I thought this is not (yet) supported and an app just quits?!
Best
Klaus
are you sure that Livecode can really run iOS apps in the background?
I thought this is not (yet) supported and an app just quits?!
Best
Klaus
Re: Send message when certain time past the hour is reached
Thanks for the replies and help.
I do hope LiveCode can handle background processing because I want to make a reminder app on IOS with it.
I do hope LiveCode can handle background processing because I want to make a reminder app on IOS with it.
Re: Send message when certain time past the hour is reached
Hi rleiman,rleiman wrote:Thanks for the replies and help.
I do hope LiveCode can handle background processing because I want to make a reminder app on IOS with it.
only very few kind of applications are allowed to run in background by Apple and ... for sure, NOT reminder Apps (note, I say by Apple, not because using LiveCode) ...

The only solution is this one : http://lessons.runrev.com/s/lessons/m/4 ... ifications ... using the "Local Notifications"

Guglielmo
Re: Send message when certain time past the hour is reached
Hi,
Thanks for the reply. Looks like I may be able to use the local notifications if I can do it without showing a dialog box because I want to play an audio file at that time and not show the user any messages.
I hope this is possible to do.
If it is, then I will purchase a "Pay as you go" license.
Thanks.
Thanks for the reply. Looks like I may be able to use the local notifications if I can do it without showing a dialog box because I want to play an audio file at that time and not show the user any messages.
I hope this is possible to do.
If it is, then I will purchase a "Pay as you go" license.
Thanks.
Re: Send message when certain time past the hour is reached
Hi rleiman,rleiman wrote:Hi,
Thanks for the reply. Looks like I may be able to use the local notifications if I can do it without showing a dialog box because I want to play an audio file at that time and not show the user any messages.
I hope this is possible to do.
If it is, then I will purchase a "Pay as you go" license.
Thanks.
mmm ... I don't think that this is possible and, I repeat, not because LiveCode, but because the "privacy" and "security" limits that Apple imposes !
As you can read on the linked tutorial, if the application is running when the notification is received it can handle the display of the notification as required. If the app is not running then the user is notfied and can choose what action to take ...
If the App is not running ... ONLY the user can authorize the start ...

Guglielmo
Re: Send message when certain time past the hour is reached
Another solution is ... declaring the App as "Supported Background Tasks" ("audio" is one of the seven possibles background task class) but ... subject to strict Apple approval process for this kind of applications (... they are quite strong on background tasks).
More ... to create a "Long-Running Background Tasks" you have to modify the "Setting.plist" inside LiveCode and ... is an "RunRev unsupported" change.
I suggest you to read this Apple document ...
http://developer.apple.com/library/ios/ ... sFlow.html
Guglielmo
More ... to create a "Long-Running Background Tasks" you have to modify the "Setting.plist" inside LiveCode and ... is an "RunRev unsupported" change.
I suggest you to read this Apple document ...
http://developer.apple.com/library/ios/ ... sFlow.html
Guglielmo
Re: Send message when certain time past the hour is reached
Wow. That's overwhelming.
Since I'm a beginner I thought a simple app that will play an audio file at 15 past the hour would be easy to do. I was hoping to let the user start the app and leave it alone while the user goes and does other things on the phone and when 15 past the hour is reached the audio file will play.
Will the app quit if the user move focus away from the running app?
I guess another question I have is if the user restarts the phone is there a way to have the app automatically restart without any intervention from the user?
Since I'm a beginner I thought a simple app that will play an audio file at 15 past the hour would be easy to do. I was hoping to let the user start the app and leave it alone while the user goes and does other things on the phone and when 15 past the hour is reached the audio file will play.
Will the app quit if the user move focus away from the running app?
I guess another question I have is if the user restarts the phone is there a way to have the app automatically restart without any intervention from the user?
Re: Send message when certain time past the hour is reached
Yes ... unfortunately is not something really for a "beginner" ... but really, you have to read and to understand the linked Apple page about the "Applications Flow" (... and the different "state" ... Running, Suspended, Background, etc) and what is allowed and what not 
iOS is easy for users, but not for programmes ...
Guglielmo

iOS is easy for users, but not for programmes ...

Guglielmo
Re: Send message when certain time past the hour is reached
I guess if a sound file is allowable as a background task then I think working this sort of backward may help.
Make a 1 hour long audio track with 59 minutes of silence. Of course you would have to add start times based on current time to get the :15 alarm.
Doubt you can get that pass Apple. But I'm only giving a possible solution to the current task.
Simon
Make a 1 hour long audio track with 59 minutes of silence. Of course you would have to add start times based on current time to get the :15 alarm.
Doubt you can get that pass Apple. But I'm only giving a possible solution to the current task.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!