16

In my app I'm using [NSURL URLWithString:@"App-Prefs:root=Privacy&path=LOCATION"] to open settings screen. Will it be rejected by apple as according to some sources this is considered a private API?

Ross Stepaniak
  • 877
  • 1
  • 6
  • 22

4 Answers4

18

Yes. The only legal way to open Settings is to use UIApplicationOpenSettingsURLString.

Gereon
  • 17,258
  • 4
  • 42
  • 73
8

My app just got rejected because of this, so yes, it is considered as private API :)

Here's the rejection notice from Apple:

Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.

Paulw11
  • 108,386
  • 14
  • 159
  • 186
rhcpfan
  • 557
  • 7
  • 19
  • Your rejection note refers to `prefs:root`, not `App-Pref:root=`. Did your code really use the same URL prefix asked in the question, or did it use this somewhat different URL prefix, and you suspect the rejection would apply to both? – davidgyoung Jun 26 '18 at 02:03
  • @davidgyoung In the rejection note Apple actually specifically says not to use either of these two in their resolution recommendation. So using either one could get your app rejected – tzm41 Jul 12 '18 at 15:15
  • I've had this "prefs:root=" in my app (which was approved in the App Store for almost 2 years now, but yesterday when i tried to upload a new build the App got rejected with the same notice. – Milander Jul 26 '18 at 07:07
  • Apple even threatened to terminate my account if I continue to use prefs:root.... ?! I didn't know that it was a private API either, I thought it was the official way to link to specific pages in the settings app... – skofgar Nov 27 '18 at 16:56
  • @rhcpfan i'm using "App-prefs:\(bundleIdentifier)" to open an app's setting where he can enable or disable push notifications for that app, will Apple reject my app?. My app basically provides shortcuts to enable disable notifications for any app. – Zeeshan Ahmed Jun 09 '21 at 13:28
3

To resolve this issue, if you are navigating to Settings > Privacy. "Just remove that code" and put a simple alert showing Enable location services.

Because from iOS 10 apple consider it is as private entity. So you can not go through it.

3

There’s no supported way to open Settings to the Wi-Fi/Language/Location ‘page’. The fact that this worked in iOS 9 is a bug that’s been fixed in iOS 10.

For more info please refer https://forums.developer.apple.com/message/186656#186656

Mohit Kumar
  • 2,898
  • 3
  • 21
  • 34