We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In docs it is mentioned that if you want to listen for push subscription changes, addObserver listener should be used.
addObserver
However it looks like there is no addObserver function so I'm not sure how I can listen to notification changes.
Thank you!
The text was updated successfully, but these errors were encountered:
Hi @xylish7,
Thank you for reporting this issue with our documentation, that we will fix.
The most updated listing of available methods is available in the migration guide here.
The correct method is addEventListener("change", listener) with this example:
addEventListener("change", listener)
const listener = (event: PushSubscriptionChangedState) => { console.log("Push subscription changed: " + (event)); }; OneSignal.User.pushSubscription.addEventListener("change", listener); // Remove the listener OneSignal.User.pushSubscription.removeEventListener("change", listener);
I apologize for the confusion and will update our docs.
Sorry, something went wrong.
I see and no problem😊. Will try with OneSignal.User.pushSubscription.addEventListener("change", listener); . Thank you for your response.
OneSignal.User.pushSubscription.addEventListener("change", listener);
No branches or pull requests
How can we help?
In docs it is mentioned that if you want to listen for push subscription changes,
addObserver
listener should be used.However it looks like there is no
addObserver
function so I'm not sure how I can listen to notification changes.Thank you!
Code of Conduct
The text was updated successfully, but these errors were encountered: