IOS reminds users to go to the settings page to re-authorize notification locating and other functions, ios notification

Source: Internet
Author: User

IOS reminds users to go to the settings page to re-authorize notification locating and other functions, ios notification

The least unknown feature of iOS 8 and later versions is the deep link with application settings, you can authorize the location, notification, contact, camera, calendar, and health settings as needed by the APP.

 

Most applications only pop up a warning window containing operation instructions, such as "go to Settings> privacy> location> OUR_APP ". For example, Twitter applications have a more refined and friendly directive dialog box, so I use it as an example (unfortunately, most applications have a very bad version ).

I am writing this post as a frustrated user. I hope more iOS developers can establish a direct deep link with user settings, especially when it is easy to operate.

The following is a calendar-related application warning code, which contains options for users. I am trying to include an option that can bring users into the settings.

 

12345678910111213141516171819 func showEventsAcessDeniedAlert() {    let alertController = UIAlertController(title: "Sad Face Emoji!",        message: "The calendar permission was not authorized. Please enable it in Settings to continue.",        preferredStyle: .Alert)      let settingsAction = UIAlertAction(title: "Settings", style: .Default) { (alertAction) in          // THIS IS WHERE THE MAGIC HAPPENS!!!!        if let appSettings = NSURL(string: UIApplicationOpenSettingsURLString) {            UIApplication.sharedApplication().openURL(appSettings)        }    }    alertController.addAction(settingsAction)      let cancelAction = UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)    alertController.addAction(cancelAction)      presentViewController(alertController, animated: true, completion: nil)}

Again, you only need to add this code to your APP to achieve deep link with user settings.

123 if let appSettings = NSURL(string: UIApplicationOpenSettingsURLString) {    UIApplication.sharedApplication().openURL(appSettings)}

When a user rejects authorization, it is more like a Swarm application.

When users click "open settings", they can easily access this interface.

You only need to add these three lines of code to improve the user experience in activating APP permissions. Taking me as an example, users even cannot continue to use the application because the calendar is not authorized. Therefore, my biggest interest is to make it easy for users to change their permissions. Similarly, this applies to many other applications.

This method works better in iOS 9 systems! In the setting interface, a return button is provided to allow the user to return directly to your application. There is no reason not to use this method!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.