Skip to content

answerCall event not getting called on app killed state iOS #190

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

Closed
shashankmeddo opened this issue Apr 27, 2020 · 23 comments
Closed

answerCall event not getting called on app killed state iOS #190

shashankmeddo opened this issue Apr 27, 2020 · 23 comments

Comments

@shashankmeddo
Copy link

Hi,

My app works fine on iOS when the app is in background or foreground ho ever
when app is in killed state then none of the event is getting called
I am mainly interested in
answerCall Event of RNCallKeep

@shashankmeddo
Copy link
Author

I also would like to know which method opens the app
when user answers the call

@shashankmeddo shashankmeddo changed the title answerCall answerCall event not getting called on app killed state iOS Apr 27, 2020
@danjenkins
Copy link
Collaborator

How do you mean @shashankmeddo ? What are you using to start up the app? a push notification? a voip push? are you displaying the incoming call in native land due to the recent ios13 changes... you'll need t give us some more information for us to help you

@ochrstn
Copy link

ochrstn commented Apr 28, 2020

If you are using react-native-voip-push-notification to start the app, this pull request helped me to fix the same issue: react-native-webrtc/react-native-voip-push-notification#52

@ankitmeddo
Copy link

ankitmeddo commented Apr 28, 2020

@danjenkins I have added 'answerCall' eventListener in my App.js in which I am navigating user to a video call screen and the case is -
App is in killed state and VOIP push arrives. So when I answered the call, it opens my application and nothing happened. That event didnt called.
But when the app was in foreground or in active state, 'answerCall' event fired and it navigate to video screen but when the app was in killed state, that event didnt fired.

@CaptainJeff
Copy link
Contributor

I'm having this same issue on android. Does anyone have any suggestions?

@willnaoosmith
Copy link

Same issue here on IOS 13.3, iphone 8 (Real device), react-native 0.65.1

When i open the app for the first time everything runs ok on the background.
When kill the app process, then re-run, he does'nt work on the background.

If i found an error code i will provide one.

@willnaoosmith
Copy link

willnaoosmith commented May 4, 2020

Maybe this is a error code related:

Can't end BackgroundTask: no background task exists with identifier 17 (0x11), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

@hungtd97
Copy link

hungtd97 commented May 5, 2020

Same issue but in my case displayincoming event is fired and show incoming screen, but when I press answer button nothing happen, answer event didn't be occured

It happened for the first time when voip push launch the app after killed

@willnaoosmith
Copy link

Does anybody have an update about this issue?Any help or something? I'm stuck on this problem :(

@CaptainJeff
Copy link
Contributor

@willnaoosmit nope. Still having the same issue. I only have it on older iphones though. Newer ones seem fine. I can't figure out why that is

@willnaoosmith
Copy link

@willnaoosmit nope. Still having the same issue. I only have it on older iphones though. Newer ones seem fine. I can't figure out why that is

By "Older" you mean what iPhone versions?
I'm facing this issue on a real iPhone 8 device, and a iPhone 11 simulator, if I'm not wrong.

Also, taking advantage of you here, do you have a problem with the app doesn't working on foreground or background when installed by the App store itself?

I uploaded him using the app store and it simply doesn't work even the first time :(

@CaptainJeff
Copy link
Contributor

CaptainJeff commented May 13, 2020

@willnaoosmit

