-
Notifications
You must be signed in to change notification settings - Fork 370
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
[question]: Disable In app Push Notification with new 5.x version #2097
Comments
@simranthakkar1996 The replacement for |
@jkasten2 I had a doubt so I understand we can use Something that we tried doing is
But there is some inconsistency before getData is object parameter |
@simranthakkar1996 it seems your orignal code was accounting for ensuring push was enabled after permission was accepted, With 5.x.x you can simply call |
So just optIn() and optOut() will do the trick
|
@simranthakkar1996 If you simply have an option in your app to turn push notifications on and off then you can simply call If there is more to it than that please explain in more detail. |
@jkasten2 Actually we wanna show the dialog and based on user selection we wanna either optIn or optOut
To now using Continue
There is just one issue with this new approach that r.getData() is giving an issue that its object and we are expecting boolean type. |
Okay @jkasten2 I think I have figured it out I was referring to this document And they had incorrect as requestPermission was missing a boolean parameter
Its good in this document |
@simranthakkar1996 Ah I see, thanks for pointing out the documentation mistake. We will get that updated. |
I actually have a toggle in the app to enable/disable push notifications. As suggested above, I'm calling Nonetheless, after calling |
Hi @goncalo-oliveira, I don't think you should receive them if you choose "Send Test Push" from the dashboard. Can you confirm that you do not receive if you send as "regular push"? Does your subscription show as "Unsubscribed Subscriber Opted Out" in the dashboard? |
@nan-li thanks for replying.
No, the subscription continues to show as "Subscribed" after calling |
Ok, I'm not sure what happened, but it's working now. I reset the simulator device (which rotated the device's uuid) and it worked as expected.
The code didn't change, so I'm not sure what happened. |
How can we help?
I was following the OneSignal migration guide
https://github.com/OneSignal/OneSignal-Android-SDK/blob/user-model/main/MIGRATION_GUIDE.md
And I have to disable in app message
With the older version we had a parameter (selection) boolean that we were using as parameter of disabling in app push notification.
With the version update I updated the code and according to the migration we can use
boolean getPaused()
void setPaused(boolean value)
but I was just thinking of how we can provide the user selection boolean value to the optOut method that we have in this new version
Thank you so much for the help
Code of Conduct
The text was updated successfully, but these errors were encountered: