iOS APP内跳转到 设置

2023-11-20  本文已影响0人  Khazan

跳转到 设置 - APP

if let settingsUrl = URL(string: UIApplication.openSettingsURLString) {
  UIApplication.shared.open(settingsUrl)
}

其它方式

  1. 使用 "prefs:root="

https://stackoverflow.com/questions/5655674/opening-the-settings-app-from-another-app/61383270#61383270

iOS11后被禁用

https://developer.apple.com/forums/thread/115981?answerId=358016022#358016022

  1. 使用 "App-Prefs:root"
if let settingsUrl = URL(string: "App-Prefs:root") {
  UIApplication.shared.open(settingsUrl)
}

Apple将其视为私有API,Apple审核会拒绝

https://developer.apple.com/forums/thread/691712?answerId=690943022#690943022

上一篇下一篇

猜你喜欢

热点阅读