如何从我的应用程序中打开“设置”应用程序? [重复]

[英]How do I open the Settings application from my application? [duplicate]

This question already has an answer here:


In an iPhone app I'm working on, the user needs to enter some configuration via the settings application before my app will be able to connect to a server and run. Right now when the user first launches my app, I display an alert explaining that the user should go to settings, enter the config details and then relaunch, but this isn't ideal.


Unfortunately there's no way for me to provide sensible defaults for this app, the server host names, user accounts etc. will vary for each user. I think the best I can hope for is to show an alert explaining that some configuration needs to be entered via settings, and provide a "Take me there..." button that will open settings and then open the section in settings for my app. If that's not possible, opening settings is better than nothing.


I vaguely remember that the iPhone jailbreaking people had figured out a way to launch settings or other apps via a funny URL or phone number in the Addressbook, but I'm not finding any info about it in Google.




3 个解决方案



As far as I know there's no sanctioned way to open Settings from another app.


In my opinion you should just ask for the values if you need them at launch, storing them in your NSUserDefaults and possibly directing your users to look in Settings.app if they need to change those settings in the future.


Unfortunately that means maintaining some minimal UI for your user to fill in their settings during that first launch, but it seems better from a UX perspective to me than denying the user the joy of using the app immediately.




In its current form, Settings is not really up to the task you want to use it for.


The problem you'll run into, if you haven't already, is that you'll want to verify the user's information somehow. Maybe they entered the server name wrong, or made a mistake in their password. What then? Keep sending the user back to Settings to try again, then switching back to your app to find out if they got it right this time? That's going to be a lousy user experience, and the best way to fix it is to give the user the option of changing the settings in your app so you can verify the information immediately.


Only once you've done that, poof, you don't need to use Settings for this anymore. You can just send users to that account-edit view immediately when your app launches for the first time. Your users get a better experience, and you're saved the trouble of trying to find a good way to get users to find your app's configuration in the Settings app.


Apple does this already-- just look at mobile mail.

Apple已经这样做了 - 只看移动邮件。



One of possible solutions suggested above is to write own settings dialog. I have found this project http://www.inappsettingskit.com/ which you can include to your app and it shows the same settings as iOS does. I did not test it yet, but going to do now.




© 2014-2019 ITdaan.com 粤ICP备14056181号