gpt4 book ai didi

iPhone SDK : Launching an app after call ends

转载 作者:行者123 更新时间:2023-12-03 20:21:35 24 4
gpt4 key购买 nike

如何在应用程序内调用电话或在通话结束后立即启动应用程序?我知道这是可能的,因为应用程序商店中的一些应用程序已经在这样做。

最佳答案

我从 Apple 网站获取了此代码,它运行良好:

-(IBAction) dialNumber:(id)sender{

NSString *aPhoneNo = [@"tel://" stringByAppendingString:[itsPhoneNoArray objectAtIndex:[sender tag]]] ; NSURL *url= [NSURL URLWithString:aPhoneNo];
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];
}


}

关于iPhone SDK : Launching an app after call ends,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2312666/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com