Comments (5)
No need background-mode plugin if you want to implement push notifications. It will run automatically.
from cordova-plugin-background-mode.
thats right ;)
from cordova-plugin-background-mode.
Am I the only one who does NOT get any push notifications whatsoever when the app is minimized? I'm using Android 4.1.2, the pushplugin, the local-notification and this background-mode plugin which I called with window.plugin.backgroundMode.enable(); at the onDeviceReady() event, yet when the app is minimized nothing keeps working. I even added the KeepRunning=true attribute to my config.xml, but everything is pointless. Any suggestions? Thanks...
from cordova-plugin-background-mode.
(WARNING: ANDROID ONLY)
The push notification plugin has no knowledge of the background-mode plugin. SO i modified the push-notification plugin to always send the notification to the app as if in foreground, see my fork : https://github.com/boltex/PushPlugin
Now you only need to set the background-mode active and react accordingly in your app when you receive push notifications. (Will always be treated without popups in the notification area, as "Foreground") Be aware that from now on, if you want something to appear in the notification bar, you need the local-notification plugin to make them appear yourself.
from cordova-plugin-background-mode.
Thanks, I'll try that. Anyway, I first have to fix a problem because after installing the background-mode plugin, the build fails due to a strange Java error (BackgroundMode.java:295: error: incompatible types). Since I didn't notice that, I was always re-running the older version without the plugin, since the compiler runs the app regardless of a successfull or failed compilation when the APK exists... I'm updating JDK to version 8 to see if that solves the problem, otherwise, I'll never be able to compile my APK with this plugin. I reverted to Cordova 3.6.3, yet the problem persists, JDK 8 is my last hope now.
from cordova-plugin-background-mode.
Related Issues (20)
- In iOS, next audio is not playing when app is in background
- Keep youtube iframe video playing when app is in background HOT 10
- Cannot read properties of undefined (reading 'backgroundMode') HOT 2
- App crashes in Android!
- Not run on Android 11 HOT 1
- Not working with cordova-android 10 HOT 1
- 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
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.