- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to keep a APP running in background. I found this plugin: https://github.com/katzer/cordova-plugin-background-mode
I inserted the .js file on index.html after cordova.js: <script type="application/javascript" src="js/background-mode.js"></script>
When I use the emulator XDK, there is an error: ReferenceError: require is not defined
Looking inside the .js file, there ares these lines:
var exec = require('cordova/exec'),
channel = require('cordova/channel');
How I can supply these complements? There is another way to do that?
Thank you.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found the solution... the "Third-Part Plugins" of XDK!!!
I just imported the plugin and it works.
Great.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you like that plugin? Would you recommend it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Arua> Yes, I use this plugin. In general, it works OK. In some cases, when it is working, it loses the function. In this case, the app don´t return. It is necessary to kiil the app to reopen. You can see it working in "Speak to WhatsApp" (https://play.google.com/store/apps/details?id=com.hamiltonhtsnet.com.br.faleparaowhatsapp2) or "Speak do Chat" (https://play.google.com/store/apps/details?id=com.hamiltonhtsnet.com.br.faleparabatepapoplus).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI HAMILTON, HOW YOU USE THE PLUGIN, BECAUSE I CAN USE!!!
THANKS!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Facundo> I just inserted a third-party plugin (de.appplant.cordova.plugin.background-mode) and control it inside the script.
In my case, I have an option to user define if he/she wants the background mode.
Did you see my apps? Try them to see the plugin working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I could not install with the "Third Party Plugin", it sends me errors everytime

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page