How can I open the Settings app when the user presses a button?

后端 未结 6 1559
不知归路
不知归路 2020-12-06 06:38

From what I understand by using code like this:

NSURL* appUrl = [NSURL URLWithString: @\"URL\"];
[[UIApplication sharedApplication] openURL:appUrl];
<         


        
6条回答
  •  情深已故
    2020-12-06 07:12

    As per @bnduati's answer, in iOS 8 you can use the following code to open your app's settings in the settings app:

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
    

    Old answer:

    From iOS 5.1 through iOS 7, it was not possible to open the settings app from another application.

    You might want to investigate this framework for providing in-app settings.

    There are quite a few other questions that discuss this topic:

    iPhone - how to put Settings bundle seen through System Settings App into your own App?

    Launch iPhone setting screen from Application?

    How to send a user to the main iPhone Settings screen from within your iPhone App

提交回复
热议问题