team-telnyx / telnyx-webrtc-android

Telnyx Android WebRTC SDK - Enable real-time communication with WebRTC and Telnyx
MIT License
13 stars 2 forks source link

How to update firebase token? #320

Closed Del-S closed 11 months ago

Del-S commented 1 year ago

So is there a way to update firebase token in the SDK? I only see firebase token updates using login. But it does not seem right to force new login when firebase token changes. Can there be an option to update only the token without the need to login again?

isaacakakpo1 commented 12 months ago

@Del-S we currently only support updating the FCM Token at login (at least from the client side). Also I believe FCM tokens change usually in scenarios like Clearing Storage Data or Uninstalling the App. Is there a particular use-case you consider this an important feature ?

Del-S commented 12 months ago

Okay so the cases based on the docu are like this:

The registration token may change when:

  • The app is restored on a new device
  • The user uninstalls/reinstall the app
  • The user clears app data.

So I guess we care about reinstall or restore since those can restore app data. In those cases if user does that. It would be expected that user can still receive FCM notifications for incomming calls. To support this currently we would have to login to telnyx which creates a socket that receives the calls so again we do not receive fcm notifications.

So I guess the only option is to connect - login - logout and disconnect. Which seems like a hassle to just update FCM token. I would expect a function which will have user credentials and new fcm token which will update it on the telnyx side without the need to create a socket connection.

isaacakakpo1 commented 12 months ago

Alright Understood. So Implementation wise you would like to make an http request instead of this connect - login - logout and disconnect for just updating FCM tokens. I can ask of that is possible on our backend side.

So mainly it is mostly about registering FCM tokens in general.

Del-S commented 12 months ago

Nice thanks.

isaacakakpo1 commented 11 months ago

@Del-S I discussed this with our team and their response was that, the only way to update push token is if user can be authenticated properly hence the login method can not be avoided. An alternative was to use Bearer tokens but currently we do not use those for any requests on the client side. So I guess we'll need to stick with sockets for this, if it's not a big deal.

Del-S commented 11 months ago

Ok then. Thank you for the information. :)