x


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

more ▼

asked Dec 30, 2010 at 09:02 AM

Jean Fabre gravatar image

Jean Fabre
3.6k 189 151 187

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first
more ▼

answered Jan 01, 2011 at 02:11 PM

Jean Fabre gravatar image

Jean Fabre
3.6k 189 151 187

(comments are locked)
10|3000 characters needed characters left

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
more ▼

answered Feb 22, 2012 at 06:46 PM

TedB gravatar image

TedB
56 6 5 9

Nice tip!, thanks for sharing

Jun 28, 2013 at 02:52 PM Jean Fabre

This is indeed a great tip. Tested and working smoothly. I wonder why its not clearly documented on the PlayerPrefs documentation.

Aug 03, 2013 at 09:00 AM DannyB
(comments are locked)
10|3000 characters needed characters left

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.

more ▼

answered Dec 30, 2010 at 01:26 PM

Peter G gravatar image

Peter G
17.6k 29 63 163

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.

Dec 31, 2010 at 07:18 AM Jean Fabre

Ok, you will still need a plugin probably, I would search it in Google to get a full answer.

Dec 31, 2010 at 11:41 AM Peter G

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. My 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?

Feb 20, 2012 at 02:04 AM TedB
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2184
x413
x204
x178
x26

asked: Dec 30, 2010 at 09:02 AM

Seen: 6491 times

Last Updated: Aug 03, 2013 at 09:00 AM