美文网首页
iOS 拨号助手对 移动 172 号码段的判断错误BUG

iOS 拨号助手对 移动 172 号码段的判断错误BUG

作者: 清河湾 | 来源:发表于2019-05-24 17:55 被阅读0次

    iOS 拨号助手对 移动 172 号码段的判断错误,会将 判断为国际号码,导致无法拨打

    直接在前面 加上 "+86-" 就可以解决,目前只知道 172 号码段有这个问题.

    //场景实现:

    NSURL *url = [NSURL URLWithString:@"tel:17233333333"];
    [UIApplication sharedApplication] openURL:url];
    

    处理方法:

    NSMutableString * string = [[NSMutableString alloc] initWithFormat:@"tel:%@",@"17233333333"];
    if ([string containsString:@"tel:172"]) {
        string = [string stringByReplacingOccurrencesOfString:@"tel:172" withString:@"tel:+86-172"];
    }
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]];
    

    类似问题文章:https://www.jianshu.com/p/35cbbe56ddc9
    不过 这文章中说的BUG问题已经被苹果更新解决了.

    相关文章

      网友评论

          本文标题:iOS 拨号助手对 移动 172 号码段的判断错误BUG

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