So all of these were tested on real devices. It works fine on multiple iphone X's and iphone XR's (various iOS 13's) and then it works fine on the foreground for iPhone SE (13.3.1) / iPhone 7 (11.2.5) / iPhone 7 (12.4) but not the background

Edit: Its worth noting I had the same experiences testing on development and production

@zxcpoiu
Copy link
Member

zxcpoiu commented May 14, 2020

Make sure:

  • use voip push ( the formal way to bring your app alive for callkit actions )
  • add the answerCall event on the very beginning of your app entry( eg: the top of index.js or app.js ), ASAP

Personally, I didn't face this issue ( answerCall event not fired issue ), so I can not reproduce it to test something like #169

If you did the above and still have the same issue, give #169 a try

@zxcpoiu
Copy link
Member

zxcpoiu commented May 14, 2020

Also, you may try to invoke completion() later.
Choose one of the method below:

Method 1 ( react-native-callkeep )

Use #191 to invoke completion() automatically on native side right after reportNewIncomingCall are done with it's job

Method 2 ( react-native-voip-push-notification )

If you use RN voip push

You can use react-native-webrtc/react-native-voip-push-notification#52 to invoke completion() on the JS side manually after you've done your own customization.

@CaptainJeff
Copy link
Contributor

CaptainJeff commented May 14, 2020

@zxcpoiu

Oh wow. The #191

Actually seemed to fix it!! Thanks so much for commenting that. We were almost ready to not support those phones. Thanks so much

@danjenkins
Copy link
Collaborator

Closing

@teddyxfire
Copy link

teddyxfire commented Jul 13, 2020

Hey guys!

If anyone comes across this issue and has already implemented the completionHandler from #191, make sure that you call RNCallKeep.setup() in your JS code as soon as possible.

In my case, I've moved the RNCallKeep.setup() to index.js and I'm registering Callkeep events (didDisplayIncomingCall, answerCall etc.) in App.js. Now it works perfectly.

If you call RNCallKeep.setup() too late, didDisplayIncomingCall event might still get triggered, but other events like answerCall etc. won't trigger if your app was killed, so make sure to call RNCallKeep.setup() as soon as possible.

@fukemy
Copy link

fukemy commented Oct 24, 2022

Hi, i got the problem, that's I can not access to mic when app killed, even I can bring the call screen active after answer call

@fukemy
Copy link

fukemy commented Oct 27, 2022

i saw problem is navigate to call screen when navigation not ready

@MounikaJT
Copy link

MounikaJT commented Jan 23, 2023

@danjenkins I have added 'answerCall' eventListener in my App.js in which I am navigating user to a video call screen and the case is -
App is in killed state and VOIP push arrives. So when I answered the call, it opens my application and nothing happened. That event didnt called.
But when the app was in foreground or in active state, 'answerCall' event fired and it navigate to video screen but when the app was in killed state, that event didnt fired.

Hi am also facing this issue in iOS using swift, have you got any solution.If yes please let us know.

@Romick2005
Copy link

@danjenkins I have added 'answerCall' eventListener in my App.js in which I am navigating user to a video call screen and the case is -
App is in killed state and VOIP push arrives. So when I answered the call, it opens my application and nothing happened. That event didnt called.
But when the app was in foreground or in active state, 'answerCall' event fired and it navigate to video screen but when the app was in killed state, that event didnt fired.

Hi am also facing this issue in iOS using swift, have you got any solution.If yes please let us know.

Have you checked what events would you get when add 'didLoadWithEvents' listener?

@MounikaJT
Copy link

MounikaJT commented Jan 23, 2023 via email

@Romick2005
Copy link

Hi thank you for your response , Actually am using swift language in iOS.so I am unable to find 'didLoadWithEvents' method. Thank you From: Romick2005 @.> Date: Monday, 23 January 2023 at 3:20 PM To: react-native-webrtc/react-native-callkeep @.> Cc: Mounika Sakinapally @.>, Comment @.> Subject: Re: [react-native-webrtc/react-native-callkeep] answerCall event not getting called on app killed state iOS (#190) @danjenkinshttps://github.com/danjenkins I have added 'answerCall' eventListener in my App.js in which I am navigating user to a video call screen and the case is - App is in killed state and VOIP push arrives. So when I answered the call, it opens my application and nothing happened. That event didnt called. But when the app was in foreground or in active state, 'answerCall' event fired and it navigate to video screen but when the app was in killed state, that event didnt fired. Hi am also facing this issue in iOS using swift, have you got any solution.If yes please let us know. Have you checked what events would you get when add 'didLoadWithEvents' listener? — Reply to this email directly, view it on GitHub<#190 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2DOZ5VKH54YTXRDYBYMW6DWTZH67ANCNFSM4MR5RSJA. You are receiving this because you commented.Message ID: @.***>

You should at least read about it. But you were asking about having answerCall js side, correct? Because on native side Objective-C or Swift there are no answerCall events at all. You should start the app from voip push notification and there call reportNewIncomingCall from RNCallKeep reportNewIncomingCall module. Sorry not sure what you are trying to achive and what is your problem is.

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