美文网首页
iOS 电话拨打特殊号码遇到的坑

iOS 电话拨打特殊号码遇到的坑

作者: LV大树 | 来源:发表于2021-01-29 21:34 被阅读0次
     先看代码,正常来说,拨打电话是正常的。             
  NSMutableString *str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"*#06#"];
// str=[[NSMutableString alloc] initWithFormat:@"tel://%@",@"10010011"];
            NSLog(@"str:%@",str);
            
            if( [[UIApplication sharedApplication]canOpenURL:[NSURL URLWithString:str]]){
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
            }else{
                NSLog(@"cant open %@",str);
            }

但对于特殊指令会报错:

[urloverrides] Error getting URL override for (null): Error Domain=NSOSStatusErrorDomain Code=-50 "invalid input URL" 
UserInfo={NSDebugDescription=invalid input URL, _LSLine=332, 
_LSFunction=-[_LSDOpenClient getURLOverrideForURL:newsOnly:completionHandler:]}

相关文章

网友评论

      本文标题:iOS 电话拨打特殊号码遇到的坑

      本文链接:https://www.haomeiwen.com/subject/bncctltx.html