2012-06-06 40 views
0

在我的應用程序撥打電話後,我想返回到我的應用程序。當用戶在通話屏幕中點擊「結束」時,他總是看到手機應用程序。如何強制應用程序返回到我的原始應用程序?撥打電話後返回到我的應用程序

我讓使用呼叫:

NSString *phoneURLString = [NSString stringWithFormat:@"tel:%@", phoneNumber]; 
NSURL *phoneURL = [NSURL URLWithString:phoneURLString]; 
[[UIApplication sharedApplication] openURL:phoneURL]]; 
+0

這種[方法]撥打電話後,要回你的應用程序( http://stackoverflow.com/a/10683460/2521004)也適用。 –

回答

1

您可以使用下面的代碼從您的應用程序

NSURL *url = [NSURL URLWithString:@"telprompt://phone number"]; 
[[UIApplication sharedApplication] openURL:url]; 
0

有沒有辦法做到這一點不越獄。

+1

Mudit Bajpai答案顯示的方式。 – Kuba

+0

我站在更正 - 雖然這種方法似乎有一些麻煩:http://stackoverflow.com/questions/5317783 –

2

試試這個.......

UIWebView *callWebview = [[UIWebView alloc] init]; 
    NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", phoneNumber] 
    [callWebview loadRequest:[NSURLRequest requestWithURL:telURL]]; 
+0

完美!謝謝! – Kuba

相關問題