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

Server ACK for FCM token registration #192

Open
robbiehanson opened this issue Feb 4, 2021 · 0 comments
Open

Server ACK for FCM token registration #192

robbiehanson opened this issue Feb 4, 2021 · 0 comments

Comments

@robbiehanson
Copy link
Contributor

There is currently a mechanism for registering FCM tokens with the server. (For push notifications.) This is already implemented, but could be improved.

Theoretically, the (node_id, fcm_token) tuple only needs to be registered once. And after that, only if the tuple changes (e.g. different fcm_token). However, in practice, this optimization isn't feasible for the client. Since the server doesn't send any kind of ack/confirmation, the client doesn't have a clean hook with which it can say, "OK, FCM token xyz has been successfully registered. I'm now free to optimize the client flow to skip sending the FCM token next time."

Because the server doesn't send an ack/confirmation, the client-side registers the FCM token every app launch.

I originally thought this was a minor optimization, but a recent phoenix-kmm issue has me re-thinking this.

The issue was that:

  • there was a bug in the kotlin code that resulted in the FCM token not being sent to the server
  • without the ACK, the user interface has no way of knowing whether or not the token has been properly registered
  • we generally only discover the bug after we start missing incoming payments

If the server sends an ack/confirmation, then the clients can be updated to display this confirmation somewhere within the user interface. I think this would prove very helpful, especially for debugging background payments. I can imagine receiving bug reports from users:

"I can't receive a payment when Phoenix is running in the background?!?! Help me!"

It would be wonderful if we could say respond with something like:

"Go into settings and tap on X. Does it say 'push token registered' ?"

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

1 participant