-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(messaging): tokenReceived listener is not triggered #838
Conversation
Trigger token received on manual token generation on android.
Generate changeset.
@capacitor-firebase/analytics
@capacitor-firebase/app
@capacitor-firebase/app-check
@capacitor-firebase/authentication
@capacitor-firebase/crashlytics
@capacitor-firebase/firestore
@capacitor-firebase/functions
@capacitor-firebase/messaging
@capacitor-firebase/performance
@capacitor-firebase/remote-config
@capacitor-firebase/storage
commit: |
On the web the listener is not supported. Unless we want to manually trigger it when The behavior on Android is different as described here. I added the call to trigger |
@@ -133,6 +133,7 @@ public void success(String token) { | |||
JSObject result = new JSObject(); | |||
result.put("token", token); | |||
call.resolve(result); | |||
handleTokenReceived(token); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not really what I had in mind, since the listener is now called every time you get the token and not just when it has changed. This is a problem because many people use the listener to send the updated token to the server, which can now lead to an unnecessary number of requests. Let me take a quick look at it myself.
@ebarooni Okay, I've just had a look myself. The |
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run changeset
).Closes: #820