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

cache lastVoipToken and return it when subsequently call to registerVoipToken #80

Merged
merged 2 commits into from
Jan 15, 2021

Conversation

zxcpoiu
Copy link
Member

@zxcpoiu zxcpoiu commented Jan 15, 2021

We should prevent register duplicated delegate to PushKit. So if you have registered voipRegistration on the native side, when you call registerVoipToken on the js side again, it will prevent it to register twice, and is a no op.

But for compatibility and convenience, now we cached the latest voip token on the native side each time we received token from PushKit inside didUpdatePushCredentials, and, if user call registerVoipToken and it's registered already, it will fire register event with the latest cached voip token then.

@zxcpoiu
Copy link
Member Author

zxcpoiu commented Jan 15, 2021

TL;DR

  • We cache the latest voip token on the native side. ( during an app life cycle )
  • Now will fire the latest cached token with register when calling registerVoipToken on the JS ( if you have registered )

@zxcpoiu zxcpoiu merged commit bb5485b into react-native-webrtc:master Jan 15, 2021
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.

None yet

1 participant