iOS - Trigger outgoing VOIP Call on clicking the caller in the native iOS Recent call table view

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 12:05:13

问题


I have implemented the CallKit for my App to trigger/receive both Audio and Video Call within our App by using WebRTC. Which is working seamlessly without any problem.

As I see there are 3 ways to trigger a call from Call Kit.

  1. Performing an interaction within the app
  2. Opening a link with a supported custom URL scheme
  3. Initiating a VoIP call using Siri

As of now, I don't have any requirement to initiate the call using Siri but we need to initiate the call when the user clicks on any cell in the native iOS Recent calls screen which then routes to our application and triggers the out going call.

And also our app contains few metadata when user calls the other user such as receiverID etc.. So when the user misses the call from the other user, I need to store this meta data and I need to trigger a call when user clicks on missed call list of iOS Recent call screen using all those metadata.

I was going through the Sample App for CallKit "Speakerbox" provided by Apple. And I found that they are using custom URL scheme just like what we use for DeepLinking of iOS apps.

So I need few suggestion whether this can be achieved using URL scheme and If so, How can I store the metadata ( custom object ) in CXHandle object.


回答1:


Pasting the same answer here from me: Refer

Verify the remoteHandle and supportedHandleTypes, both should be similar as per your requirement.

callUpdate.remoteHandle = [[CXHandle alloc] initWithType:CXHandleTypeGeneric value:[NSString stringWithFormat:@"%@", phoneno]];
configuration.supportedHandleTypes = [NSSet setWithObjects:[NSNumber numberWithInteger:CXHandleTypeGeneric],[NSNumber numberWithInteger:CXHandleTypePhoneNumber], nil];

If the handles mismatches, you can't able to process the NSUserActivity.

Implement this method to get callback,

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



来源:https://stackoverflow.com/questions/48338692/ios-trigger-outgoing-voip-call-on-clicking-the-caller-in-the-native-ios-recent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!