iOS 10 拨打电话延迟的问题

方案一:亲测能够async

if (_telPhone.length == 0) {
                return;
            }
            NSString *callPhone = [NSString stringWithFormat:@"telprompt://%@", _telPhone];
            CGFloat version = [[[UIDevice currentDevice]systemVersion]floatValue];
            if (version >= 10.0) {
                /// 大于等于10.0系统使用此openURL方法
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone] options:@{} completionHandler:nil];
            } else {
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
            }

方案二:写个线程,有说iOS 11不起做用,因为没有真机,未测试测试

if (_telPhone.length == 0) {  
        return;  
    }  
    NSString *callPhone = [NSString stringWithFormat:@"telprompt://%@", _telPhone];  
    dispatch_async(dispatch_get_global_queue(0, 0), ^{  
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];  
    });
相关文章
相关标签/搜索