- Home /
iOS application in the settings panel
Hi,
It is possible to expose settings under iOS so that we can let the user set up the 3d application from within the settings panel, just like you can fro example change the diaporoma settings of the Photos application or other application you install and then show up in the list down below.
Is that something to code in xcode after the app is built by unity?
Thanks,
Jean
Answer by Jean-Fabre · Jan 01, 2011 at 02:11 PM
Hi,
It will need to be coded within xcode:
Odd that Unity doesn't expose this actually,
Bye,
Jean
Answer by TedB · Feb 22, 2012 at 06:46 PM
After a fair amount of digging, another developer clued me in. I find it odd that this is not mentioned in the Unity reference manual for PlayerPrefs, and hope that it can be added.
All one needs to do is add a Settings.bundle to the iOS project, configure it so the settings you want exposed are set using the plist editor, and then reference the same variable names you use there in your Unity project.
So, for example, if you double-click your root.plist in the Settings.bundle and add a PSToggleSwitchSpecifier named some_variable, you can retrieve that setting in your Unity project like this:
variableName = PlayerPrefs.GetInt(“some_variable", 1); // where 1 is the value returned if the user has not specified a setting
This is indeed a great tip. Tested and working smoothly. I wonder why its not clearly documented on the PlayerPrefs documentation.
Is this still working? I can't seem to get it to work on Unity 2017. I see the preferences on the Settings App, but they are not being read inside my game... any ideas?
Answer by Peter G · Dec 30, 2010 at 01:26 PM
Yes, you can do that, you would need to use a plugin in xcode. Basically any native iPhone interface feature except the keyboard and touches needs a plugin. Once you hide the Unity window, its just like any normal iphone application.
There are several ways you could save your settings:
UnitySendMessage() which would let you pass variables 1 at a time into Unity,
You could use PlayerPrefs/NSUserDefaults to store data and retrieve it.
You could save a file in your obj-c code then use WWW to read it.
Then at the end hide/remove your view and show the Unity view again to the player.
Hi, thanks for the infos, I actually don't want to show the setting within the app, at least not just that way, what I am after is exposing settings within the OS itself when the user select "settings" and then select my app in the list on the left side at the bottom. that's where I would like settings to be available.
Ok, you will still need a plugin probably, I would search it in Google to get a full answer.
I’ve done a lot of searching and I have not found the answer to this question. I have been using Native Toolkit to display a iOS view, but as the original quesiton states, that isn’t desired. $$anonymous$$y app just needs to be ble to access the settings defined in the Settings.bundle in the IOS project. So, how would I access the settings?
Your answer
Follow this Question
Related Questions
Specify iphone project 1 Answer
Ampersand in application name 4 Answers
condition `!mono_debug_initialized' not met 0 Answers
IPhone 4 and IPad 2 lost audio on resume 0 Answers
About iPhone/iPad development 1 Answer