简体   繁体   中英

How to present UIAlertView which contains Settings + Cancel button when location services are turned off in my app?

In one of my app I'm using Location Services. I'm throwing a normal alert view whenever the location services are off like "Enable Your Location Services" with "OK" button when I open my app. But I don't want this. Rather I need to show the alert view as "Turn on Location Services to Allow Your_App_Name to Determine Your Location" with "Settings" and "Cancel" button as shown in the image. Give me the suggestions with a sample code, Thanks. 在此处输入图片说明

You should just pop up an UIAlertView telling the user that needs to enable Location Services.

If you want to be more precise, you can always create a new View explaining the user how to enable location Services using graphical content, that makes it so much easier for the user.

You cannot open the Settings page from your app, and if you could, your app would be rejected on the app store.

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