Detecting phone number on incoming call ios [duplicate] - ios

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...

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.

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.

Related

Detect Caller Name when I get Incoming call or Outgoing Call [duplicate]

I'm trying to get caller ID (phone number) at the time of incoming call.
TrueCaller has implemented this and they get the phone number of incoming caller.
I've found this information:
1. CoreTelephony Framework(It gives only calling states)
2. Apple's 9.0 update : "Maybe" contacts sync. with mail app and detects the incoming phone number.
###EDIT###
iOS 10 and above:
Use Callkit, take a look at call directory extension
According to documentation,
Identifying Incoming Callers
When a phone receives an incoming call, the system first consults the user’s contacts to find a matching phone number. If no match is found, the system then consults your app’s Call Directory extension to find a matching entry to identify the phone number. This is useful for applications that maintain a contact list for a user that’s separate from the system contacts, such as a social network, or for identifying incoming calls that may be initiated from within the app, such as for customer service support or a delivery notification.
For example, consider a user who is friends with Jane in a social networking app, but doesn’t have her phone number in her contacts. The social networking app has a Call Directory Extension, which downloads and add the phone numbers of all of the user’s friends. Because of this, when the user gets an incoming call from Jane, the system displays something like “(App Name) Caller ID: Jane Appleseed” rather than “Unknown Caller”.
To provide identifying information about incoming callers, you use the addIdentificationEntry(withNextSequentialPhoneNumber:label:) method in the implementation of beginRequest(with:).
class CustomCallDirectoryProvider: CXCallDirectoryProvider {
override func beginRequest(with context: CXCallDirectoryExtensionContext) {
let labelsKeyedByPhoneNumber: [CXCallDirectoryPhoneNumber: String] = [ … ]
for (phoneNumber, label) in labelsKeyedByPhoneNumber.sorted(by: <) {
context.addIdentificationEntry(withNextSequentialPhoneNumber: phoneNumber, label: label)
}
context.completeRequest()
}
}
Because this method is called only when the system launches the app extension and not for each individual call, you must specify call identification information all at once; you cannot, for example, make a request to a web service to find information about an incoming call.
iOS 9 and earlier:
As Kakshil mentioned, Caller ID is not possible on non jailbroken devices.
And I will give you some findings on how true caller works,
Its not reading the call history, they actually created Action
extension, wherever you try to share a contact, it will display
truecaller app extension, which coded for showing the contact
details fetched from their server
You might also get confused with push notification received for few
calls, saying
"Some X calls you". This is where truecaller used a trick. If you
noticed clearly, that push notification will be received only when
you get a call from an android user with truecaller installed. Let
me explain you in details,
X(android user with truecaller installed), calling Y(ios user with truecaller installed), the android version notify the server that X making call to Y. And server will send push notification to Y's iPhone.
Caller ID is not possible on non jailbroken devices.
However there is one way, in which you can know which user is calling, but not sure if it will be useful to you.
If you have a bluetooth device, connected to the iPhone, it will get all notifications, including incoming calls, which you can then get the caller ID for.
Apart from this, there is currently no other way at all to know the called ID.

How to can we detect incoming phone number with call kit in iOS 10 [duplicate]

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...
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.
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.

how to get the incoming call number by using callkit

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...
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.
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.

Get the callers phone number from an incoming call on iPhone

I'm trying to get caller ID (phone number) at the time of incoming call.
TrueCaller has implemented this and they get the phone number of incoming caller.
I've found this information:
1. CoreTelephony Framework(It gives only calling states)
2. Apple's 9.0 update : "Maybe" contacts sync. with mail app and detects the incoming phone number.
###EDIT###
iOS 10 and above:
Use Callkit, take a look at call directory extension
According to documentation,
Identifying Incoming Callers
When a phone receives an incoming call, the system first consults the user’s contacts to find a matching phone number. If no match is found, the system then consults your app’s Call Directory extension to find a matching entry to identify the phone number. This is useful for applications that maintain a contact list for a user that’s separate from the system contacts, such as a social network, or for identifying incoming calls that may be initiated from within the app, such as for customer service support or a delivery notification.
For example, consider a user who is friends with Jane in a social networking app, but doesn’t have her phone number in her contacts. The social networking app has a Call Directory Extension, which downloads and add the phone numbers of all of the user’s friends. Because of this, when the user gets an incoming call from Jane, the system displays something like “(App Name) Caller ID: Jane Appleseed” rather than “Unknown Caller”.
To provide identifying information about incoming callers, you use the addIdentificationEntry(withNextSequentialPhoneNumber:label:) method in the implementation of beginRequest(with:).
class CustomCallDirectoryProvider: CXCallDirectoryProvider {
override func beginRequest(with context: CXCallDirectoryExtensionContext) {
let labelsKeyedByPhoneNumber: [CXCallDirectoryPhoneNumber: String] = [ … ]
for (phoneNumber, label) in labelsKeyedByPhoneNumber.sorted(by: <) {
context.addIdentificationEntry(withNextSequentialPhoneNumber: phoneNumber, label: label)
}
context.completeRequest()
}
}
Because this method is called only when the system launches the app extension and not for each individual call, you must specify call identification information all at once; you cannot, for example, make a request to a web service to find information about an incoming call.
iOS 9 and earlier:
As Kakshil mentioned, Caller ID is not possible on non jailbroken devices.
And I will give you some findings on how true caller works,
Its not reading the call history, they actually created Action
extension, wherever you try to share a contact, it will display
truecaller app extension, which coded for showing the contact
details fetched from their server
You might also get confused with push notification received for few
calls, saying
"Some X calls you". This is where truecaller used a trick. If you
noticed clearly, that push notification will be received only when
you get a call from an android user with truecaller installed. Let
me explain you in details,
X(android user with truecaller installed), calling Y(ios user with truecaller installed), the android version notify the server that X making call to Y. And server will send push notification to Y's iPhone.
Caller ID is not possible on non jailbroken devices.
However there is one way, in which you can know which user is calling, but not sure if it will be useful to you.
If you have a bluetooth device, connected to the iPhone, it will get all notifications, including incoming calls, which you can then get the caller ID for.
Apart from this, there is currently no other way at all to know the called ID.

Intercept incoming call ios sdk (Non Jailbreak)

Hi i have tried for bundle of times and find out that iOS SDK does not give us access due to security reasons for getting following data;
Intercept an incoming call (Getting phone number from incoming call)
Read Call history
Intercept SMS (Getting phone number from incoming SMS and reading its contents)
Block an incoming call
etc
Here are some of the links resulting from my search about this issue:-
How can I get the callers phone number from an incoming call on iphone
http://iosstuff.wordpress.com/2011/08/19/accessing-iphone-call-history/
Programmatically get the number of the incoming call
Can I fetch details of the incoming call phone number in my applicaton?
Hook into incoming call?
handling an incoming call through an app in iphone xcode
Identify number of incoming call in iPhone
I also found that CoreTelephony CTCall object provide us only limited info, Just call state and its unique Id. But nothing else we can get by using CoreTelephony framework.
But, I have seen one application on app store that does gets incoming call phone number.
I wonder how this app
Callinize iPone App
works and gets incoming call info?
I also want the same thing to do with my app. But i did't find such a way to do. Please help if you can.
Thanks!
I'm late to the party here, but I was just reading the description of Callinize. They built an integration with the Asterix pbx system and it only works with Asterix. So this app does not really access iOS phone calls.

Resources