I am working on callKit framework, I found that by the use of call directory extension, we can Identify the incoming phone number. My question how to implement a call directory extension in iOS app to identify incoming call detail. I am working in Objective C.
Let a number "+919876xxxxx" add in call directory extension using this method:
- (BOOL)addIdentificationPhoneNumbersToContext:(CXCallDirectoryExtensionContext *)context {
// Numbers must be provided in numerically ascending order.
CXCallDirectoryPhoneNumber phoneNumbers[] = {+919876xxxxx};
NSArray<NSString *> *labels = @[ @"Telemarketer"];
NSUInteger count = (sizeof(phoneNumbers) / sizeof(CXCallDirectoryPhoneNumber));
for (NSUInteger i = 0; i < count; i += 1) {
CXCallDirectoryPhoneNumber phoneNumber = phoneNumbers[i];
NSString *label = labels[i];
[context addIdentificationEntryWithNextSequentialPhoneNumber:phoneNumber label:label];
}
return YES;
}
And I on the call blocking and identification feature in the phone settings.
When I call from this number it show the [App name] Caller ID: Telemarketer.
My question is how can I know this number in my application so that I show this number in table.
Thanks in Advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…