Safari的屏幕时间限制误导了Canopenurl功能
我有一个模块,我用来检查URL是否有效或不通过Canopenurl()所有工作顺利进行,但我的一位测试人员将屏幕时间限制在Safari设置上对Safari进行了限制 - >屏幕时间 - >内容&隐私限制 - >允许应用程序 - >禁用野生动物园。
现在Canopenurl()每次都会返回false,因此有什么办法可以找到对Safari的限制?
if UIApplication.shared.canOpenURL(urlWeb) {
let arrComponent = URLComponents(string: urlWeb.absoluteString)?.path.components(separatedBy: "/")
if arrComponent?.contains(where: { (strElement) -> Bool in
return strElement == "test"
}) == true , let nativeUUID = arrComponent?.last {
}
} else {
print("Not valid URL")
}
I have one module in which I used to check URL is valid or not via canOpenUrl() all things working smooth but one of my testers put a screen time restriction on safari from Setting -> screen time -> content & privacy restriction -> allow app -> disable safari.
Now canOpenUrl() return false every time so is there any way we can find a restriction on safari?
if UIApplication.shared.canOpenURL(urlWeb) {
let arrComponent = URLComponents(string: urlWeb.absoluteString)?.path.components(separatedBy: "/")
if arrComponent?.contains(where: { (strElement) -> Bool in
return strElement == "test"
}) == true , let nativeUUID = arrComponent?.last {
}
} else {
print("Not valid URL")
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请勿将Canopenurl用于此代码。即使您跳过Canopenurl检查,该代码也将具有相同的行为和相同的结果。
Do not use canOpenURL for this code. This code will have the same behavior and same results, even if you skip the canOpenURL check.