voximplant / react-native-voximplant

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

Call recieved too early even before call handlers are initialized iOS #123

Closed rajngarg closed 3 years ago

rajngarg commented 3 years ago

On android it is working perfectly but now I am having issues with iOS

foreground:- properly working background and killed state:- When I pick the call instantly then the call id becomes null and it is throwing error of this.call.answer is undefined and crash in release

but when I am picking after 5-6 seconds then it is working fine.

Please let me know how can I show the incoming call screen after everything is ready. Thanks in advance

rajngarg commented 3 years ago

Hello @YuliaGrigorieva , Please help

YuliaGrigorieva commented 3 years ago

Hello @rajngarg ,

Due to iOS 13 and later requirements, the application must report an incoming call when it receives a VoIP push notification. It means, that the user will see Incoming Call screen before everything is ready for to answer a call.

To resolve your issue, you need to check if the Voximplant Call object exists for this call and only if it exists, answer the call via Call.answer API. If the Voximplant Call object is not received yet via IncomingCall event, you need to wait til this event is invoked and only after this call Call.answer method

Best regards, Yulia Grigorieva

rajngarg commented 3 years ago

Hi, @YuliaGrigorieva Thanks that worked I added a timeout on Call.answer. Now it is working fine on the background but not on the killed state for the killed state it is not redirecting to the call screen.

YuliaGrigorieva commented 3 years ago

Hello @rajngarg ,

Could you please confirm that you receive a VoIP push notification in the killed app state? Please also let me know if the issue is related to app screens (app shows incorrect screen after a call is answered) or a call is not answered at all (you do not receive Voximplant Call object)?

Best regards, Yulia Grigorieva

rajngarg commented 3 years ago

Hello @YuliaGrigorieva , Yes I am receiving VoIP push notification in the killed state and also screen navigation is right. When I received the call and answer it after 5 seconds then it is working fine but if I pick the call immediately then it is redirected to the home screen and the status bar turned green but not picked the call up.

YuliaGrigorieva commented 3 years ago

Hello @rajngarg ,

the status bar turned green

It seems that the call is answered and you should hear another participant. It looks as if the issue in the app navigation, not in the SDK.

Best regards, Yulia Grigorieva

rajngarg commented 3 years ago

Ok Thanks I will check

rajngarg commented 3 years ago

I have added an interval of 1 sec to check if the call object gets the call and then answer it. Thanks