ios实现拨打电话以及跳转App Store

参考原文:http://blog.csdn.net/ouy_huan/article/details/30506925
//前面两种会弹框提示拨打,第三种是直接拨打(之前是挂了电话不会回到当前app),经测试现在三种方式挂了电话都会回到app当前页面

//方式一,有弹框提示
    NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"131****"];
    UIWebView * callWebview = [[UIWebView alloc] init];
    [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
    [self.view addSubview:callWebview];
//方式二,有弹框提示
//注意这里的是telprompt,其他和第三种完全一样
    NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"telprompt://%@",@"131****"];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
//方式三,无弹框提示
    NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"131****"];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

跳转到App Store

//跳转到App Store 
NSString *url = @"https://itunes.apple.com/cn/app/***";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];

//获取app在App Store 上面的地址,在电脑上面进入itunes,点击头像,单击右键,拷贝地址,如获取QQ的地址:


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容