0

As of July 2018, it seems that Apple do not accept anymore the usage of App-Prefs:root URL scheme. Please read below before marking as duplicate, because many answers are outdated or inappropriate.

DESCRIPTION OF PROBLEM I currently show an alert to ease the user to activate location at the phone level. This is a strong user experience issue. That is, Settings -> Privacy -> Location Services

Unfortunately, my app has been rejected be cause I use the non-public APIs URL scheme App-Prefs:root=LOCATION_SERVICES

I understand that I cannot use this non public scheme but what is the alternative ??

Indeed, when I deactivated location and I open the apple « maps » application, it opens the locations settings that is targeted by the illegal scheme. (The same goes for google map) if Apple or Google engineers still manage to open the phone location settings, then it means that there is a supported approach for doing so.

Other apps that manage to get direct access to location services at phone level:

  • ZARA (Inditex Company)
  • Life 360
  • Find Friends (Apple Company)

Outdated or inappropriate answers suggest:

  1. using app-settings:root // It opens my own app settings
  2. using UIApplicationOpenSettingsURLString // The same 1.
  3. using App-Prefs:root // prefs:root // The same issue as mine
  4. deleting the peace of code using the // Too bad for user experience

for 1. and 2. Please see the screenshot that shows how the current answers are inappropriate:

my app settings


Please find below the message for the Binary Rejected:

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.

Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

I filled also a request with the Apple Developer Technical Support today.


STEPS TO REPRODUCE

This peace of code below will now be rejected by apple when reviewing binaries.

func showAlertGeo() {
    let alertController = UIAlertController (title: "Location not active", message: "To use all the feature of this app, please activate location on your phone.", preferredStyle: .alert)
    let cancelAction = UIAlertAction(title: "Cancel", style: .default, handler: nil)

    alertController.addAction(cancelAction)

    let settingsAction = UIAlertAction(title: "Settings", style: .default) { (_) -> Void in

        if UIApplication.shared.canOpenURL(URL(string:"App-Prefs:root=LOCATION_SERVICES")!) {
            if #available(iOS 10.0, *) {
                UIApplication.shared.open(URL(string:"App-Prefs:root=LOCATION_SERVICES")!, completionHandler: nil)

            } else {
            // Fallback on earlier versions
                UIApplication.shared.openURL(URL(string:"App-Prefs:root=LOCATION_SERVICES")!)
            }
        }
    }
    alertController.addAction(settingsAction)
    present(alertController, animated: true, completion: nil)
}
Mike Casan Ballester
  • 1,690
  • 19
  • 33
  • I don’t think this is possible. Of course Apple are allowed to use their private API (not sure about Google). It is legitimate to open your own app settings using `UIApplicationOpenSettingsURLString` like you have mentioned. You could still alert the user without linking to the location services page. – Chris Jul 28 '18 at 20:03
  • If you get a different answer from Apple, add a comment here and I'll reopen, but at this point there is a clear answer; there is no alternative. You can only open your own apps settings. To be honest, if the user has deactivated location services globally on their phone they are unlikely to turn them back on for your app anyway. – Paulw11 Jul 28 '18 at 21:33
  • @Paulw11 Thanks for your attention. I do not fully agree with your comment regarding the clear answer; **there is no alternative**... Indeed, those answer are not officials from Apple, nor from Apple manual. Then, regarding the unlikeliness that user turn back on location, I do not fully agree. From my sample of beta testers, many unskilled users deactivated location historically, and are frightened/clueless on how to open phone settings (but still want to share location for any apps and not caring about privacy issues) – Mike Casan Ballester Jul 29 '18 at 10:14
  • @Paulw11 I finally got an official answer from Apple and the answer is already in the duplicate. I will post an answer in the duplicated thread. Do I delete this post to clean up SO ? Thanks – Mike Casan Ballester Jul 31 '18 at 07:49

0 Answers0