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

Storing Device Token in Local Storage Causes Issues on Multiple Devices #203

Open
danstepanov opened this issue Jun 7, 2021 · 1 comment

Comments

@danstepanov
Copy link

Please include the following information for better support

The more context you provide around this issue the faster the community can help you

Did you follow all the instructions as specified in the Twilio Quickstart repositories? Yes
What version of React Native are you running? ~0.63.4
What version of react-native-twilio-programmable-voice are you running? ^4.3.0
What device are you using? (e.g iOS10 simulator, Android 7 device)? iPhone Xs
Is your app running in foreground, background or not running? foreground
Is there any relevant message in the log? N/A
If using iOS, which pod version are you using? ~> 5.2.0

Step to reproduce

  • Register device for push notifications on by invoking configureCallKit() using your identity-generated client
  • Open your app on another device using a client generated using the same identity, call configureCallKit()
  • Try calling the phone number associated with your identity, neither phone will show a VoIP notification for the ringing

Advanced:
Have you tried adding break point using AndroidStudio or XCode and analyse the logs? yes
can share a project with issue? yes
Did you try to reinstall the pods completely? yes

Presumably against Apple's docs, this library stores the device token in local storage via NSUserDefaults. While this makes it easier to re-establish a connection with the device on subsequent launches, it causes issues if you sign into the same account from a different device.

My understanding is that the person implementing this library should store the token on their own servers or via bindings in Twilio. Please let me know if I'm mistaken.

Screen Shot 2021-06-07 at 4 15 18 PM

@fabriziomoscon
Copy link
Collaborator

Thank you for reporting this. I am personally not proficient on Objective-C, but I rely on the official Twilio quickstart code:
https://github.com/twilio/voice-quickstart-ios/blob/master/ObjcVoiceQuickstart/ViewController.m#L231

I would suggest you to open an issue there and see what Twilio engineers suggest.

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