Good morning everybody...
We have developed an application that at a given moment will vibrate and play an alarm so that the user can see a message.
I'm managing to make it vibrate with the command JAVASCRIPT: navigator.vibrate([1500, 500, 1500, 500, 1500, 500, 1500, 500, 3000]); and I'm using a plugin called DIALOGSPLUGIN which will play a beep along with the vibration.
The problem is that when the app is in the background, it doesn't vibrate and doesn't even play the beep.
We don't want to use more plugins, but if there is no alternative, we will use the problem is that there is no step by step to implement.
We are new in OUTSYSTEMS to development and prefer to do this as the JAVASCRIPT command mentioned above.
Excuse my English because as I don't speak that language, I'm using a translator.
Thanks, MARK.
Hi Rara,
May be the JavaScript API that you are using to give the command to vibrate does not supports foreground service.
A foreground service is a service that runs in the background and is given higher priority than a background service, which means it is less likely to be killed by the system when the app is closed. Try using this Cordova plugin
Hope this help!
Cheers! :)
Shreyas Bhondve,
Thank you for your help. This plugin is the same one I'm using, see:
My javascript command: navigator.vibrate([1500, 500, 1500, 500, 1500, 500, 1500, 500, 3000]);
As it's in the background or the phone is inactive, it doesn't vibrate...
How to make the cell phone wake up and vibrate, because if I have the application open and in the foreground, it vibrates without any problem.
Could someone tell me where I put this event so that I can test it, because without this event, the vibration exists but with the application open.Do I need to trigger this event for it to work when in the background?
Thanks for the plugin, I will use it.