Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS:13位置始终允许:点击打开的设置后,它不会重定向到应用程序设置页面_Ios_Objective C_Swift_Ios13 - Fatal编程技术网

iOS:13位置始终允许:点击打开的设置后,它不会重定向到应用程序设置页面

iOS:13位置始终允许:点击打开的设置后,它不会重定向到应用程序设置页面,ios,objective-c,swift,ios13,Ios,Objective C,Swift,Ios13,我需要打开我的应用程序设置,但有时如果我们打开了设置其他屏幕,如wifi或代理屏幕,则不会重定向到iOS 13中的应用程序设置 @IBAction func openPhoneSettings(_ sender: Any) { guard let settingsUrl = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(settingsUrl) else

我需要打开我的应用程序设置,但有时如果我们打开了设置其他屏幕,如wifi或代理屏幕,则不会重定向到iOS 13中的应用程序设置

@IBAction func openPhoneSettings(_ sender: Any) {
    guard let settingsUrl = URL(string: UIApplication.openSettingsURLString),
        UIApplication.shared.canOpenURL(settingsUrl) else {
            return
    }

    UIApplication.shared.open(settingsUrl, options: [:]) { (canOpen) in
        self.dismiss(animated: false, completion: nil)
    }
}

我为开放应用程序设置功能,这在任何情况下都可以重定向到应用程序设置

func openAppSetting()
{
   guard let settingsUrl = URL(string: UIApplication.openSettingsURLString) else {return}

   if UIApplication.shared.canOpenURL(settingsUrl) 
   {
      if #available(iOS 10.0, *) 
      {
          UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
                        print("Settings opened: \(success)")
                    })
      } 
      else 
      {
         UIApplication.shared.openURL(settingsUrl as URL)
      }
   } 
   else 
   {
       print("Settings not opened")
   }
}

我希望这将有助于

这在我的应用程序中运行良好,为iOS 12及更高版本构建,在模拟器和真实设备上测试

UIApplication.shared.open(URL(string: UIApplication.openSettingsURLString)!, options: [:], completionHandler: nil)

你们能更详细地描述一下你们的情况吗?你们的行为有规律吗?还是总是这样?可能使用
openURL
而不是
canOpenURL