Skip to content

Problem of refresh token on iOS (PWA) #8013

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

Closed
Droppix opened this issue Feb 7, 2024 · 5 comments
Closed

Problem of refresh token on iOS (PWA) #8013

Droppix opened this issue Feb 7, 2024 · 5 comments

Comments

@Droppix
Copy link

Droppix commented Feb 7, 2024

Operating System

iOS 16.4

Browser Version

Safari/604/1

Firebase SDK Version

10.7.2

Firebase SDK Product:

Messaging

Describe your project's tooling

App must confirm our backend (after to receive notification with data)

Describe the problem

When the application has obtained a token (getToken), it submits it to the backend, but this token has a limited lifespan, and when the application is running in the background (on iOS), it's possible that the messaging application's token is no longer good, and unfortunately the server won't be able to send a notification to the application until the application has returned to foreground to renew its token via getToken.

How can I refresh the token while the application is running in backround?

Thanks

Steps and code to reproduce issue

 async getToken() {
        const messaging = getMessaging()
        let token = await getToken(messaging, {
            vapidKey: VAPID_PUBLIC_KEY,
        })

        return token
    }
@Droppix Droppix added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Feb 7, 2024
@jbalidiong jbalidiong added needs-attention and removed new A new issue that hasn't be categoirzed as question, bug or feature request labels Feb 7, 2024
@JVijverberg97
Copy link

I am experiencing the exact same problem! Can this please be fixed? Using iOS 17.1.1

@dlarocque
Copy link
Contributor

dlarocque commented Aug 20, 2024

Hi @Droppix, the FCM docs mention that tokens that are over 270 days old will me marked as invalid, and sends will be rejected. https://firebase.google.com/docs/cloud-messaging/manage-tokens#stale-and-expired-tokens
Is this the issue you're experiencing? If not, do you know how much time it takes for the tokens to expire?

Also, do you know if this issue is unique to iOS?

@google-oss-bot
Copy link
Contributor

Hey @Droppix. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

@google-oss-bot
Copy link
Contributor

Since there haven't been any recent updates here, I am going to close this issue.

@Droppix if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

@Benyaminrmb
Copy link

why close? any solution?

@firebase firebase locked and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants