Question

I am trying to make an app, which should come into picture (each & every time) as soon as the user is done with his/her phone call.

Use case:

"My app" is currently not running.

  1. User Makes a phone call from mobile.
  2. Once the call is completed, "My app" should start/running.
  3. It should gather some information about last call.
  4. write it into log & ends..

I have seen tasks running in background foreground but how to invoke App after each phone call.

Thanks..

Was it helpful?

Solution

You cannot do this. Quite simply iOS does not (yet) have any such feature where your app would be triggered based on some system event.

But you can explore some alternatives when a call comes when your app is running.


If your app is running when the call comes

It might be possible to sign up to receive notifications (using UINotificationCenter calls) from UITelephony.

However, if you're actively using your app when the phone call starts, it will call -(void)applicationWillEnterForeground when the call is finished. As for differentiating a phone call end versus just a regular return to phone call, I don't know. But it's a start.

If your application is running while a call is in place CoreTelephony Framework provides call states. CTCall class provides information about the call states. I have not used this myself but you may find it useful.

extern NSString const *CTCallStateDialing;
extern NSString const *CTCallStateIncoming;
extern NSString const *CTCallStateConnected;
extern NSString const *CTCallStateDisconnected;

OTHER TIPS

No, its not possible to fetch Call/SMS/Email logs in iOS 5 and later.

You can do this in jailbroke

any ways if you are trying to achieve this in iOS 4, I have a useful information HERE

It is not possible in iOS till now if the device is not jailbroken.

iOS doesn't allows any app to intercept working of any other application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top