You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use notifications in my Vue/Cordova application. I have installed cordova-plugin-dialogs and calling the beeb like this in my App.vue when message arrives:
Nothing happens. I must be doing something wrong. If I remove the condition I get error that notification is undefined.
I do understand that plugins require onDeviceReady event to work but where does this go:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(navigator.notification);
}
I have tried putting it to main.js in my vue folder but it does not work. The documents and previous answers to this issue seem to suggest that cordova.js in the cordova project folder is already handling the onDeviceReady call and navigator global variable should be available in vue but it isn't. I don't think the plugin usage has been properly explained yet. Could anybody help, please?
The text was updated successfully, but these errors were encountered:
So it appears that the problem is with navigator.notification. It does not work for some reason or another. But when I tested with navigator.camera, it will work as intended
I am trying to use notifications in my Vue/Cordova application. I have installed cordova-plugin-dialogs and calling the beeb like this in my App.vue when message arrives:
if(navigator.notification && navigator.notification.beep) navigator.notification.beep(6)
Nothing happens. I must be doing something wrong. If I remove the condition I get error that notification is undefined.
I do understand that plugins require onDeviceReady event to work but where does this go:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(navigator.notification);
}
I have tried putting it to main.js in my vue folder but it does not work. The documents and previous answers to this issue seem to suggest that cordova.js in the cordova project folder is already handling the onDeviceReady call and navigator global variable should be available in vue but it isn't. I don't think the plugin usage has been properly explained yet. Could anybody help, please?
The text was updated successfully, but these errors were encountered: