Closed int3rnet closed 6 years ago
If user does not allow application to receive notifications it can still receive silent pushes (pushes without alert, badges and sound) if application has "Background Modes" capability. So it is not the error case of push registration and application successfully receives push token. getRemoteNotificationStatus() (specifically "pushAlert" property) can be used to determine whether user allowed application to show notifications.
many thnx @DimanAM
So what is the cases caused the pushwoosh token didn't generated !!!
i been saving pushwoosh token for users for a long time , some users doesn't have token
doesn't means he disallowed the push notification or the pushwoosh plugin didn't recognize the phone !???
thnx
@int3rnet is this issue still present?
Please note that we could not reproduce the issue with missing push tokens with latest Pushwoosh plugin version.
Could you please check the guide below and let us know if there are any differences between it and your Pushwoosh integration?
Dear in pushwoosh
good times guys , i have a code for init pushwoosh in Cordova but i need to fire a trigger once the user not allowed the push plugin
this is my code 👍
`
function onPushwooshInitialized(pushNotification) {
}
function initPushwoosh() { var pushNotification = cordova.require("pushwoosh-cordova-plugin.PushNotification");
}
var app = { // Application Constructor initialize: function() { this.bindEvents(); }, // Bind Event Listeners // // Bind any events that are required on startup. Common events are: // 'load', 'deviceready', 'offline', and 'online'. bindEvents: function() { document.addEventListener('deviceready', this.onDeviceReady, false); }, // deviceready Event Handler // // The scope of 'this' is the event. In order to call the 'receivedEvent' // function, we must explicity call 'app.receivedEvent(...);' onDeviceReady: function() { initPushwoosh(); app.receivedEvent('deviceready'); }, // Update DOM on a Received Event receivedEvent: function(id) { var parentElement = document.getElementById(id);
};
app.initialize();
`
so i must get this code if i didn't allow the push
alert("failed to register: " + status);
but the problem it's still working and return the device token
so please how can i catch this case so i can append some action or close the app untill he authorized the push