iOS 4.2 - Return to app after phone call iOS 4.2 - Return to app after phone call ios ios

iOS 4.2 - Return to app after phone call


I know the question is very old, but currently you can do this (at least on iOS 5) by using telprompt://, like:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://123456789"]];

iPhone will show alert view confirmation and when call ends, your app shows again, instead of iPhone's call app.


As far as I'm aware, because control is passed to the phone.app to make the call, once the call has ended, as far as iOS is concerned phone.app is the current app so that stays in the foreground.

There doesn't seem to be anything you can do about this at the moment. It might be worth putting in a feature request to allow for a "modal phone call" similar to MFMessageComposer that allows you to send emails/sms within your own app.

EDIT

You can follow the advice that Frin gives in the answer below as this contains more up to date information.


I believe the issue is that you're still making the sharedApplication call and as per the other thread, there is no need to add the web view as part of your hierarchy.

I took your code, modified it as below, and it works just fine:

NSString *phoneStr = [NSString stringWithFormat:@"tel:%@", phoneNumber];NSURL *phoneURL = [[NSURL alloc] initWithString:phoneStr];// The WebView needs to be retained otherwise it won't work.if (!mCallWebview)    mCallWebview = [[UIWebView alloc] init];[mCallWebview loadRequest:[NSURLRequest requestWithURL:phoneURL]]; 

Following the call your own app runs as before.


matomo