how to get the incoming call number by using callkit
Asked Answered
E

3

6

How to get the incoming call phone number programmatically by using call kit framework. i tried with cxcallobserver class but no use.

Any suggestions most helpful...

Educator answered 29/6, 2016 at 11:18 Comment(2)
callKit still in beta and there is no final overview available so wait for the final release.Consternation
Hi Nitin Is that possible by using callkit. If possible i will wait for final release.Educator
M
10

When using CallKit's Call Blocking & Identification feature (new in iOS 10), phone numbers to be blocked or identified are loaded by your app's Call Directory extension prior to an incoming call and the phone numbers are stored by the system. Then, when an incoming call arrives, this stored data is consulted by the system and an incoming call may either be blocked or identified in the incoming call UI with the label provided.

For privacy and performance reasons, Call Directory app extensions are not launched when incoming calls arrive and an app extension cannot retrieve the phone number for an incoming call.

Muscovite answered 29/6, 2016 at 16:7 Comment(4)
If this is true, then it is practically useless as caller ID. An app cannot know in advance who is going to call! It has to be runtime.Shaitan
How truecaller find the incoming call?Acidophil
please check the link #40838061Acidophil
@Stuart M : can you help me : #41846076Devorahdevore
C
0

The Call Directory extension introduced in iOS 10 works like the Safari Content Blocker Extension that was introduced in iOS 9. Your extension has to supply a list of phone numbers (in safari's extension, it was a json file), these numbers will be stored by the iOS, and on the event of an incoming call, the system checks the list provided by your extension( same like safari would check the rules specified by the json file before loading a website ), provided, your extension is active at that time.

So, using this feature for creating a Caller ID like app is not possible, because things are not dynamic. Also there may be a limit on the number of phone numbers you can provide in the list, which hopefully be announced by the iOS 10 release.

Coordination answered 22/7, 2016 at 9:57 Comment(5)
Do have the code which I can use.. or any reference where I can find some code on this!Deel
Any word on the limit of numbers? Also, do you know when and how often your extension is run to add new numbers? What about removing previously added numbers?Connaught
@ChrisWagner As of now, nothing about the limit has been stated on the Developer website. For removing numbers, I’ve retrieved all the numbers in a data structure, removed the number and then saved all the numbers again. The frequency of the update also depends on iOS, however, you can force update by using : [[CXCallDirectoryManager sharedInstance] reloadExtensionWithIdentifier:EXTENSION_IDENTIFIER completionHandler:^(NSError * _Nullable error) { //your completetion }];Coordination
Thanks @ShaggyD, I was able to index upwards of 6,700 records without issue. I can also confirm that the reload works and is a wholesale operation, any previous indexed items will be removed upon the reload. Which makes sense as you need to provide the numbers in sequential order.Connaught
After some experimentation, I've found that the maximum number of blocked call entries is somewhere around 2,000,000. It's hard to say if this is per app, or a total for all call blocking apps loaded on the phone.Emplane
P
-1

Currently, I'm also unable to fetch the phone number of an incoming call,

there's an Apple official Live Caller ID Lookup Extension way, and another hacky way of updating the in-app contact lookup directory everytime when the app is launched.

Live Caller ID Lookup Extension

The Live Caller ID Lookup app extension requires you to use Apple relay servers to support making calls to your server endpoints. This requires endpoint validation from Apple. If you’re interested in using the app extension, submit your request. For more information on the server-side API, see the Live Caller ID Lookup example and the Swift homomorphic encryption library.

Cons: submitting an Apple form to request access to this feature, even then we get an encrypted phone number to our server, and we need to do homomorphic encryption to all our leads to be able to search on encrypted data using homomorphic encryption

Paleo answered 21/10 at 10:29 Comment(1)
Did you copy most parts of this answer from developer.apple.com/documentation/sms_and_call_reporting/…?Garboard

© 2022 - 2024 — McMap. All rights reserved.