7

We are in the process of writing an iPhone app (that will be in the background) that would be notified when an incoming phone call comes. The app does some background work - going to a server retrieving some data while the phone session is ongoing and then notifies the user.

After searching, I found that I can use the Private Telephony Headers/Framework to actually know who is calling in my app. However, I am unable to update the dialer screen with information retrieved from server. Also I found that the application has to be running when the phone call arrives. Yak!!

I know that this won't approved in the apple store , however I am looking for 2 things:

  1. How do I put this app in the background.
  2. How do I show some information while the call is going on. Local notification is fine but it has to show immediately.

Even if we have to jailbreak, I would like to know how to get this done. This app is for law enforcement officials - proof of concept.

Nate
  • 31,017
  • 13
  • 83
  • 207
R K
  • 81
  • 3
  • 1
    If you want to make this kind of app in a proper way you'll need to jailbreak, because I think the best solution would be a background daemon doing the heavy lifting and then code injection into SpringBoard to display the information. There are no real tutorials on how to do things like that, however, developers who are in the jailbreak scene have experience regarding these matter and sometimes they do freelance work. – YllierDev May 17 '12 at 14:12
  • I am basically looking for code injection into spring board so that the sensitive information for the law enforcement officials is shown immediately and they are better informed while the call is happening. If Apple says its preventing such changes for User experience or Privacy/Security , I would say that they haven't designed it better and are scared.. and only hiding behind these excuses. – R K May 17 '12 at 14:28
  • If you wanna try it yourself, MobileSubstrate (http://iphonedevwiki.net/index.php/MobileSubstrate) is the tool to use for code injection on jailbroken devices. I do understand Apple not willing to open the broad system to developers. "Tweaks" by inexperienced developers can cause serious havoc and the iPhone is meant as a low-maintenance mass product. However, that hasn't stopped me from tinkering and improving the system ;) – YllierDev May 17 '12 at 20:14

1 Answers1

3

As YllierDev said, you could look into a MobileSubstrate tweak to display the information. But, for something that's maybe a little less daunting for someone new, you could try this:

  1. First, create a launch daemon. This can run in the background and do whatever you like. It'll be started when the phone boots, so the user doesn't need to first run some app, and then put it into the background. I found this to be a good example of building a LaunchDaemon

  2. It sounds like you already know how to use undocumented features of the Core Telephony framework to get notified of a new call. This will be your daemon's responsibility. For completeness, see this answer, or this other answer on how the daemon can listen for calls with Darwin notifications.

  3. When the call is intercepted, your daemon can contact your server.

  4. Then, you can create a simple popup with something like this:

CFOptionFlags responseFlags = 0;
CFUserNotificationDisplayAlert(20.0, 3, NULL, NULL, NULL, 
     CFSTR("Hello"), CFSTR("Hello World"), CFSTR("OK"), 
     NULL, NULL, &responseFlags);

Here's some Apple docs on CFUserNotifications

You'll probably have to link with the CoreFoundation framework, and maybe include this header in your project, for CFUserNotificationDisplayAlert() to be available.

But, that should give you a popup with your dynamic call data.

Community
  • 1
  • 1
Nate
  • 31,017
  • 13
  • 83
  • 207