LoginSignup
78
46

More than 3 years have passed since last update.

App-Prefs:root= を使っていたため2.5.1リジェクトされたときの対処法

Last updated at Posted at 2018-05-28

App-Prefs:root

このURLスキームは主に設定アプリの特定の画面を開くために利用することが多いのではないでしょうか。私も何も考えずに個人アプリで使っていて、2018/05/23あたりに指摘を受け、バイナリリジェクトとされました。

具体的には、通知の設定をしてほしかったため App-Prefs:root=NOTIFICATIONS_ID&path=BUNDLE_ID を使っていました。

2.5.1とは

App Store Review Guideline - Software Requirements

こちらを読んでいただければわかるのですが、要するに「Appleが提供している公式かつ最新のAPIを使いなさい」ということみたいです。 App-prefs:root および prefs:root はnon-publicなURL Schemeに該当するようです。

対処法

App-prefs:root ではなく、 UIApplication.openSettingsURLString を使いましょう。具体的なコードは下記になります。

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

これを実行すると、設定アプリ内の、これを実装したアプリの項目を基本的には開くようです。もし上記コードが公式Twitterアプリで実行された場合、下記画面が開かれるはずです。

Image from iOS.png

詳細な挙動は下記記事が非常に参考になります。

UIApplicationOpenSettingsURLStringから設定アプリを開いたときの挙動調査

78
46
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
78
46