Is there anyway to move an app from background to foreground programmatically?

3,268 views
Skip to first unread message

Rob Willett

unread,
Sep 11, 2016, 3:40:29 AM9/11/16
to phon...@googlegroups.com
Hi,

We think that the answer to this is "no", at least for IOS. but we wanted to ask the wisdom of the group.

One of the customers has asked if we could could make our app come to the front when they start driving from home. Our app provides personalised traffic updates. We can work out when they start driving but we can't see anyway to get the app out of background into the foreground, such as when the phone rings. 

We have searched Google and seen this


which appears to only be for Android and was last updated two years ago.

This website alludes to the problem but doesn't really solve it, at least for IOS.


We could create a local notification to remind the user and get the user to click on it to bring the app into the foreground, thats a bit clunky but is doable.

This stackoverflow question and answer seems to get the crux of the issue


with the answer 

"When the operating system delivers push notification (iOS or OS X) and the target application is not running in the foreground, it presents the notification (alert, icon badge number, sound). If there is a notification alert and the user taps or clicks the action button (or moves the action slider), the application launches and calls a method to pass in the local-notification object or remote-notification payload. If the application is running in the foreground when the notification is delivered, the application delegate receives a local or push notification."

So is there something we've missed or some clever trick, or is it pretty much impossible?

Thanks

Rob



mharr

unread,
Sep 11, 2016, 11:43:25 AM9/11/16
to phonegap
I believe the push notification option you presented is not only the only way, but the better way as opposed to what you are looking for.

I would not want an application to presume to know better than I which application I have running in foreground.  You can offer a reminder (a notification) that I might want to run your application, but I do not want a developer or company to arrogantly assume I want their application in the foreground.  The notification option offers a reminder, and leaves me with the decision if I want to run your application at that time.

I believe that also is Apple's philosophy, that the device is a user's personal device, where the user is to be in control on what application runs or does not run.

Hope this 2¢ helps.

Rob Willett

unread,
Sep 11, 2016, 11:52:48 AM9/11/16
to phonegap
Thanks. We thought that was the case but since we'd been asked we thought we'd investigate.

We'll have a think and see if we want to do it.
--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
---
You received this message because you are subscribed to the Google Groups "phonegap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phonegap+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages