简体   繁体   中英

iOS: Can I disable the default alert pop-up with settings button when location services is turned off from settings

In my iOS application, I want to fetch the user's current location. Before fetching the location I am calling below method to check whether location services has been enabled from settings or not.

[CLLocationManager locationServicesEnabled];

I want to show a customized error message to user if the settings is turned off. But before showing my alert itself, Apple is showing one pop-up like below.

在此处输入图片说明

My customer does not require the settings button here. Is there any way I can disable this system level pop-up. If not disable, can I hide the settings button from the alert? Please help in this. Thank You...

You cann't do this. If you try to do this apple will reject your app. Check this Doc1 , doc2

Update Read this topic Location-Based Services

Location warnings are the requests made by apps (such as Camera, Compass, and Maps as well as location-based third-party apps) to use Location Services with those apps. An app will present a location warning the first time it needs to access Location Services data. Tapping OK will give that app permission to use Location Services as needed. Tapping Don't Allow will prevent an app from accessing Location Services data from then on.

You can't disable this location service alert. It is a system system generated one.

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