2011-07-21 37 views
0

我能夠從我的iPhone應用程序中調用通過使用下面的代碼:如何在通話結束後返回到我的iPhone應用程序?

NSString *phoneNumber = @"tel://1234567890"; 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; 

現在,我想知道如何回到我的應用程序恢復通話結束的時候?

+0

據我所知,這樣的交互是不可能的,因爲你的應用程序已被降級到後臺,並且所有UI交互已被委派給電話應用程序和用戶。 –

+0

據我所知,沒有辦法做到這一點。 – dasdom

回答

1

據我所知,這樣的交互是不可能的,因爲你的應用程序已被降級到後臺,並且所有UI交互已被委派給電話應用程序和用戶。

0

我發現這太問題

End call, don't return to app automatic in iphone 3.1 version

其中指出,在蘋果開發論壇的文章(需要開發帳戶)

https://devforums.apple.com/message/128046

它說這是在IOS 3.1的變化但「解決方法」是

使用UIWebView打開電話:網址,通話結束後,您的應用程序將重新啓動,但您希望使此通話發出警報,您會感到煩惱。

我have't證實了這一作品所描述的,只是覺得應該點出來

2
UIWebView *phoneCallWebview = [[UIWebView alloc] init]; 
    // [self.view addSubview:phoneCallWebview]; 
    NSURL *callURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel:%@", 9238928399]]; 
    [phoneCallWebview loadRequest:[NSURLRequest requestWithURL:callURL ]]; 
0

從iOS 5中,下面使用...

NSString *phoneNumber = [@"telprompt://" stringByAppendingString:@"12345678"]; 
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]]; 
0

只需使用telprompt ://代替電話://

telprompt將首先提示用戶,當通話結束時,它將返回到您的應用程序。

NSString * myNumber = [@「telprompt://」stringByAppendingString:txtMobileNo.titleLabel.text]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:myNumber]];

相關問題