LoginSignup
4
1

More than 3 years have passed since last update.

【Swift5】iOSの設定アプリに遷移するための処理と注意点

Posted at

iOSの設定アプリに遷移させるための処理

guard let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) else { return }
UIApplication.shared.open(url, options: [:], completionHandler: nil)

注意点

①設定アプリに遷移するときの挙動

「設定アプリ」内にアプリ固有の設定項目がある場合は、アプリ固有の設定画面へ遷移します。

詳細な挙動については、下記の記事が参考になります。
UIApplicationOpenSettingsURLStringから設定アプリを開いたときの挙動調査

②設定アプリの特定の画面に遷移させる処理(App-Prefs:root=)を使うとリジェクトされる

設定アプリの特定の画面に遷移させるとリジェクトされた例があるらしいので注意が必要です。

詳しくは下記記事に書かれています。
App-Prefs:root= を使っていたため2.5.1リジェクトされたときの対処法

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1