Comments (3)
Sorry, which part isn't working?
I had a quick look at your code, but couldn't understand what you where executing in the background
from bgs-core.
Hello Mark Taylor,
About my app, my friend make his app using mobile web you can see at
http://www.psschool.in.th ,
He want to build his app to android application and has more feature Ex,
push notification, badge number and more.
So, I used cordova to build android application from his mobile web.
The first version I build app with cordova and add these plugin.
-
push notification I used this plugin -->
https://github.com/phonegap-build/PushPlugin -
and open the web http://www.psschool.in.th I used this plugin -->
https://github.com/apache/cordova-plugin-inappbrowser -
I get the app version by this plugin -->
https://github.com/whiteoctober/cordova-plugin-app-version -
and alert message using this plugin -->
https://github.com/apache/cordova-plugin-dialogs -
and check the internet connection using this plugin -->
https://github.com/apache/cordova-plugin-network-informationAbout this app,
When start app my app will check the internet connection using plugin
cordova-plugin-network-information,- if can't connect to internet my app alert message using plugin
cordova-plugin-dialogs - if internet connection is connected
- my app will get app version using plugin
cordova-plugin-app-version
- my app register PushPlugin
- my app open http://www.psschool.in.th using plugin
cordova-plugin-inappbrowser
Everything can work, my app can run success with push notification. and
run on android 4.0+.
After that he want to show the badge number on the app icon in android (
look like icon on iphone or Line icon when push message come in ). In this
case I use this method to solve problems., - if can't connect to internet my app alert message using plugin
-
I used your plugin to build the background process for get the badge
number from server every 3 sec. -
Then I used this plugin https://github.com/katzer/cordova-plugin-badge
to show the badge number on the app iconEverything can work as well, But when I exit my app I can't get the
badge number from server every 3 sec. but the PushPlugin can work after
exit the app (after exit the app, I send message , my app can push
notification),
In this case I test by create new simple cordova project with your
sample -->
https://github.com/Red-Folder/bgs-core/wiki/Using-the-MyService-Sample and
add this plugin --> https://github.com/apache/cordova-plugin-dialogs to
beep every 3 sec. Everything ok when i open app or minimize app the beep is
on but when exit app the beep is off.Please help or recommend me how to do.
How to build the background process can get the badge number from server
after exit the app look like PushPlugin. (for simple case the beep is on
every 3 sec. after exit app)
And I attach my index.html file to your e-mail.I apologize if my English skill is not good.
Thank you for your advice.
from bgs-core.
I believe the problem is that your logic relies on JavaScript to complete the work. JavaScript is only available to you when the app is running.
Cordova/ Phonegap app is providing a container in which JavaScript (and plugins) can run. Without it running you cannot use JavaScript (or other plugins).
BGS-Core allows you to extend the BackgroundService class in Java (different from JavaScript). Putting your functionality into the doWork() method of the class will allow it to run without Cordova/ Phonegap because it is using Java (not JavaScript). When doing this you are effectively natively programming an Android app.
To reiterate, when the app is closes, the background service has no access to:
- Cordova/ Phonegap functions or plugins
- JavaScript
from bgs-core.
Related Issues (20)
- Error Occurs on startService(success,failed) ;
- Backgound service stops when the app is terminated HOT 2
- creating multiple service class HOT 2
- Does this plugin works with local notifications? HOT 2
- Integrating with NotificationListenerService would it work?
- If Background Service is Running Through Any Local Notification or Alerts?
- Where to put MyService.java in IONIC? Android is unable to find/bind. HOT 2
- Error on Boot
- Its not working in Android 10 HOT 1
- running cordova inside of a service HOT 5
- What is service will not running when app closed ? HOT 8
- It's Possible MyService.java Call Javascript Function ? HOT 3
- ideas to make a service to continue receiving push notifications HOT 2
- Build Android Error HOT 13
- Add method onCleanup to override
- Can I load a third party android library?
- Service starting but restart on exit failing
- Application run but factory is empty
- How to stop a Countdown when the App is backgrounded (Xamarin forms) HOT 2
- Detect the volum up pression in background service
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 bgs-core.