ios app store rejection - Your app uses the “prefs:root=” non-public URL scheme

前端 未结 7 839
礼貌的吻别
礼貌的吻别 2021-01-03 23:07

I recently uploaded a new version of my app to itunes connect. My app got rejected with this note

Your app uses the \"prefs:root=\" non-public URL s

7条回答
  •  囚心锁ツ
    2021-01-03 23:53

    I faced the same rejection form Apple and to open app settings i was using the below code and it's not accepted on iOS11.

    let url = URL(string : "prefs:root=")
    if UIApplication.shared.canOpenURL(url!) {
        UIApplication.shared.openURL(url!)
     }
    

    So, to open Settings, I used the below code and App was approved.

    guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else {
        return
      }
      if UIApplication.shared.canOpenURL(settingsUrl)  {
        if #available(iOS 10.0, *) {
          UIApplication.shared.open(settingsUrl, completionHandler: { (success) in
          })
        }
        else  {
          UIApplication.shared.openURL(settingsUrl)
        }
      }
    

提交回复
热议问题