Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: OptIn() is not working and not updating OneSignal Dashboard #2104

Open
1 task done
simranthakkar1996 opened this issue May 30, 2024 · 1 comment
Open
1 task done

Comments

@simranthakkar1996
Copy link

simranthakkar1996 commented May 30, 2024

What happened?

Using 5.1.13 release.

Calling OneSignal.getUser().getPushSubscription().optOut() does opt the user out as reflected on the dashboard. However, immediately calling OneSignal.getUser().getPushSubscription().optIn() doesn't change the opt-in status, user is still opt-out on the dashboard and cannot receive notifications.

I tried referring 2 bugs that were reported
#1837
OneSignal/OneSignal-Flutter-SDK#729

And they mentioned that it was solved in newer release but its still not working
Also I did put debug points in below code and it is going into the respective optIn() and optOut()
And optOut() works as expected as well it changes status on Dashboard
But when we turn it on from settings it goes into OptIn() condition but its not doing anything on OneSignal side

if (isEnabled) {
            OneSignal.getUser().getPushSubscription().optIn();
        } else {
            OneSignal.getUser().getPushSubscription().optOut();
        }

Also I am using requestPermission to prompt the dialog for notification permission

Steps to reproduce?

Mentioned above

What did you expect to happen?

User should change the status subscribed after calling optIn in OneSignal dashboard and should be able to send the notification successfully

OneSignal Android SDK version

5.1.13

Android version

13

Specific Android models

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@simranthakkar1996 simranthakkar1996 changed the title [Bug]: [Bug]: OptIn() is not working and not updating OneSignal Dashboard May 30, 2024
@jennantilla
Copy link
Contributor

Hello @simranthakkar1996 thank you for reaching out! Would you be able to send over a log of from the device reproducing this behavior so we can see if there are any clues there?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants