我已经在voip应用程序中实现了呼叫工具包,在该工具包中,我为传入或传出的呼叫生成了呼叫日志(在“电话最近使用”标签上可见)。当我单击通话记录时,它将打开我的应用程序。我已经重写了UIApplication委托方法来获取处理程序。
UIApplication
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
但是我无法获得有关呼叫日志的信息NSUserActivity。如何在我的应用程序中获取通话记录信息?
NSUserActivity
任何帮助,不胜感激。谢谢!
我们可以从 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; }