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

unlock phone when swipe to answer an incoming call #319

Open
1 of 3 tasks
vitorlsouza opened this issue Nov 16, 2020 · 17 comments
Open
1 of 3 tasks

unlock phone when swipe to answer an incoming call #319

vitorlsouza opened this issue Nov 16, 2020 · 17 comments

Comments

@vitorlsouza
Copy link

Bug report

  • I've checked the example to reproduce the issue.

  • Reproduced on:

  • Android

  • iOS

Description

when receiving a call and the app is in background and phone locked when you swipe to answer it doesnt swipe to unlock and answer, just answer so you're presented the swipe to unlock normal apple screen when your phone wakes up.

when the phone wakes up, the app does not launch, because it already tried to launch when the incoming call was answered and the phone was blocked.

Steps to Reproduce

answer a call when the phone is locked.

Versions

- Callkeep: 3.1.1
- React Native: 0.60.4
- iOS: 14.1
- Android:
- Phone model: iPhone 11

Logs

Paste here
@jason-shen
Copy link

i think thats the way it is, there is no way around this, you could write a special function when the app is killed or background, i think thats the only way around this

@namnm
Copy link

namnm commented Jan 12, 2021

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.

@tuneerclixlogix
Copy link

Have you found any solution for this ? I am also facing same issue in ios
On lockscreen i swipe to answer call then unlock the phone but the app was not opened.

@qburst-subins
Copy link

In WhatsApp, it's directly Launching the application. It's not stuck on the Callkit UI when device is locked state.

@namnm
Copy link

namnm commented Mar 1, 2021

@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)

@JayPerfetto
Copy link

Has anyone found a resolution to this bug? I face the exact same issue in flutter using CallKeep, and it seems to be an extremely common problem / use case that no one has figured out even remotely....Slack, FBMessenger, Whatsapp, WeChat, they all seem to have found a workaround and yet we cannot

@beqramo
Copy link

beqramo commented Jul 21, 2021

any help here?

@namnm
Copy link

namnm commented Jul 21, 2021

@JayPerfetto @beqramo I have just downloaded Whatsapp and tested the behavior. Apparently they didnt use VoIP CallKit, just regular push notification. When you click on the notification it will unlock via FaceID and app open.

@Romick2005
Copy link

Romick2005 commented Jul 22, 2021

@JayPerfetto @beqramo I have just downloaded Whatsapp and tested the behavior. Apparently they didnt use VoIP CallKit, just regular push notification. When you click on the notification it will unlock via FaceID and app open.

You are partly right. Your scenario describe iOS behaviour, but for Android it starts audio stream without unlocking the phone (the same is in iOS, but you need to swipe to accept a call). Even in iOS you can start audio session when phone is locked. Just tested this in Whatsapp.

@namnm
Copy link

namnm commented Jul 22, 2021

@Romick2005 In our app, we are using this callkeep package. Just general ios voip callkit, if user needs to open the app then click on the app icon. For android we use self manage. This library has been doing a great job for us.

There is one thing on android that in the case app killed, it take a considered long time to show the call. I guess it need to initialize the js bridge and things. We want to customize the lib to let it show call in native java code instead of js code but havent had time to do that.

@beqramo
Copy link

beqramo commented Jul 22, 2021

@namnm I know it isn't related to this but how did you send VoIP notifications? I'm using Firebase and it doesn't support that.
I don't want to use any server, serverless would be the best solution for me.

Thanks in advance

@namnm
Copy link

namnm commented Jul 22, 2021

@beqramo Take a look at this, you can try download this app to test your PN locally: https://github.com/onmyway133/PushNotifications/blob/master/components/InputComponent.js#L199-L245

If you have a nodejs server, there is a package which they use in the above code:
https://www.npmjs.com/package/apn

Some notes:

  • Append .voip at the end of your bundle id: com.example.app.voip
  • Set push type header to voip

@beqramo
Copy link

beqramo commented Jul 22, 2021

Thanks for your answer, my entire infrastructure is based on Firebase (Firestore, messaging, storage). and for notification handling I use https://github.com/zo0r/react-native-push-notification.
so I'm looking for a workaround for a custom server.

I want to mention also that it is really bad that Firebase doesn't support VoIP.

I will try to use that node package if I were unable to find anything.

Thanks.

@Romick2005
Copy link

We switched from Firebase to OneSignal and everything run smoothly after that. It also supports voip notifications.

@hariks789
Copy link

hariks789 commented Sep 27, 2021

Has anyone found a resolution to this bug? I face the exact same issue in flutter using CallKeep, and it seems to be an extremely common problem / use case that no one has figured out even remotely....Slack, FBMessenger, Whatsapp, WeChat, they all seem to have found a workaround and yet we cannot

@subinsuresh @JayPerfetto
I am using react-native-push-notifications along with USE_FULL_SCREEN_INTENT to present a local notification using FCM data only notifications.. Refer this PR zo0r/react-native-push-notification#2112

This will launch the app even in lock-screen and you can present your own call UI using onNotification listener. When you exit the app the screen goes back to lock screen. Just like Whatsapp
Only downside is that the app will always display on top of lockscreen due to this permission. Like your app is in foreground and you manually lock phone and you turn the screen back on, you will still be able to access app without lock/pass code.
Reference https://stackoverflow.com/questions/60876523/how-to-lock-android-device-after-unlocking-with-setshowwhenlockedtrue

@Madhav131
Copy link

@hariks789
How do I solve this problem please any help?

@reubber
Copy link

reubber commented Jan 24, 2023

i solved this problem here by adding these 2 properties in the androidManifest file in MainActivity:

  • android:showWhenLocked="true"
  • android:turnScreenOn="true"

but when i press any notification it starts the app as well without ask passward lockscreen :/

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