-
Notifications
You must be signed in to change notification settings - Fork 196
Open
Labels
Description
What happened?
getOptedInAsync returns false twice when toggling optIn/optOut on iOS. Works fine on Android.
Steps to reproduce?
1. Install onesignal-cordova-plugin on a Capacitor project
2. Create a toggle button
3. Add the code from below to the button
4. Tap the toggle button several times
5. Note that getOptedInAsync logs false twice in a row
Code:
pushAllowed = false;
async togglePush() {
if (this.pushAllowed) {
OneSignal.User.pushSubscription.optOut();
} else {
OneSignal.User.pushSubscription.optIn();
}
const optedIn = await OneSignal.User.pushSubscription.getOptedInAsync();
console.log(`optedIn: ${optedIn}`);
pushAllowed = optedIn;
}What did you expect to happen?
I expected getOptedInAsync log to toggle between true and false
OneSignal Cordova SDK version
5.3.1
Which platform(s) are affected?
- iOS
- Android
Relevant log output
optedIn: true
optedIn: false
optedIn: false
optedIn: true
optedIn: false
optedIn: falseCode of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable