Launching a call programmatically on the iPhone and returning to the same application after freezing

I would lie to put a call in my application (I can use tel :), but I would like to return to my application, where I left after users hang. Is it possible?

+1
iphone tel
source share
3 answers

I got this code from the Apple website and it works great:

-(IBAction) dialNumber:(id)sender{ NSString *aPhoneNo = [@"tel://" stringByAppendingString:[itsPhoneNoArray objectAtIndex:[sender tag]]] ; NSURL *url= [NSURL URLWithString:aPhoneNo]; NSString *osVersion = [[UIDevice currentDevice] systemVersion]; if ([osVersion floatValue] >= 3.1) { UIWebView *webview = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; [webview loadRequest:[NSURLRequest requestWithURL:url]]; webview.hidden = YES; // Assume we are in a view controller and have access to self.view [self.view addSubview:webview]; [webview release]; } else { // On 3.0 and below, dial as usual [[UIApplication sharedApplication] openURL: url]; } } 
+4
source share

No no. The user controls where they move after completing a telephone conversation. I'm afraid. by default, it remains in the phone’s application, and the only way to exit it is to press the home button, which will bring them to the main screen. Save your state and reload it when they return, like everyone else.

+3
source share

You cannot return to the application automatically after the call is completed, but if your application supports iOS 4, its multitasking functions (if the application supports them) can return the user to where he or she stopped before the call when the application restarts.

If you use iOS 3 or earlier, you will need to manually save the state of the application yourself, and then return the user to this state when you restart it.

0
source share

All Articles