Question

I've an app, that permits me to call to my contacts. I use the following code to do that:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:numberVar]];

The call is made, but the problem is that when I finish the call, the ios don't turn back to the app. Is there anyway of doing that? When the user click the "end call" the ios come back to the app.

Thanks a lot!

Was it helpful?

Solution

You want to use IPC (inter process communication), which is a bit odd in iOS apps: You need to register a protocol handler in your app and place a link in the HTML page you're displaying with openURL. E.g. your link could start with something like "myapp://" instead of "http://".

Look here: http://mobileorchard.com/apple-approved-iphone-inter-process-communication/

OTHER TIPS

How about this?

UIWebView webView = [[UIWebView alloc] init]; 
NSURL *url = [NSURL URLWithString:@"numberVar"]; 
[webView loadRequest:[NSURLRequest requestWithURL:url]];

use this code: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt://10086"]];

it will take you back to the application.

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