OneSignal / OneSignal-Cordova-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com
Other
251 stars 199 forks source link

[Bug]: `promptForPushNotificationsWithUserResponse` does not fire after a user tries to resubscribe on IOS #971

Open maxmandia opened 9 months ago

maxmandia commented 9 months ago

What happened?

Hi 👋

When a user unsubscribes from push notifications we successfully see the user is unsubscribed in OneSignal, however, if we go to our app settings, we see that push notifications are still turned on.

After we perform the steps above, we try to re-subscribe the user using the following logic:

OneSignal.promptForPushNotificationsWithUserResponse(true)

where we expect the user to be prompted to turn notifications on in there settings. However, nothing seems to be happening, and the user is still unsubscribed in OneSignal.

Steps to reproduce?

1. Install "onesignal-cordova-plugin": "^3.3.0"
2. Use a toggle with the code snippet above.

What did you expect to happen?

We excepted the user to be prompted to open their settings to turn notifications back on.

OneSignal Cordova SDK version

3.3.0

Which platform(s) are affected?

Relevant log output

No response

Code of Conduct

emawby commented 6 months ago

@maxmandia You say that the user unsubscribes from push notifications but the permissions are still on. How is the user unsubscribing from push notifications? promptForPushNotificationsWithUserResponse is intended to set the value that you checked in the application settings, so since they still have permissions granted it won't do anything. If you are using the disablePush method then you should set that to false to resubscribe the user.