应用内调用邮箱/拨号/短信/浏览器/应用商店

相关链接

752372-20160427165618064-1244110130.png

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

#pragma mark 邮箱点击事件
- (IBAction)urlButtonClick:(UIButton *)sender {

    NSString *url = @"mailto:243097674@qq.com";
    [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];
}

#pragma mark 短信点击事件
- (IBAction)duanXinClick:(UIButton *)sender {

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:13718047581"]];

}

#pragma mark 拨号点击事件
- (IBAction)boHaoClick:(UIButton *)sender {

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://13718047581"]];
}

#pragma mark 浏览器点击
- (IBAction)liuLanQiClick:(UIButton *)sender {

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mqqwpa://im/chat?chat_type=wpa&uin=3108145465&version=1&src_type=web&web_src=oicqzone.com"]];
}

#pragma mark 谷歌地图点击
- (IBAction)googleMapClick:(UIButton *)sender {

    NSString* addressText=@"1 Infinite Loop, Cupertino, CA 95014";
    addressText = [addressText stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
    NSString* urlText =[NSString stringWithFormat:@"http://maps.google.com/maps?q=%@", addressText];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]];
}

#pragma mark 应用商店点击
- (IBAction)appStoreClick:(UIButton *)sender {

    NSURL*appStoreUrl= [NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291586600&mt=8"];
    [[UIApplication sharedApplication] openURL:appStoreUrl];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值