Skip to content

+ (void)SafariOpenURL:(NSURL *)URL #5

@howiei

Description

@howiei
  • (void)SafariOpenURL:(NSURL *)URL
    if (@available(iOS 10.0, *)) { // 这是在iOS10以上的系统打开方式,没有考虑else情况
    [[UIApplication sharedApplication] openURL:URL options:@{UIApplicationOpenURLOptionUniversalLinksOnly : @no} completionHandler:^(BOOL success)
    {
    if (!success) {
    [UIAlertController PAlertWithTitle:@"提示" message:@"打开失败" completion:nil];
    }
    }];
    } eles {
    该方法内部是不是需要加个判断,在iOS10以下系统无法跳转App Store
    // 跳转苹果商店
    [[UIApplication sharedApplication] openURL:URL];
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions