Will it ever be possible to use config.xml to specify that the app must continue when it is in the background? At this moment my app doesn't continue on iOS in the background.
When I view my app on an iOS device through the native browser and I start an other app it is still running in the background, but with Phonegap Build it isn't:(.
When I view my app on an iOS device through the native browser and I start an other app it is still running in the background, but with Phonegap Build it isn't:(.
- 2 Posts
- 0 Reply Likes
- sad
Posted 8 years ago
- 1941 Posts
- 89 Reply Likes
Hey S1f1,
We have not exposed this via our config.xml yet, I've added it to our backlog of tasks to look at/implement.
Hardeep Shoker
We have not exposed this via our config.xml yet, I've added it to our backlog of tasks to look at/implement.
Hardeep Shoker
- 2 Posts
- 0 Reply Likes
Hi Hardeep,
Thank you for adding it to your backlog, it would be great if this will be supported in the future. At the moment I'm building an application with phonegap build for a company that would create many more phonegap apps if this feature will be supported. Thanks!
S1f1
Thank you for adding it to your backlog, it would be great if this will be supported in the future. At the moment I'm building an application with phonegap build for a company that would create many more phonegap apps if this feature will be supported. Thanks!
S1f1
- 1 Post
- 0 Reply Likes
Hello,
Is there any news about an app running in background?
We are also developing in phonegap and it is very important.
Is there any news about an app running in background?
We are also developing in phonegap and it is very important.
- 40 Posts
- 3 Reply Likes
- 1 Post
- 1 Reply Like
- 0 Posts
- 0 Reply Likes
Any news about this? It's a very important feature that miss in PhoneGap.
ryan, Developer
- 1538 Posts
- 132 Reply Likes
Use exit-on-suspend for iOS, keepRunning for Android.
iOS: https://build.phonegap.com/docs/confi... (see exit-on-suspend preference)
Android: http://docs.phonegap.com/en/3.0.0/gui...
iOS: https://build.phonegap.com/docs/confi... (see exit-on-suspend preference)
Android: http://docs.phonegap.com/en/3.0.0/gui...
- 3 Posts
- 0 Reply Likes
Can you elaborate a little bit on how this would be implemented using the links you just provided above?
ryan, Developer
- 1538 Posts
- 132 Reply Likes
Add the following tags to your config.xml file:
These preference settings should cause your app to stop running when the user 'hides' it on iOS and Android, respectively.
<preference name="exit-on-suspend" value="true" />
<preference name="keepRunning" value="false" />
These preference settings should cause your app to stop running when the user 'hides' it on iOS and Android, respectively.
- 36 Posts
- 0 Reply Likes
Hello.
I've tried the keepRunning preference (true) but don't work for me...
Any suggestion?
I've tried the keepRunning preference (true) but don't work for me...
Any suggestion?
ryan, Developer
- 1538 Posts
- 132 Reply Likes
I just tested this as well and discovered that the Cordova docs are not clear on this behaviour. Setting KeepRunning=false will not actually cause your app to be killed upon being put in the background -- it will simply halt any execution of code in the webview while the app is in the background.
i.e:
If keepRunning=false then that code will not execute while the app is in the background.
I've send a request to clarify those docs.
i.e:
setInterval(function() {
console.log('running!');
}, 3000);
If keepRunning=false then that code will not execute while the app is in the background.
I've send a request to clarify those docs.
- 36 Posts
- 0 Reply Likes
Thank you Ryan. So... there is a way to mantain running the app in background and prevent the os to kill the app?
ryan, Developer
- 1538 Posts
- 132 Reply Likes
Tommaso are you finding that the OS is killing your app when hidden? By default the app should continue to run in the background.
Can you share your App ID? Also what platform (iOS, Android version) are you testing on?
Can you share your App ID? Also what platform (iOS, Android version) are you testing on?
- 36 Posts
- 0 Reply Likes
My app is killed by Android after some time that is in background. My app ID is 387141
My android version is 4.1.2
My android version is 4.1.2
- 15 Posts
- 1 Reply Like
Hi Tommaso
Android kill the backgrounds app when S.O. need more resources.
With PGB you haven't solutions.
You must write a Android Service that check if the App is running, otherwise restart it.
You must use this plugin
https://github.com/Red-Folder/Cordova...
But you must use Eclipse and ADK .
For iOS you can't use PGB if you want running app in background,
because you must change in plist this key "UIBackgroundModes" and PGB not permit it, you must use xCode
For iOS you can't use PGB if you want running app in background,
because you must change config.xml (only for webworks) adding this parameter:
run_when_backgrounded
My hope for the future is PGB can do all this.
Android kill the backgrounds app when S.O. need more resources.
With PGB you haven't solutions.
You must write a Android Service that check if the App is running, otherwise restart it.
You must use this plugin
https://github.com/Red-Folder/Cordova...
But you must use Eclipse and ADK .
For iOS you can't use PGB if you want running app in background,
because you must change in plist this key "UIBackgroundModes" and PGB not permit it, you must use xCode
For iOS you can't use PGB if you want running app in background,
because you must change config.xml (only for webworks) adding this parameter:
run_when_backgrounded
My hope for the future is PGB can do all this.
- 36 Posts
- 0 Reply Likes
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers






Muhammad Umer
Muhammad Umer