如何在应用程序中获取voip呼叫日志信息-呼叫工具包 [英] How to get the voip call log information in application - Call Kit

查看:66
本文介绍了如何在应用程序中获取voip呼叫日志信息-呼叫工具包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的voip应用程序中实现了呼叫工具包,在该工具包中,我为传入或传出的呼叫生成了呼叫日志(在电话的最近使用"标签上可见). 当我单击通话记录时,它将打开我的应用程序.我已经重写了UIApplication委托方法来获取处理程序.

I have implemented call kit in my voip app in which i generate the call logs for incoming or outgoing calls (visible on phone recent tab). When i click on call logs it will open my app. I've overridden the UIApplication delegate method to get the handler.

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

但是我无法在NSUserActivity中获取与呼叫日志相关的信息. 如何在我的应用程序中获取通话记录信息?

But i unable to get call log related information in NSUserActivity. How i can get the call log information in my app?

任何帮助,我们都感激不尽.谢谢!

Any help much appreciate. Thanks!

推荐答案

我们可以从 userActivity 中获取电话号码

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restora`tionHandler:(void(^)(NSArray * __nullable restorableObjects))restorationHandler{
    INInteraction *interaction = userActivity.interaction;
    INStartAudioCallIntent *startAudioCallIntent = (INStartAudioCallIntent *)interaction.intent;
    INPerson *contact = startAudioCallIntent.contacts[0];
    INPersonHandle *personHandle = contact.personHandle;
    NSString *phoneNumber = personHandle.value;
}

这篇关于如何在应用程序中获取voip呼叫日志信息-呼叫工具包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