x


iPhoneSettings.generation & iPhone.generation - not reporting iPad2 - Unity bug or mine?

Hi,

I've got a problem where iPhoneSettings.generation isn't recognizing the iPad2 correctly. I'm using Unity 3.5.2.f2, but when I log the iPhone settings on an iPad2 I'm getting this -

Debug.Log("iPhoneSettings.generation: " + iPhoneSettings.generation);
Debug.Log("iPhoneSettings.model     : " + iPhoneSettings.model );
Debug.Log("iPhone.generation        : " + iPhone.generation);

Gives me -

iPhoneSettings.generation: Unknown
iPhoneSettings.model     : iPad
iPhone.generation        : Unknown

It's working fine on an iPod touch I've got, reporting the correct Gen4.

iPhoneSettings.generation: iPodTouch4Gen
iPhoneSettings.model     : iPod touch
iPhone.generation        : iPodTouch4Gen

I've tried both iPhoneSettings.generation and iPhone.generation, I'm not sure why there are two different interfaces, but neither is working for me, and it doesn't matter if I build it as a universal or iPad only binary.

I don't have any other iOS devices to try it on to know if it's a wider problem.

Has anyone else got this reporting the correct value - iPad2Gen?

Or is this a bug with this version of Unity?

Cheers.

more ▼

asked Jun 16 '12 at 09:35 AM

Tricko gravatar image

Tricko
0 2 2 2

The iPhoneSettings interface has been completely deprecated. If you look in the iPhoneSettings class all members are marked "Obsolete." I think the Unity devs just forgot to mark the class as obsolete as well.

Nov 13 '12 at 11:30 PM justinlloyd
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I am having the same problem with an iPhone 4, using the same code (both iPhoneSettings.generation and iPhone.generation). However, it works fine for my iPad 2. Has your iPad been activated yet? My iPhone 4 has not yet been activated so that's the only reason I could come up with as to why it is not being detected...

more ▼

answered Jun 19 '12 at 12:59 AM

zeitgiest14 gravatar image

zeitgiest14
0

That's odd, mine is a wifi only version, and it's been setup with iTunes account and everything, so should be a "normal" device.

I'm thinking the work around now is to create a small native iOS plugin to do the detection and report the device string directly and ignore the Unity APIs for this.

Cheers.

Jun 20 '12 at 08:10 PM Tricko
(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:

x28

asked: Jun 16 '12 at 09:35 AM

Seen: 1545 times

Last Updated: Nov 13 '12 at 11:30 PM