Pushwoosh / pushwoosh-phonegap-plugin

Pushwoosh PhoneGap Build Plugin
Other
109 stars 139 forks source link

Remote Notification Status may be incorrect #235

Closed yjukaku closed 7 years ago

yjukaku commented 7 years ago

Thank you for your work on this plugin!

When using the latest plugin on iOS, calling pushwoosh.getRemoteNotificationStatus returns a status object like:

{pushAlert: "0", enabled: "1", type: "0", pushBadge: "0", pushSound: "0"}

This device has Notifications disabled in the iOS settings menu, so I would expect enabled to equal false or "0". Additionally, there is no documentation on the possible return types for each of the attributes. It looks like on iOS, type == "0" if notifications are disabled, but I'm not sure.

wfhm commented 7 years ago

Hi,

This device has Notifications disabled in the iOS settings menu, so I would expect enabled to equal false or "0".

enabled is a status of a notifications subscription, so, since your device was registered with Pushwoosh it shows enabled: "1". The parameter you look for is pushAlert which indicates whether alert permission is granted or not.

Below you can find a link to docs for the pushwoosh.getRemoteNotificationStatus method with all parameters described:

http://docs.pushwoosh.com/docs/cordova-api-reference#section-getremotenotificationstatus

Values for all the parameters but type are always 1 or 0, "enabled" or "disabled' correspondingly.

"type" is a bit mask of all the rest parameters excluding enabled, so, if pushAlert, pushBadge and pushSound are "0" then type == "0", if these params are all "1", then type == 7.