Skip to content

Keeping long term stream open with custom tokens #644

Answered by mobizt
peterz0310 asked this question in Q&A
Discussion options

You must be logged in to vote

I recommend you set custom token with setCustomToken only one time, and when token is ready (Firebase.ready), you save the refresh token from Firebase.getRefreshToken() as file.

After 30 minutes or whenever you want, call setCustomToken again with the refresh token and set config.signer.preRefreshSeconds to 30 minutes or any.

The token is now will be refresh automatically.

After your device reboot, you can read the refresh token from file and set it to setCustomToken which custom token will not be required anymore.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@peterz0310
Comment options

@mobizt
Comment options

@peterz0310
Comment options

@mobizt
Comment options

@peterz0310
Comment options

Answer selected by peterz0310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants