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

generate new token #21

Open
GregoryError opened this issue Aug 23, 2019 · 3 comments
Open

generate new token #21

GregoryError opened this issue Aug 23, 2019 · 3 comments

Comments

@GregoryError
Copy link

GregoryError commented Aug 23, 2019

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?

@Larpon
Copy link
Owner

Larpon commented Aug 25, 2019

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

@GregoryError
Copy link
Author

GregoryError commented Aug 25, 2019

@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?

@Larpon
Copy link
Owner

Larpon commented Aug 26, 2019

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.

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

2 participants