LC Run Alert in Mobile environment in the background? - Solv

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: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

LC Run Alert in Mobile environment in the background? - Solv

Post by DR White » Fri Dec 23, 2016 2:22 pm

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
Last edited by DR White on Sat Dec 31, 2016 2:47 pm, edited 4 times in total.

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Running a program in the background?

Post by Klaus » Fri Dec 23, 2016 2:39 pm

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
reminder_lc.jpg

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Running a program in the background?

Post by dunbarx » Fri Dec 23, 2016 3:44 pm

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

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: Running a program in the background?

Post by DR White » Thu Dec 29, 2016 3:56 pm

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

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Running a program in the background?

Post by Klaus » Thu Dec 29, 2016 4:32 pm

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! 8)

Maybe you can "fire" a local notification for this?
Check "mobileCreateLocalNotification" etc. in the dictionary.


Best

Klaus

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: LC Run a program in Mobile environment in the background

Post by DR White » Thu Dec 29, 2016 4:55 pm

Klaus,

Thanks,

David

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: LC Run a program in Mobile environment in the background

Post by DR White » Fri Dec 30, 2016 8:26 pm

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

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: LC Run a program in Mobile environment in the background

Post by DR White » Fri Dec 30, 2016 9:21 pm

The above sample works fine. I forgot to "check" the box for "Local Notification" in the IOS setup.

David

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: LC Run a program in Mobile environment in the background

Post by DR White » Sat Dec 31, 2016 12:42 am

We'll, it worked fine on the IOS simulator,
but not when I tested it on my iPhone 6.

Post Reply