voximplant / react-native-voximplant

Voximplant mobile SDK for React Native (iOS/Android)
http://voximplant.com
205 stars 39 forks source link

491 error when login on iOS 11 #39

Closed azraelx23 closed 6 years ago

azraelx23 commented 6 years ago

Hi, sometimes I got a 491 error when calling this function:

VoxImplant.SDK.login(user, pass)

is there any explanation regarding that error? We try to do voximplant login when the app if brought back from background since the sessions seems to be disconnected.

Based on this:

https://voximplant.com/docs/references/mobilesdk/ios/Constants/VILoginErrorCode/index.html

it is VILoginErrorCodeInvalidState = 491 , any more explanations regarding this error?

YuliaGrigorieva commented 6 years ago

Hello!

This error code means that VoxImplant.SDK.login(user, pass) API was called in one of the following states:

  1. not connected (after ConnectionClosed event)
  2. connecting (after call of VoxImplant.SDK.connect API, but before ConnectionEstablished event)
  3. logging in (after call of VoxImplant.SDK.login, but before LoginSuccessful event, i.e. attempt to double login).

In case if you observe this issue after bringing the application from the background, most likely VIClient is in not connected state. Due to iOS specific, connection to the Voximplant Cloud is dropped in the background if there is no active calls at the moment. You should get ConnectionClosed event.

To login to the Voximplant Cloud after bringing the application foreground, you should repeat all steps to connect and login, i.e:

  1. call VoxImplant.SDK.connect API
  2. receive ConnectionSuccessful event
  3. call VoxImplant.SDK.login API
  4. receive LoginSuccessful event

Best regards, Yulia Grigorieva

YuliaGrigorieva commented 6 years ago

Closing due to inactivity, feel free to reopen or create new issue in case of any questions.

Best regards, Yulia Grigorieva

rsnay commented 6 years ago

Is there a way to get the current connectivity status from the Voximplant SDK? I've added a ConnectionClosed device event listener, but still have troubles with login errors based on connectivity state when live reloading (where javascript state gets out of sync with native state).

YuliaGrigorieva commented 6 years ago

Hello!

We have just released Voximplant React Native SDK v1.0.0 that introduces a lot of new features and improvements including Voximplant.Client.getClientState API for getting the current state of the connection to the Voximplant cloud.

Please check our official demo (https://github.com/voximplant/react-native-demo) that is now based on new API. You can also browse the Using React Native SDK guide to get more information about new API usage and Migration guide to easy adopt your code for the new API.

Best regards, Yulia Grigorieva

rsnay commented 6 years ago

This is wonderful, thank you!