Page 1 of 1
LC Run Alert in Mobile environment in the background? - Solv
Posted: Fri Dec 23, 2016 2:22 pm
by DR White
Can LiveCode run in a Mobile environment in the background?
I want to make an app that reminds me to do certain things at certain times and certain dates.
Can LC be used to do something like this?
Thanks,
David
Re: Running a program in the background?
Posted: Fri Dec 23, 2016 2:39 pm
by Klaus
Hi David,
just made a little test within the IDE with this script:
Code: Select all
on mouseUp
send "xxx" to me in 30 secs
end mouseUp
command xxx
answer "Reminder..."
end xxx
Then I switched over to Safari, waited a couple of seconds and got this, see screenshot.
Maybe that helps?
Best
Klaus
Re: Running a program in the background?
Posted: Fri Dec 23, 2016 3:44 pm
by dunbarx
What Klaus said.
Here is another little gadget you might try. On a new card with a field and a button. This in the button script:
Code: Select all
on mouseUp
put 0 into fld 1
doCounter
end mouseUp
on doCounter
add 1 to fld 1
if fld 1 = 10 then
answer "Done"
exit to top
end if
send "doCounter" to me in 1 second
end doCounter
You can do whatever you want in another app while watching the counter back in LC.
Craig Newman
Re: Running a program in the background?
Posted: Thu Dec 29, 2016 3:56 pm
by DR White
I tried the suggested code from both Klause and Craig but:
When, I press "Home" on my iPhone 6, while the LC app is counting up, I do not see the field counting up or the message box, when the counter reaches 10.
I need a way of display a message from my LC app, after I initiate a timer in LC and after I press the iPhone Home button.
Is it possible with LC?
Thanks,
David
Re: Running a program in the background?
Posted: Thu Dec 29, 2016 4:32 pm
by Klaus
Hi David,
DR White wrote:IWhen, I press "Home" on my iPhone 6, while the LC app is counting up, I do not see the field counting up or the message box, when the counter reaches 10.
I would be a good idea to note IMMEDIATELY that you are looking for a solution for MOBILE,
in all NON mobile forums we presume a DESKTOP problem!
Maybe you can "fire" a local notification for this?
Check "mobileCreateLocalNotification" etc. in the dictionary.
Best
Klaus
Re: LC Run a program in Mobile environment in the background
Posted: Thu Dec 29, 2016 4:55 pm
by DR White
Klaus,
Thanks,
David
Re: LC Run a program in Mobile environment in the background
Posted: Fri Dec 30, 2016 8:26 pm
by DR White
Klaus,
I think you might be right about using "mobileCreateLocalNotification" for an alarm function.
I looked it up in the dictionary and appears to have the functionality I want, but I have not been successful in getting "mobileCreateLocalNotification" to work. I went to a LC site to learn more about it (
http://lessons.livecode.com/m/4069/l/58 ... ifications), but could not get the sample file to work.
Do you know where I might find more information on this?
Thanks,
David
Re: LC Run a program in Mobile environment in the background
Posted: Fri Dec 30, 2016 9:21 pm
by DR White
The above sample works fine. I forgot to "check" the box for "Local Notification" in the IOS setup.
David
Re: LC Run a program in Mobile environment in the background
Posted: Sat Dec 31, 2016 12:42 am
by DR White
We'll, it worked fine on the IOS simulator,
but not when I tested it on my iPhone 6.