QtFirebaseExample icon indicating copy to clipboard operation
QtFirebaseExample copied to clipboard

generate new token

Open GregoryError opened this issue 5 years ago • 3 comments

I got now token from overrided java method "onNewToken" in the class ListenerService extends FirebaseMessagingService. But I cant figure out how to refresh token. For example when my user log out and log in again as another user I have to use new token for him. So how to get a new token without instaling the app as a new? maybe I have to call same method in class Main that extends QtActivity?

GregoryError avatar Aug 23 '19 19:08 GregoryError

Hmm... I'm not sure. What does the firebaee documentation say?

larpon avatar Aug 25 '19 15:08 larpon

@Larpon it says that: The registration token may change when:

The app deletes Instance ID

The app is restored on a new device

The user uninstalls/reinstall the app

The user clears app data.

I was thinking about something like deleting cache programmatically but encountered with some issues with threads in Qt. What about first "deletes Instance ID"? Is it possible? What does it mean?

GregoryError avatar Aug 25 '19 20:08 GregoryError

The InstanceID is probably this. I guess it currently has the same life-cycle as the application and will get deleted when the ::App is deleted.

I'm not aware of any code right now that handles multiple instances. But in theory it should be possible to shutdown an instance and bring up a new one - assuming no code is calling anything on the instance - this can be very difficult to detect with QML as it's garbage collected.

larpon avatar Aug 26 '19 09:08 larpon