我试图启动从我的iPhone应用程序的调用返回后,返回到应用程序,我做到了follwing方式..从iPhone应用程序拨打电话编程和结束通话
-(IBAction) call:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Call Besito" message:@"\n\n\n"
delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Submit", nil];
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex != [alertView cancelButtonIndex])
{
NSString *phone_number = @"0911234567"; // assing dynamically from your code
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", phone_number]]];
NSString *phone_number = @"09008934848";
NSString *phoneStr = [[NSString alloc] initWithFormat:@"tel:%@",phone_number];
NSURL *phoneURL = [[NSURL alloc] initWithString:phoneStr];
[[UIApplication sharedApplication] openURL:phoneURL];
[phoneURL release];
[phoneStr release];
}
}
由以上代码.. 我能够成功拨打电话..但是当我结束通话时,我无法返回到我的应用程序
因此,我想知道如何实现,也请告诉我如何使用webview发起呼叫...
谢谢& Registers Ranjit
这个问题详细解答你的问题。只需使用uiwebview来调用,而不是openURL:http://stackoverflow.com/questions/5317783/return-to-app-behavior-after-phone-call-different-in-native-code-than-uiwebview –