Skip to content

Comments

fix: voip token not able to be got if user switched#1683

Merged
santhoshvai merged 1 commit intomainfrom
voip-token-race
Feb 13, 2025
Merged

fix: voip token not able to be got if user switched#1683
santhoshvai merged 1 commit intomainfrom
voip-token-race

Conversation

@santhoshvai
Copy link
Member

Overview

Consider this scenario where as soon as app is opened. User A logged in and then immediately logged off and then user B logs in.

1. user A logs in
2. useEffect registers listeners to listen for push
3. user A logs out immediately - listeners are removed
4. apple sends push token now , but SDK is not listening as no user is logged in
5. user B logs in
6. useEffect registers listeners to listen for push
7. apple DOES NOT SEND push token now because it was sent earlier

Implementation notes

If we look at the voip notification library, if we call registerVoipToken() method, the library sends the JS event for new push token with the last push token that it received.

Now after this in point 7 we will receive a event in JS saying that it received a push token

@santhoshvai santhoshvai merged commit 8f2a376 into main Feb 13, 2025
10 checks passed
@santhoshvai santhoshvai deleted the voip-token-race branch February 13, 2025 20:09
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

Successfully merging this pull request may close these issues.

2 participants