Comments (12)
Thanks @christocracy - I am looking into https://github.com/Red-Folder/bgs-core/wiki/Build-your-own-Background-Service to implement the background service. However, this plugin is Android only. I will need to look for iOS one too.
Thanks for the clarification, however, I struggle to understand the purpose of cordova-plugin-background-mode then? I thought it was similar to the bgs-core I referenced above.
from cordova-plugin-background-mode.
This is not an issue... Please read the documentation and assess for yourself if it will help you.
from cordova-plugin-background-mode.
No, this plugin will not help you. Android OS can and will kill your app
(where your Javascript lives) when the OS needs memory. The only way to
keep some particular functionality running in background (e.g.:
background-geolocation) is to implement that functionality as an Android
BackgroundService
https://developer.android.com/training/run-background-service/create-service.html
.
You cannot count upon your Javascript to continue running in the background
— you can assume that it will be killed at some point in the future
(minutes to hours)
On Fri, Jul 25, 2014 at 5:32 AM, seematalanki [email protected]
wrote:
hi,
we are building a mobile app which should not get killed even when it is
in background. will this plugin help me in doing so?—
Reply to this email directly or view it on GitHub
#23.
Chris Scott
Transistor Software http://www.transistorsoft.com
from cordova-plugin-background-mode.
@christocracy I need a background service that talks to a backend server with a persistent connection. It is like Viber/telephony application so the server connection needs to be persistent, i.e. I need to receive incoming calls/msgs anytime. I am using socket.io to talk to the server. However, after a few mins, my Android device, for some reason, stops sending the heartbeat, hence server disconnects it.
I think Android OS is pausing (not sure ifI am using the right terminology) the entire application after a while. I have a loop that logs something every 10 seconds, and that loop stops working and nothing get logged.
This happens quicker when leave the device idle for a min and the screen goes dark (even when my application is the top application - when I press the button my application is there so I don't need to launch it from its icon) .
I tried to use this plugin but didn't help. Is it supposed to help though? Do I need to have normal socket service rather than socket.io/websocket?
I had initially thought this was to do with socket.io (hence the SO thread: http://stackoverflow.com/questions/26621732/socket-io-client-is-disconnected-randomly) but I think it is not a socket.io fault.
from cordova-plugin-background-mode.
Are you counting on Javascript continuing to run in the background on
Android? You cannot do this. When your app is running in the background,
Android will kill the app’s Android Activity
http://developer.android.com/reference/android/app/Activity.html (where
Javascript lives) at some point in the future, when memory is required by
the OS.
If you hope to guarantee execution of your application code in the
background, the only way is to do this natively with an Android
Background Service.
http://developer.android.com/training/run-background-service/index.html
On Wed, Nov 5, 2014 at 11:48 PM, drakula84 [email protected] wrote:
@christocracy https://github.com/christocracy I need a background
service that talks to a backend server with a persistent connection. It is
like Viber/telephony application so the server connection needs to be
persistent, i.e. I need to receive incoming calls/msgs anytime. I am using
socket.io to talk to the server. However, after a few mins, my Android
device, for some reason, stops sending the heartbeat, hence server
disconnects it.I think Android OS is pausing (not sure ifI am using the right
terminology) the entire application after a while. I have a loop that logs
something every 10 seconds, and that loop stops working and nothing get
logged.This happens quicker when leave the device idle for a min and the screen
goes dark (even when my application is the top application - when I press
the button my application is there so I don't need to launch it from its
icon) .I tried to use this plugin but didn't help. Is it supposed to help though?
Do I need to have normal socket service rather than socket.io/websocket?I had initially thought this was to do with socket.io (hence the SO
thread:
http://stackoverflow.com/questions/26621732/socket-io-client-is-disconnected-randomly)
but I think it is not a socket.io fault.—
Reply to this email directly or view it on GitHub
#23 (comment)
.
Chris Scott
Transistor Software http://www.transistorsoft.com
from cordova-plugin-background-mode.
Running background javascript is not a problem in iOS. There are a number of ways to execute your javascript in the background.
- Background Fetch event (iOS provides 30s of background-running)
https://github.com/christocracy/cordova-plugin-background-fetch - Background Push Notification (iOS provides 30s of background running)
https://github.com/christocracy/cordova-plugin-background-notification - Background GeoLocation
https://github.com/christocracy/cordova-plugin-background-geolocation
from cordova-plugin-background-mode.
Yes, this Red-Folder guy is great.
On Thursday, November 6, 2014, drakula84 [email protected] wrote:
Thanks @christocracy https://github.com/christocracy - I am looking
into
https://github.com/Red-Folder/bgs-core/wiki/Build-your-own-Background-Service
to implement the background service. However, this plugin is Android only.
I will need to look for iOS one too.Thanks for the clarification, however, I struggle to understand the
purpose of cordova-plugin-background-mode then? I thought it was similar to
the bgs-core I referenced above.—
Reply to this email directly or view it on GitHub
#23 (comment)
.
Snet from Gmail Mobile
from cordova-plugin-background-mode.
Yes, I am going to experiment Red-Folder's plugin on Android. Then I going to looking into your methods for iOS side of the things.
So could you pls let me know what exactly is the purpose of katzer's background-mode plugin? I am probably missing the entire point.
Thanks @christocracy
from cordova-plugin-background-mode.
The purpose of this plugin is to wedge a stick into the mouth of a
crocodile to keep its jaws from closing by hacking ios to keeping battery
draining GPS radio burning or playing silent.wav background sound.
Good luck getting your app through Apple's gates with tactics like this.
On Friday, November 7, 2014, drakula84 [email protected] wrote:
Yes, I am going to experiment Red-Folder's plugin on Android. Then I going
to looking into your methods for iOS side of the things.So could you pls let me know what exactly is the purpose of katzer's
background-mode plugin? I am probably missing the entire point.Thanks @christocracy https://github.com/christocracy
—
Reply to this email directly or view it on GitHub
#23 (comment)
.
Snet from Gmail Mobile
from cordova-plugin-background-mode.
Guys, thats a public plug-in of a bigger enterprise application where connectivity and availability are much more important than battery usage or AppStore compliance!
@seematalanki, yes its the purpose of the plug-in to not get killed even when in background. For iOS there is no perfect solution except you have a special signed key with the right entitlements!
Even the README is not up-to-date, the master branch makes use of a service now for Android.
from cordova-plugin-background-mode.
Please tell me what exactly is your enterprise use-case where you need to
prevent ios from sleeping.
On Sunday, November 9, 2014, Sebastián Katzer [email protected]
wrote:
Guys, thats a public plug-in of a bigger enterprise application where
connectivity and availability are much more important than battery usage or
AppStore compliance!@seematalanki https://github.com/seematalanki, yes its the purpose of
the plug-in to not get killed even when in background. For iOS there is no
perfect solution except you have a special signed key with the right
entitlements!Even the README is not up-to-date, the master branch makes use of a
service now for Android.—
Reply to this email directly or view it on GitHub
#23 (comment)
.
Snet from Gmail Mobile
from cordova-plugin-background-mode.
Perhaps you should put a giant Caveat Emptor warning in your README about
the nature of this plugin (wedging a stick in the jaws of a crocodile),
because this plugin leads many developers who don't understand the
ramifications of the tactics employed, to create poorly behaved
applications.
On Sunday, November 9, 2014, Sebastián Katzer [email protected]
wrote:
Guys, thats a public plug-in of a bigger enterprise application where
connectivity and availability are much more important than battery usage or
AppStore compliance!@seematalanki https://github.com/seematalanki, yes its the purpose of
the plug-in to not get killed even when in background. For iOS there is no
perfect solution except you have a special signed key with the right
entitlements!Even the README is not up-to-date, the master branch makes use of a
service now for Android.—
Reply to this email directly or view it on GitHub
#23 (comment)
.
Snet from Gmail Mobile
from cordova-plugin-background-mode.
Related Issues (20)
- Cannot find name 'BackgroundMode'. with ionic HOT 1
- android-sdk version check failed HOT 3
- ionic background mode not working when phone is unplug in android 10+
- inappbrowser issue
- Background service does not work in SDK 31, app crashes HOT 2
- Ionic: Background mode does not work in Android 12 with API level 31 HOT 7
- Does not work in IOS anymore HOT 1
- I did my own fork to fix moveToBackground on Android HOT 1
- Background mode gives Error Targeting S+ (version 31 and above) on android HOT 3
- THREAD WARNING: exec() call to BackgroundModeExt.foreground blocked the main thread for 41ms. Plugin should use CordovaInterface.getThreadPool(). HOT 1
- App crashes on Android randomly
- App is crashed when moving to background when using a foreground icon HOT 1
- App crashes when enabling background mode on Android 12+ (target SDK level 31+) HOT 5
- CORDOVA: Background mode works for only 5 minutes on android HOT 1
- BSF Cordova Ecosystem Crowdfunding Plan
- For those finding this plugin not working, here's the alternative. HOT 1
- Problem with android build
- I would like to hide the splash screen
- Plugin Background mode
- Plugin installation problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-background-mode.