How to get the voip call log information in applic

2019-07-09 05:24发布

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  

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!

标签: ios callkit
1条回答
神经病院院长
2楼-- · 2019-07-09 06:08

We can take phone number from 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;
}
查看更多
登录 后发表回答