Skip to content

iOS13: Outgoing call not working from call log. #108

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
2 of 3 tasks
Chaitanya-Suryadevara opened this issue Sep 26, 2019 · 13 comments · Fixed by #109
Closed
2 of 3 tasks

iOS13: Outgoing call not working from call log. #108

Chaitanya-Suryadevara opened this issue Sep 26, 2019 · 13 comments · Fixed by #109

Comments

@Chaitanya-Suryadevara
Copy link

Bug report

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

  • Reproduced on:

  • Android

  • iOS

Description

I have implemented callkeep package 3.0.3, incoming call works fine. But when I tap on my number from the call log, nothing happens. The same thing works fine on iOS 12 and package version 3.0.1. I was redirecting to the app and I got callback in particular method from where I can initiate the call. But on iOS 13 nothing happens and it doesn't even redirect to the app.

Steps to Reproduce

Just integrate with given details, and it should happen.

Versions

- Callkeep: "^3.0.3"
- React Native: "0.58.6",
- iOS: 13.1
- Android:
- Phone model: 6S

Logs

No redirection happens, so log not available.
@bhuangy
Copy link
Contributor

bhuangy commented Sep 26, 2019

Looks like userActivity.activityType is now coming as a generic INStartCallIntent on iOS 13, so the isAudioCall and isVideoCall checks are no longer valid.
We should adapt with changes like this
https://github.com/signalapp/Signal-iOS/blob/master/Signal/src/AppDelegate.m#L928

@Chaitanya-Suryadevara
Copy link
Author

Chaitanya-Suryadevara commented Sep 26, 2019

I am using RNKeepCall, so I have my AppDelegate like this,

- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
 restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *restorableObjects))restorationHandler
{
  NSLog(@"continueUserActivity=====");
  return [RNCallKeep application:application
            continueUserActivity:userActivity
              restorationHandler:restorationHandler];
}

But my log never prints "continueUserActivity=====" and when tap on call log, it doesn't even open the app.
I also tried with


- (BOOL)application:(UIApplication *)application
continueUserActivity:(nonnull NSUserActivity *)userActivity
  restorationHandler:(nonnull void (^)(NSArray *_Nullable))restorationHandler

But still method doesn't get called and my app doesn't get open from call log.

@kylekurz
Copy link
Contributor

@Chaitu4190 that latest comment sounds like an app configuration issue on your end (do you have the appropriate NSUserActivityTypes flags in your Info.plist?), not an RNCallKeep issue then.

However, we were able to determine there's a real issue here with the way RNCallKeep handles that user activity once it's passed down to the dependency. We'll be opening a PR for that fix soon, hopefully that, along with whatever you need to adjust on your own app will rectify this for you.

@Chaitanya-Suryadevara
Copy link
Author

Chaitanya-Suryadevara commented Sep 27, 2019

@kylekurz @bhuangy ,
Here I am attaching my info.plist file's code.

<key>NSUserActivityTypes</key>
	<array>
		<string>INStartAudioCallIntent</string>
		<string>INStartVideoCallIntent</string>
		<string>INStartCallIntent</string>
		<string>com.mycom.myapp.view</string>
		<string>com.mycom.myapp.edit</string>
	</array>

But still my app doesn't get open from call log, as I said it was open for on iOS 12 even without this info.plist's above value.
And AppDelegate.m file is as per above.
Am I missing something else? Please take a look.

@kylekurz
Copy link
Contributor

@Chaitu4190 that looks correct. Unfortunately, without access to your app, all we can really say at this point is "works on my machine", ha. Please do try @bhuangy's PR #109 and see if that fixes your original issue. It did fix our app and, I believe, should fix the example app as well. If the user activity never gets to the RNCallKeep code, however, that's not something we can control or fix.

Please let us know if you have any more questions or we can help in any other way!

manuquentin added a commit that referenced this issue Sep 27, 2019
#108 Address Outgoing calls not working from call log in iOS 13
@kylekurz
Copy link
Contributor

