拨号
void CallPhone(const char* iphone){
NSString *nsIphone =[NSString stringWithFormat:@"tel://%s",iphone];
NSLog(nsIphone);
NSURL* url = [NSURL URLWithString:nsIphone];
NSString *version = [UIDevice currentDevice].systemVersion;
NSLog(version);
if(version.doubleValue>10.0){
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}
else{
[[UIApplication sharedApplication] openURL:url];
}
}
一键加群
- (BOOL)joinGroup:(NSString *)groupUin key:(NSString *)key{
NSString *urlStr = [NSString stringWithFormat:@"mqqapi://card/show_pslcard?src_type=internal&version=1&uin=%@&key=%@&card_type=group&source=external&jump_from=webapi", @"82444916",@"e68eb0fdf96224675ce36d498e5dad899e22a37b8a71fad8c960cd8db9c2ce8c"];
NSURL *url = [NSURL URLWithString:urlStr];
if([[UIApplication sharedApplication] canOpenURL:url]){
[[UIApplication sharedApplication] openURL:url];
return YES;
}
else return NO;
}
|