美文网首页
openURL 无法跳转APP Store

openURL 无法跳转APP Store

作者: Xavier丶xie | 来源:发表于2020-07-08 10:49 被阅读0次

原来直接这么写就可以

[[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://apps.apple.com/cn/app/idxxxxxx"]] 

今天偶然间发现无法跳转
想要跳转现在需要另外加上一层判断,即:

 if ([[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://apps.apple.com/cn/app/idxxxxxx"]]) {
            [[UIApplication sharedApplication]openURL:[NSURL URLWithString:@"https://apps.apple.com/cn/app/idxxxxxx"]];
        }

相关文章

网友评论

      本文标题:openURL 无法跳转APP Store

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