Okay, I know that there are many question about it, but they are all from many time ago.
So. I know that it is possible because the Map app does it.
In the Map app if I turn off the localization for this app, it send me a message, and if I press okay, the "Settings App" will be open. And my question is, how is this possible? How can I open the "Setting app" from my own app?
Basically I need to do the same thing, if the user turn off the location for my app, then I'll show him a message saying something that will open the "Setting app"
SWIFT 4.0
From @Yatheeshaless's answer:
You can open settings app programmatically in iOS8, but not in earlier versions of iOS.
Swift:
Swift 4:
Swift 4.2 (BETA):
Objective-C:
In Swift 3 / iOS 10+ this now looks like
YES!! you can launch Device Settings screen, I have tested on iOS 9.2
Step 1. we need to add URL schemes
Go to Project settings --> Info --> URL Types --> Add New URL Schemes
Step 2. Launch Settings programmatically Thanks to @davidcann
Also we can launch sub-screens like Music, Location etc. as well by just using proper name
See this full name list here shared by Henri Normak
Update:
As per the comment everyone wants to know what happens after this change to my application submission status?
So
YES!! I got successful update submission and application is available on store without any complain.
Just to confirm, I Just downloaded this morning and disabled Location services, and then started the app, which asked me for location permission and then my alert popup was there to send me on settings -> location services page --> Enabled --> That's it!!
You can use this on iOS 5.0 and later:This no longer works.UIApplicationOpenSettingsURLString
this will only work if you have previously allowed for any permission. For example Location, Photo, Contact, Push notification access. So if you have not such permission(s) from the user:If iOS 10 or above,
It will open the Settings but then crash it. The reason, there's nothing in settings for your app.
Below code will open your application settings inside the iOS Setting.
Due to device unavailability, I couldn't check this on iOS < 10.
Also, I could find below code from some gist and it works fine on iOS 10 as well. But I am not sure if this will approve by Apple review team or not.
https://gist.github.com/johnny77221/bcaa5384a242b64bfd0b8a715f48e69f