简体   繁体   中英

App is rejected use of non-public URL scheme, which is a private entity

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.

If user off the location service then what we do?? because app required user's location.

You can't use the non-public URL schemes in your app. If you do, Apple will reject your app for the security and privacy reason. If you continue to do same, it will lead to permanently disable your apple developer account.

For the user location, you can always check for the permission for location either user has give it or not. And based on the user action you can take the further actions.

How to check location permission

import CoreLocation

Create location manager as property

var locationManager = CLLocationManager()

Request for the location permission.

locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.delegate = self
locationManager.requestAlwaysAuthorization()
locationManager.startUpdatingLocation()

Implement the delegate CLLocationManagerDelegate to get the location permission.

func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {

    switch status {
    case .authorizedAlways, .authorizedWhenInUse:

        print("User has given location permission...")

        //do something 

    case .denied, .notDetermined, .restricted:
        print("Location permission is not given.")
       //do something when location permission is not given by user or it can't be determined.

    @unknown default:
        print("unknown case...")
    }        
}

Do not forget to add required keys for location permission in Info.plist file.

So in this way you can manage location permission and perform some operation.

When you upload app next time you need to remove non-public URL schemes otherwise you will face rejection again.

要解决此问题,请修改您的应用以使用公共 API 提供相关功能,或使用“prefs:root”或“App-Prefs:root”URL 方案移除该功能。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM