开发者

How to invoke call event in my Iphone application?

here is the scenario: I have fetched the iphone contact de开发者_如何学Gotails into my application.And i have displayed email,phone details my View controller. Now,I want to know how to invoke call event which i click on phone number in my application?


Well you just call the tel scheme:

NSURL *phoneURL = [NSURL URLWithString:@"tel:1234564897"];

BOOL hasPhone = [[UIApplication sharedApplication] canOpenURL:phoneURL];

if (hasPhone) {
    [[UIApplication sharedApplication] openURL:phoneURL];
}

Apple URL scheme Reference


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


Try with

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://123456789"]];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