iPhone app with call features - ios

I'm trying to get into a new project, by creating an iOS application. But before I start I would like to understand some points:
is it possible to let an application make a phone call? So what I mean is, assumed we have a phone number and would like to call it. Would it be possible to use an (my) application to call this number?
is it possible to let an application speak during a phone call? So after the application started the call, would it be possible that some predefined statements are said in the call?
is it possible that this application hears, registers and analyses what the other person on the phone line is saying? (Leaving apart the privacy issue, assuming that the other person is willing to do that).
Could you please help me? If my question aren't clear, please tell me, I will try to explain it in another way.
Many Thanks
F.P.

iOS is very restricted in terms of the system behaviors third party applications can influence.
To answer your question bluntly, a third party application could prompt the user to initiate a phone / FaceTime call. Once the call is initiated however, your app would enter a background state and relinquish control to the system. The app would not be able to contribute or read any data related to the system phone / FaceTime call.
iOS 10 introduces a VoIP extension, CallKit, which allows third party apps to use the built in calling UI with a custom protocol. You could implement your own protocol (and host servers for handling the exchange of information) and build an extension to make it feel like a system call. You'd be responsible for all aspects of the custom call protocol and thus reading voices, contributing audio, etc. would all be possible (and up to your implementation).
Outside of iOS 10, you would have to built your own VoIP system and interface entirely from scratch.
For more info on CallKit:
WWDC Enhancing VoIP Apps with CallKit
CallKit Enabled Sample App

Related

IOS: self managed telecom

In android you are able to interface with the native telecom system.
The Android framework includes the android.telecom package, which contains classes that help you build a calling app according to the telecom framework. Building your app according to the telecom framework provides the following benefits:
Your app interoperates correctly with the native telecom subsystem in the device.
Your app interoperates correctly with other calling apps that also adhere to the framework.
The framework helps your app manage audio and video routing.
The framework helps your app determine whether its calls have focus.
What I personally care about is like accepting and rejecting incoming calls, routing the audio streams of incoming calls, and know when they hung up. The closest thing I have found is IOS' Callkit but it doesn't seem to be as feature rich as Android's telecom library and lacks the features I need.
So far I know I am able to:
Reject calls (by dissallowing the call in reportNewIncomingCall)
Find out when a call has finished (by using the callObserver)
I am still looking for:
Accept calls
Stream audio to my incoming calls
Which library should I use for these two things, are both even possible in IOS?
My use case
I basically want the ability accept a call and then instead of immediately connecting to the user, I want to play an audio stream first, before the user gets notified.

Is it possible to create a call tracking app on iOS?

From all I have read here, creating a call tracking app on iOS seems impossible. However, after some investigation, I have found a couple of workarounds and would like to know if they are legal and would work at all.
So, at least, I will need one of these features:
access call log history. I've read that's impossible, but also I know that on many devices where iCloud backup is turned on, call history data is saved there, so using some API, for example, this, I can access it. Am I right?
receive notifications when the call is ended. I've read this is possible only in foreground, therefore makes no sense. But following this question, I see that you can initiate calls from the application, which allows at least to track outgoing calls.
Would this be enough or I am wasting time?
Unless you're running on a jailbroken device, the answer is no because there is no publicly available API that provides access to the call list and that is a good thing from a privacy point of view.
A quick search shows that CallKit is for integrating VOIP into the call list, so again the answer is no, CallKit will not be of any use to you.
The notifications are there so that your app can respond properly to calls that take place while it is active.

iOS SDK can you mute or cancel incoming calls

I found various threads here about how muting or canceling incoming calls (or messages) with the iOS SDK is not possible, due to the fact that Apple doesn't want an app to access system level settings. Well in fact not possible with the official tools, which means that if you somehow manage to do it, your app will not be accepted in the iTunes store.
Well I have been asked to assess the possibility of such an app that could do just that. Namely my client has seen these two apps
https://itunes.apple.com/us/app/lifesaver-distracted-driving/id874231222?mt=8
https://itunes.apple.com/us/app/at-t-drivemode/id907208943?mt=8
And they are sure that an app, basically exactly like these (based on the functionality) can be made.
So here I am, asking, how did these two apps succeed at the impossible and also how did they manage to get those apps uploaded to the iTunes store, if muting your phone is not an Apple approved option? I am not really asking for source code, although I am certainly not rejecting examples, but moreso I am asking for pointers of what class or book or documentation do I have to look up to figure out if this is possible? Apples CTCall and CT* classes did not seem to help me much.
K
Apple added the CallKit framework in iOS 10 to allow app developers to do this sort of thing, among others. For docs, see:
https://developer.apple.com/reference/callkit
It is now possible to detect and block unwanted phone calls from iOS 10 and above.
See the CallKit framework
The CallKit framework (CallKit.framework) lets VoIP apps integrate
with the iPhone UI and give users a great experience. Use this
framework to let users view and answer incoming VoIP calls on the lock
screen and manage contacts from VoIP calls in the Phone app’s
Favorites and Recents views.
CallKit also introduces app extensions that enable call blocking and
caller identification. You can create an app extension that can
associate a phone number with a name or tell the system when a number
should be blocked.

Detecting outgoing emergency call vs Developing custom dialer app

My goal is to listen only and not modify the outgoing call event and send GPS coordinates to server from background. I'm not even interested in phone number being dialed, what I only need to know is whether the current call is Emergency call.
I've accomplished this easily in android, by following this tutorial.
However some googling showed that, this is a big pain in the ios world.
The only solution I think is to write dialer app from scratch and manage all the events by myself (if that's even possible), but I think it's too overcomplicated
I'm completely new to ios and please let me know, how would you solve this problem guys?
There is no way this will be possible on iOS unless you were planning to release and app for jailbroken phones (and even then I'm not sure it is). The Core Telphony framework has the methods you can use: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CoreTelephonyFrameworkReference/index.html

iOS using sockets to talk to other apps

Is it possible to have 2 apps on 1 iPhone/iPad talk to another via sockets? For example The main app is phonegap app that just displays data and when the user clicks the print button, the 1st app sends data to the 2nd (2nd app stays in the background, I guess it is a service), it (the 2nd app) then sends that data to a printer that it knows how to talk to whether that is via a webservice call or something else.
From my scan of the docs and other questions it seems the custom URL is one way to make the apps talk, but I want the receiver app to stay in the background. So do I have to use a server/client approach to this? Is that possible.
Sure you can. Just make sure your 2nd app - the background app is conformed to Apple's requirement to run in background modes. You can also use Bonjour to aid in discovery or just pre-selected a port and make other apps aware of it value.
No, there is no socket-based interprocess communication between apps on an iPhone, nor is there any concept of apps as background services. Using custom URLs to launch another app is the only direct method of communication between apps.
On the other hand, if the 2nd app is talking to a printer (or anything else) via a web service, I'm not sure why you wouldn't just have the 1st app use that web service to print directly. Is there a particular reason you need a background app to perform this function?

Resources