@Chaitu4190 I think you're confusing two parts of this API surface. I'll try to explain as clearly as I can, maybe something I say will help you solve your issue.

  1. RNCallKeep.displayIncomingCall should only be used on INBOUND phone calls. Not on every call. The changes we put into this dependency with PR [ios-13] add new class method to report incoming call when receiving voip push #86 are specifically to keep iOS from killing apps that use the RNCallKeep dependency to do CallKit integration on iOS. Assuming that a) you're using push notifications to deliver phone calls and b) you add the correct line to AppDelegate.m to call the new RNCallKeep.reportNewIncomingCall method, your iOS code should never need to call RNCallKeep.displayIncomingCall again. That will be an Android-only method from now on (@bhuangy we should consider marking it as such).

  2. Outbound phone calls triggered from your application display need to call RNCallKeep.startCall before ever initializing the call with your server. Once you receive the didReceiveStartCallAction callback, that's the native SDK giving you permission to fire the call. The continueUserActivity callback you show in your AppDelegate.m snippet above should eventually trigger the same didReceiveStartCallAction that I described previously. A call triggered from a call log tap is never an incoming call.

@Chaitanya-Suryadevara
Copy link
Author

Chaitanya-Suryadevara commented Oct 2, 2019

@kylekurz , Thanks for the reply. But still it doesn't solve my problem. (Not able to make outgoing call when I press the number from call-log)

I am describing how I implemented whole things.I have used react-native-voip-push-notification for the push notifications, which is implemented for incoming calls.

Incoming call: It works fine on iOS 13.

AppDelegate.m

- (BOOL)application:(UIApplication *)application
continueUserActivity:(nonnull NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *restorableObjects))restorationHandler
{
  NSLog(@"In restorationHandler====");
  return [RNCallKeep application:application
            continueUserActivity:userActivity
              restorationHandler:restorationHandler];
}

-(void)pushRegistry:(PKPushRegistry *)registry didReceiveIncomingPushWithPayload:(PKPushPayload *)payload forType:(PKPushType)type withCompletionHandler:(void (^)(void))completion{
  [RNVoipPushNotificationManager didReceiveIncomingPushWithPayload:payload forType:(NSString *)type];
  [RNCallKeep reportNewIncomingCall:uuid handle:handle handleType:@"generic" hasVideo:false localizedCallerName:callerName fromPushKit:YES];
    completion();
}

Home.js

VoipPushNotification.addEventListener("notification", notification => {
      console.log("VoipPushNotification notification Home =", notification);
   // RNCallKeep.displayIncomingCall(uuid, userData.cid, userData.cname);
//The above line commented for iOS 13, before on iOS 12 it was uncommented.
// On iOS 12 when user tap on call from recent call log, it will redirect to our app. But on iOS 13 uncommenting those line leads to kill the app due to issue link attached just below.
});

this issue.

Outgoing call:
The main issue is from the call log to my app redirection doesn't happens. I know that a call triggered from a call log tap is never an incoming call, but it's outgoing call. But to make that happen, it should first redirect to the app and then my didReceiveStartCallAction method gets call. (This all things were working fine on iOS 12) But currently it's not even open the my app from call log.
As soon as I uncomment RNCallKeep.displayIncomingCall from Home.js, my outgoing calls work fine, but in that case incoming will not work well as describe on the issue which's link I added.

So can you please guide me if I missed anything.

@Chaitanya-Suryadevara
Copy link
Author

@kylekurz , Can you please check my last comment?

@kylekurz
Copy link
Contributor

kylekurz commented Oct 9, 2019

@Chaitu4190 I haven't had time to really attempt to reproduce your issue, as we've been pushing our app live this week. If uncommenting RNCallKeep.displayIncomingCall in your Home.js "fixes" outgoing calls, however, you have some logic error in your codebase. That shouldn't be involved in outbound calls at all.

If you set a breakpoint in Xcode at NSLog(@"In restorationHandler===="); in AppDelegate.m, do you hit that breakpoint when calling from the call logs on the device?

@Chaitanya-Suryadevara
Copy link
Author

@kylekurz, Don't know if something is wrong with my code base, or from the library. Unfortunately while calling from the call logs my break point doesn't hit.

@kylekurz
Copy link
Contributor

@Chaitu4190 if you don't hit that breakpoint, something is wrong in the setup. That's the earliest entry point into your application from iOS system level control. I won't say there isn't also a bug somewhere in this library, but the library relies on your AppDelegate to pass the userActivity information down and until that is working, all the discussion about RNCallKeep functionality is moot.

Please take a look at the Apple documentation to verify you've registered properly with the system for continueUserActivity calls. If you still can't find the issue after that, you can provide me with a sample project or give me access to your repo and I'll do my best to help, but it's sort of outside the scope of this dependency.

@BiosBoy
Copy link

BiosBoy commented Aug 26, 2023

Same issue for me. Call has not been redirected to the app once tapped in the call history (native app). Interesting that I can still access the app from Contacts app (once tapped on the phone number to call with the voIP app);

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

Successfully merging a pull request may close this issue.

5 participants