-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Bug]: Push subscription listener unpredictable #1783
Comments
Hi @hrastnik, thanks for reaching out with your question.
The push subscription listener will fire when any properties change. I think you are asking about the Can you give some exact scenarios where you see the inconsistency? |
@nan-li The issue persists even with native permissions granted. The code I posted actually does request native permissions. I try to track the state of 'optedIn However, in some cases the callback doesn't fire, so my app thinks the user never opted in. |
I've tried to differentiate between scenarios when the callback doesn't fire, but I can't figure it out. After some investigation I think it might be a problem with the native operation queue, but I'm not sure. |
@hrastnik if you reproduce a scenario where the listener is not behaving as expected, please share verbose-level logs starting before you call |
What happened?
On version 5.2.8 (lower version are possibly also affected) on Android after calling
User.pushSubscription.addEventListenter("change", callback)
the callback behaves very unpredictable.When
User.pushSubscription.optIn
orUser.pushSubscription.optOut
is called, it's expected the callback will fire with the new value. However that doesn't happen.Steps to reproduce?
Run this on an Android device:
Click to button at the top of the screen. And observe the logs. I'm not sure why, but sometimes it will log the pushSubscription change event successfully, and at other times, it will not.
What did you expect to happen?
When User.pushSubscription.optIn or User.pushSubscription.optOut is called, it's expected the callback will fire with the new value consistently. However that doesn't happen always.
React Native OneSignal SDK version
5.2.8
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: