OneSignal-Cordova-SDK
OneSignal-Cordova-SDK copied to clipboard
addPermissionObserver function doesn't return any information
Description:
Running the example from the documentation:
window.plugins.OneSignal.addPermissionObserver(function(stateChanges) {
console.log("Push permission state changed: " + JSON.stringify(stateChanges, null, 2));
});
The callback function is fired correctly at each permission changes in my app but the returned variable stateChanges is always empty. addSubscriptionObserver is also fired correctly on my app and returns the correct stateChanges
Environment onesignal-cordova-plugin v 3.0.0 with Angularjs / Android 10 and 11
Steps to Reproduce Issue:
- Add the onesignal-cordova-plugin to your project
- Initialize the plugin with your app ID
- change the system settings to allow or disable notifications for the application
- window.plugins.OneSignal.addPermissionObserver callback is called but stateChanges is always empty
Anything else:
function always returns:
Push permission state changed: { "from": {}, "to": {} }
+1
Any news on that one ?
+1
addPermissionObserver works fine on iOS.
On Android addPermissionObserver always returns:
Cordova Packages:
cli: 10.0.0
common: 4.0.2
create: 3.0.0
lib: 10.1.0
common: 4.0.2
fetch: 3.0.1
serve: 4.0.0
Project Installed Platforms:
android: 10.0.1
ios: 6.2.0
Project Installed Plugins:
cordova-plugin-device: 2.0.3
cordova-plugin-hidescrollbar: 1.0.2
cordova-plugin-network-information: 3.0.0
cordova-plugin-splashscreen: 6.0.0
cordova-plugin-statusbar: 2.4.3
cordova-plugin-webview-proxy: 0.0.3
cordova-sqlite-storage: 6.0.0
onesignal-cordova-plugin: 3.0.0
addPermissionObserver works fine on iOS.
Thanks for the information, didn´t check it on IOS