react-native-callkeep icon indicating copy to clipboard operation
react-native-callkeep copied to clipboard

Accept call and can't start app when device locked or sleep ( iOS )

Open caglardurmus opened this issue 4 years ago • 18 comments

Bug report

  • [x] I've checked the example to reproduce the issue.

  • Reproduced on:

  • [ ] Android

  • [x] iOS

Description

I want to accept call and then start the application. It works perfect when the device not locked or not sleep mode but when its on locked or sleep mode, it does not start the application when i accept. I can get notification with voip. When i accept it if the user have password callkeep can't start the application.

Expectation

When i accept the call (at sleep or locked mode) user pin his/her pass and then application start.

Versions

- Callkeep: 3.1.1
- React Native: 0.62.1
- iOS: 14
- Phone model: iPhone 7 

caglardurmus avatar Oct 14 '20 15:10 caglardurmus

Running into same problem. Answer goes into infinite loop since app is not available to answer/no way to launch if quit.

nerdymind-dev avatar Oct 27 '20 15:10 nerdymind-dev

Any suggestions ?

caglardurmus avatar Nov 10 '20 06:11 caglardurmus

When phone is locked, there's no way to open app directly from PN. https://stackoverflow.com/questions/41740139

There will be an icon in the native dialer, if user click on that icon, the phone will show unlock screen and if user unlock the phone, app will be shown. There's a config imageName when you setup CallKeep, which map to the objective C iconTemplateImageData to customize the image of that icon.

namnm avatar Jan 13 '21 09:01 namnm

@namnm Can you check how whatsApp handle this scenario?

qburst-subins avatar Mar 01 '21 04:03 qburst-subins

@subinsuresh I dont use whatsapp, so I dont know its behavior. Can you add some tests and capture a video if possible? So let me sum up:

  • Phone are locked with passcode (no fingerprint or face id, to make sure it is totally locked without accidentally unlock via biometric)
  • Audio call (if video call, you can pass an option to the callkeep and it can show video with some UI, not sure if this is how whatsapp been doing)

namnm avatar Mar 01 '21 05:03 namnm

@caglardurmus did you find any solution ? , for me it happened randomly most of the case when I open the lock app already opened and navigate to call screen but in some time it never open the application. @namnm can this be a problem #346 , if add delay what will be your suggestion ?

hussainsherwani avatar Aug 05 '21 08:08 hussainsherwani

@caglardurmus did you find any solution ? , for me it happened randomly most of the case when I open the lock app already opened and navigate to call screen but in some time it never open the application. @namnm can this be a problem #346 , if add delay what will be your suggestion ?

Nope, i didn't find any solution. I used delay but its not working. It works if user answer the phone after 1.5 sec. If user answer it fast it doesn't work.

caglardurmus avatar Aug 12 '21 11:08 caglardurmus

@caglardurmus did you find any solution ? , for me it happened randomly most of the case when I open the lock app already opened and navigate to call screen but in some time it never open the application. @namnm can this be a problem #346 , if add delay what will be your suggestion ?

Nope, i didn't find any solution. I used delay but its not working. It works if user answer the phone after 1.5 sec. If user answer it fast it doesn't work.

Happens to me as well.

timorss avatar Oct 07 '21 08:10 timorss

@caglardurmus

Nope, i didn't find any solution. I used delay but its not working. It works if user answer the phone after 1.5 sec. If user answer it fast it doesn't work.

Do you have any solution for this issue? I have the same problem: Answer/Reject buttons don't work for background/killed app state in first 1.5-5 seconds when app isn't runned yet.

danilvalov avatar Jun 09 '22 14:06 danilvalov

I need a help =(( Do you have any solution for this issue?

MinhThu100200 avatar Sep 12 '23 03:09 MinhThu100200

@MinhThu100200 On ios, if the phone is locked, when answer the call it will display the CallKit UI. You can put an icon from your app to the screen as below, if user click the icon, it will request for unlock and open the app afterward: 32146144-8d545e5c-bca9-11e7-894d-b3cc516dc7ee

There could be a hacky solution: that if you enable video in RNCallKeep.displayIncomingCall Then it will request for unlock immediately right after answer the call.

There is also another solution which I believe Whatsapp is using as the community has mentioned above. Use PushNotification to notify incoming call instead of CallKit, then if user press the notification, it will request for unlock and open the app. But then you could loose some of the feature of CallKit, such as notify on hold when there is incoming GSM call, or switch between multiple calls.

namnm avatar Sep 12 '23 08:09 namnm

@namnm When I use IP 7 plus, everything is oke, but with others when I accept call, my app cannot open but I open my app myself. everything that I use to handle calling is running. I have no ideas about that =((((

MinhThu100200 avatar Sep 13 '23 05:09 MinhThu100200

@MinhThu100200 Please be more specific. When you performed those testings, was the phone locked or not, if locked with passcode or not?

Please check again and provide more details if possible, especially above questions for the iPhone7 and others you mentioned.

No one can help you if you provide little to no information at all.

namnm avatar Sep 13 '23 06:09 namnm

@namnm yeah, thanks. When my app state is background or kill. And I have a phone call that is incoming. Then I answer it but my app doesn't launch. However, my handling in js code that still run. So my issue that is "accepting call but my app doesn't launch when my device still runs or locked". With iphone 7 plus, everything is okie, app always launch when I accept call. Please help me =(((

MinhThu100200 avatar Sep 14 '23 02:09 MinhThu100200

maybe because of version os. when I use my app with ios 16 or lower (15.x). everything is okie. But with ios 16.6, when I accept call, my app doesn't open.

MinhThu100200 avatar Sep 14 '23 14:09 MinhThu100200

@MinhThu100200 Please run your app in debug mode with logger and see if there's any error? You can add this package to catch the error: https://github.com/a7ul/react-native-exception-handler I guess your app could be crashed during the answer, adding the above package and configuring to catch native exception then it could help preventing the crash.

You can also use the Console app to view the log of your iPhone in realtime, with this you can also view the log of production bundle ipa without running in debug: https://support.apple.com/guide/console/welcome/mac https://support.apple.com/guide/console/cnsl1012/mac

namnm avatar Sep 14 '23 20:09 namnm

@namnm thank sir. I will check and follow your suggestion. thank u so much~

MinhThu100200 avatar Sep 16 '23 05:09 MinhThu100200