CallKit without VOIP - ios

Please let me clear, is it possible to integrate CallKit without using VOIP?
What I want to achieve is to get call history from iPhone. and I know it is not possible. So I want to create my own history with the help of CallKit. For this purpose I need following:
I want to detect incoming call (not voip)
Outgoing call (not voip)
In all states - background, foreground, not running, suspended
Call duration
Can we do this with the help of CallKit or is there any other workaround?
Note: It is not about VOIP Apps

is it possible to integrate CallKit without using VOIP?
I would say yes, SpeakerBox (the Apple CallKit example) doesn't use VoIP.
https://developer.apple.com/library/archive/samplecode/Speakerbox/Listings/Speakerbox_SpeakerboxCall_swift.html
is it possible to integrate CallKit in all states - background, foreground, not running, suspended without using VOIP?
No, if the app is suspended or not running you can't detect an incoming call.

For case of CallDuration in active mode can be traceable by using callkit. Let me know, if you are only interested to know Call Duration. I can give full detail.
Other all cases that you mentioned are not possible to trace, unless your phone is jailbroken.

Related

Can I observe the incoming call and outgoing call in background?

When my application is in the foreground it needs to easily detect the call event like call connected, call disconnected but when my application goes into background it does not detect any call events.
So how can I detect call events like incoming call and outgoing call in background?
I am working on CallKit framework with iOS 10 and XCode 8. I found that core telephony framework has been deprecated in iOS 10.
I am using the CXCallObserverDelegate Pattern for observing the call.
I want to calculate the call duration of incoming and outgoing calls during calling.
After searching about this question i ended up with this answer i think might help
Yes, you can detect a Call, but only if your app is running in the foreground.
For this you can use the Core Telephony Framework.
If your app will fall in any of the background running categories (VOIP, AUDIO, Location tracking or accessory ) you might be able to use the
CTCallCenter in the background. But be aware that Apple will reject your app if you use the background running mode for something it was not meant for.
The CTCallCenter will allow you to detect any calls that are started or already in progress.
However, you will not be able to detect any detail about the call, the CTCall identifying the call will only tell you this state. The callID of CTCall will just give you an unique identifier for the call but not the number being called.
original question

Creating incoming call overlay in iOS

I have already done this in Android, but I need to know if or how to do it in iOS. Having a somewhat definitive "no its not possible" will help me convince the powers that be.
The app I have is a VOIP app, although at this point all the incoming call handling is done via simple notifications. I know that if our app were in use (its more unified communications than simply voice so it may be active while not on a call) I could do this easily... its my app.
Its when the app is not in the foreground that I'm running stuck.
All the "how to do VOIP" examples use the voip socket to simply add a notification. While the APN notifications aren't terribly speedy, without the immediate feedback of a ringer, I can't justify putting in all the additional code (since we're not using SIP I'll have to write the socket layer myself in order to get the notifications slightly sooner).
Is it as simple as opening a custom URL which will launch my app and show the ringer ([[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"myapp://example.com/ringer/call-12321123"]];)
? That would seem to not allow me to return the user to the app they were using before the ringing started.

How to intercept and parse incoming calls via an app

How does Truecaller intercept incoming phonecalls on the iphone to display caller ID?
I didn't think this was possible from within the app?
Specifically, if I wanted to build this functionality, what protocols would I go about using?
http://www.truecaller.com/how-it-works
On an iPhone, without jailbreaking it:
- you cannot intercept a call in any way
- you cannot determine the phone number nor the caller ID identifying information regarding the call. Even if you could there
is no way to alter what is displayed on the call screen
- you cannot block the call
- your program can get a notification when a call is being made/terminated etc. But only if your app is executing in the
foreground at the time of the call or if the app is in the
background and has a relevant background mode (even then you can
only know there is a call in some circumstance, depending upon what
you're doing in the background and what state your in etc. Its too complex to describe the exact situation here briefly)
True Caller doesn't do that on iOS as it isn't supported with the native SDK. See their FAQ:
http://www.truecaller.com/support , specifically the "Why don't I receive live caller ID?" Section under "iPhone/Windows Phone". If you must though, try looking into a solution for jailbroken devices.
It's impossible to "intercept" calls. It is possible to handle the "background event call" when a iPhone get's a call. That said, Truecaller doesn't intercept calls. More info can be found on their website.

Detecting the call events in ios

I am new to ios. I was wondering if there is any way to detect the call events like incoming call, outgoing call even if my app is not in foreground. And if yes it is possible then can i read the details about that call like duration, whether it is missed, dialed or recieved. Thanks in advance.
Yes you can detect a Call. but only if your app is running in the foreground.
For this you can use the Core Telephony Framework.
If your app will fall in any of the background running categories (VOIP, AUDIO, Location tracking or accessory ) you might be able to use the
CTCallCenter in the background. But be aware that Apple will reject you app if you miss use the background running mode for something it was not meant for.
The CTCallCenter will allow you to detect any calls that are started or already in progress.
However you will not be able to detect any detail about the call, the CTCall identifying the call will only tell you this state. The callID of CTCall will just give you an unique identifier for the call but not the number being called.

IOS - How to block all incoming calls?

Can anyone suggest me is there a way to block all incoming calls for a while? or at least can I put my phone into silent pragmatically ? Please suggest
No. Simply you cannot do that. There is no public API is available to do that. Your app will be in sandbox mode. You cannot access them in anyway.
Now it can be done from iOS 10 and above using the CallKit framework upto a certain amount. The numbers we provide can be blocked. If you want to block all incoming calls, just use Airplane mode.
The CallKit framework provides programmatic access to VoIP functionality, as well as call blocking and identification.

Resources