0

So while submitting the app to the appstore, we get this response back:

enter image description here

I've been reviewing some answers on here and this solution might be doable, but I'm having trouble figuring out how to encorporate the fix into this codebase I'm working in.

Also, and most importantly, how can I make sure this won't get rejected again if I think I fix it. Is there any way to test whether or not this app fix will lead to a successful submission?

Here is the snippet of code that needs to change:

    static func openSettingsAlert(_ title: String, message: String, settingsURL: String) -> UIAlertController {
    let alertController = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)

    let settingsAction = UIAlertAction(title: "Settings", style: .default) { (_) -> Void in
        let settingsURL = URL(string: settingsURL)
        if let url = settingsURL {
            DispatchQueue.main.async(execute: {
                UIApplication.shared.openURL(url)
            })
        }
    }

    let cancelAction = UIAlertAction(title: "Cancel", style: .default, handler: nil)
    alertController.addAction(cancelAction)
    alertController.addAction(settingsAction)

    return alertController
}

Thank you for any insights you can provide into this matter.

Thanks

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
TJBlack31
  • 745
  • 4
  • 8
  • 23
  • 1
    you can use UIApplication.openSettingsURLString it will approved – Prashant Tukadiya Dec 13 '18 at 05:49
  • @PrashantTukadiya Could you possibly reply with your suggested usage within this context? Also, UIApplication.openSettingsURLString still takes in a URL String parameter and what if the value for that URL String is still "prefs:root="? – TJBlack31 Dec 13 '18 at 05:54
  • 1
    I have used `UIApplicationOpenSettingsURLString` in one of the my app and apple . never raised question on it. – Prashant Tukadiya Dec 13 '18 at 05:57
  • `UIApplication.openSettingsURLString` is in Apple official documents. It's in public document. [I got rejected too](https://stackoverflow.com/a/51093121/419348) for `prefs:root=` reason, due to it's treated as private API. – AechoLiu Dec 13 '18 at 05:57
  • @AechoLiu, when you switched to UIApplication.openSettingsURLString, did you still pass in the original "prefs:root=" String, or did you have to switch to something else. Will Apple still have a problem with me passing "prefs:root=FACEBOOK" as a parameter into this newer method? Thanks. – TJBlack31 Dec 13 '18 at 06:01
  • I did pass the app review, after switch to UIApplication.openSettingsURLString. And ask my boss to update UI spec due to this issue. – AechoLiu Dec 13 '18 at 06:02
  • @AechoLiu, did you have to change the values at all or just the method? – TJBlack31 Dec 13 '18 at 06:05
  • In Apple official document, only `UIApplicationOpenSettingsURLString` is valid. [I had post the same complaint before](https://stackoverflow.com/a/51093121/419348). In my app, the UI needs to go to `WiFi` settings. But now no public API for it. The final UI spec is a graph which guide user to the WiFi page by himself. – AechoLiu Dec 13 '18 at 06:08
  • Thank you for your insights @AechoLiu , I'll look into this further – TJBlack31 Dec 13 '18 at 06:11

1 Answers1

-2

I think you can reply in your reject message form to apple, tell them your app no use "prefs:root="~ (PS. remenber attach your code screenshot) .. after this, re-upload app to waiting for review

ilyi1116
  • 101
  • 3
  • 9
  • I believe my client would still like the ability to share on social media. Wouldn't that be misleading to apple? I think it still needs that functionality – TJBlack31 Dec 13 '18 at 05:58
  • okay, just because even i happed this by apple rejected, and i take screen 「xcode find "prefs:root=" 」and reply apple, resubmit it's safe... – ilyi1116 Dec 14 '18 at 06:51