react-native-webrtc / react-native-callkeep

iOS CallKit framework and Android ConnectionService for React Native
ISC License
911 stars 441 forks source link

App not opened on answer after unlocking ios device #355

Open tuneerclixlogix opened 3 years ago

tuneerclixlogix commented 3 years ago

When the device is locked and there is any incoming call, i answered the call and then unlocked the screen but the application was in background state

Expected Behaviour: After unlocking the device it should be in the foreground state .

umairlive490 commented 3 years ago

Same issue for me. When the device is locked and there is any incoming call, i answered the call and then unlocked the screen but the application was in background state.After unlocking the device it should be in the foreground state .

tuneerclixlogix commented 3 years ago

Did you found any solution ? @umairlive490

m4r00p commented 3 years ago

Yes, any luck?

timorss commented 2 years ago

Is there a solution?

gabrielelana commented 2 years ago

Solved this yesterday, got an hint from the WhatsApp behaviour

TLDR

  RNCallKeep.displayIncomingCall(
    UUID, 
    'Caller Number', 
    'Caller Name',
    'generic',
    true  // <- THIS IS THE MAGIC
  );

Apparently you need to tell iOS that your call is a video call, and since (I guess) it has no way to tell how do you want to display the video streams, it will bring the specific application in foreground.

The following is the behaviour that I managed to have (close to what I have on Android):

Ring -> Answer -> Unlock -> Application

Before I was only able to have:

Ring -> Answer -> Native Call UI -> Press Application Button (bottom right) -> Unlock -> Application

A huge improvement in usability

KeKam commented 2 years ago

Solved this yesterday, got an hint from the WhatsApp behaviour

TLDR

  RNCallKeep.displayIncomingCall(
    UUID, 
    'Caller Number', 
    'Caller Name',
    'generic',
    true  // <- THIS IS THE MAGIC
  );

Apparently you need to tell iOS that your call is a video call, and since (I guess) it has no way to tell how do you want to display the video streams, it will bring the specific application in foreground.

The following is the behaviour that I managed to have (close to what I have on Android):

Ring -> Answer -> Unlock -> Application

Before I was only able to have:

Ring -> Answer -> Native Call UI -> Press Application Button (bottom right) -> Unlock -> Application

A huge improvement in usability

Wouldn't setting hadVideo: YES in reportNewIncomingCall within AppDelegate.m not achieve the same behaviour? Cause it doesn't.

gabrielelana commented 2 years ago

Wouldn't setting hadVideo: YES in reportNewIncomingCall within AppDelegate.m not achieve the same behaviour? Cause it doesn't.

You mean hasVideo: YES?

Don't know, didn't tried that, I use data-only push notifications, not voip notifications

fukemy commented 1 year ago

thanks @gabrielelana , it's really importaint answer to me. love u so much <3

fukemy commented 1 year ago

@gabrielelana , not worked to me. I changed hasVideo = true in AppDelegate, but still not working, I am using pushkit

gabrielelana commented 1 year ago

@fukemy I don't know exactly what you do in AppDelegate, but note that what works for me is probably different: I set the flag when I need to display the incoming call RNCallKeep.displayIncomingCall and I do that when I receive the push notification. Hope this helps

MrGru commented 1 year ago

If you are using reportNewIncomingCall in AppDelegate. you should change: hasVideo = true, fromPushKit: NO

[RNCallKeep reportNewIncomingCall:uuid
                               handle:@"app name"
                           handleType:@"generic"
                             hasVideo:true <---- change this line
                  localizedCallerName:@"caller name"
                      supportsHolding:NO
                         supportsDTMF:NO
                     supportsGrouping:NO
                   supportsUngrouping:NO
                          fromPushKit:NO <---- change this line
                              payload:NULL
                withCompletionHandler:completion

and use imageName = icon user can click to open the app, in the setup function: the icon should be transparent

[RNCallKeep setup:@{
     @"appName": @"Video Visit",
     @"imageName": @"call.png", <--- Change this line
     @"maximumCallGroups": @1,
     @"maximumCallsPerCallGroup": @1,
     @"supportsVideo": @YES, <--- Change this line
     @"displayCallReachabilityTimeout":@60000
   }];
AndreasKarlzzon commented 1 year ago

+1, any news for does that have not got it to open the app after unlocking the screen on received call?

aromero-braintly commented 1 year ago

Solved this yesterday, got an hint from the WhatsApp behaviour

TLDR

  RNCallKeep.displayIncomingCall(
    UUID, 
    'Caller Number', 
    'Caller Name',
    'generic',
    true  // <- THIS IS THE MAGIC
  );

Apparently you need to tell iOS that your call is a video call, and since (I guess) it has no way to tell how do you want to display the video streams, it will bring the specific application in foreground.

The following is the behaviour that I managed to have (close to what I have on Android):

Ring -> Answer -> Unlock -> Application

Before I was only able to have:

Ring -> Answer -> Native Call UI -> Press Application Button (bottom right) -> Unlock -> Application

A huge improvement in usability

Hi, this worked for me on version 4.1.0 but won't work on 4.3.1. I needed to update to be able to route audio through bluetooth, so it's not an option for me to downgrade. Did anyone have better luck trying to solve this?

MinhThu100200 commented 11 months ago

@AndreasKarlzzon I think because you try to turn off the default call screen by calling endCall event when the receiver answers the calling. I faced this issue so I still keep default call screen