Now that iPhone gaming is getting more fragmented (there is non-free upgrade to OS 3.0 for iPod Touch users and new more powerful iPhone 3GS), how can I found out on which platform my game is running?
Finding out on which firmware or model the game is ran
(15 posts) (7 voices)-
Posted 2 years ago #
-
check out the systemVersion property of the UIDevice class:
Posted 2 years ago # -
See this aricle from Erica Sadun, anyway it doesn't cover yet the 3GS
http://arstechnica.com/apple/guides/2009/03/iphone-dev-determining-your-platform.ars
It would be great If anyone can know what a 3GS returns and give back a fix for this funtions.
Posted 2 years ago # -
I don't have one yet, but iPhone 3GSs have been showing up across the internet as iPhone2,1 for a while. The next iPod reportedly just started showing up as an iPod3,1.
Posted 2 years ago # -
Sorry, JKyy, I read your post and thought that you were asking which OS version you are running on. coolman, nice link! So from the same link I gave above, would something like:
[UIDevice currentDevice].model
tell you only if you are running on an iPod vs iPhone vs Simulator, or can it tell you which type of iPhone or which version of iPod? Or is Erica's method the only way to get that info?
Posted 2 years ago # -
Hi Codemattic,
Don't know. I didn't tested indepth. Anyhow the real meat for knowing the device is:
[[UIDevice currentDevice] platform]It should give you:
Platforms iPhone1,1 -> iPhone 1G iPhone1,2 -> iPhone 3G iPod1,1 -> iPod touch 1G iPod2,1 -> iPod touch 2GI would like to see what is returned by an 3GS .. To confirm is Acceleroto is right (iPhone2,1)
Posted 2 years ago # -
[UIDevice currentDevice].model
Simulator 3.0 => iPhone Simulator
iPhone 3GS => iPhone[[UIDevice currentDevice] platform]
Doesn't seem to exist.
Posted 2 years ago # -
ob1,
oh well I guess "model" doesnt tell us what we wanted. The platform method exists if you add the category that coolman posted about earlier tho.
Posted 2 years ago # -
Ok, I didn't see that at first.
It gives: iPhone 2,1 on my 3GS
Posted 2 years ago # -
@ob1
It must exist .. mmm Can you download this project?
http://github.com/ars/uidevice-extension/tree/master
And tell us in the console what says?
Anyhow Apple pointed me to this:
take a look at the system call "sysctlbyname" and the section on "CTL_HW" from the Apple provided iPhoneOS reference documentation. It is necessary to check the machine class and machine type to determine if the device is capable of supporting vibration.
Posted 2 years ago # -
sysctlbyname is what Erica's code does.
Posted 2 years ago # -
Also a reply from AI in the next article makes a good point
http://www.clintharris.net/2009/iphone-model-via-sysctlbyname
Posted 2 years ago # -
Thanks ob1
Posted 2 years ago # -
iPhone 3GS model == iPhone2,1 ; right?
Posted 2 years ago # -
What does the newest iPod touch with 16GB return? iPod2,1 or iPod 3,1?
Posted 1 year ago #
Reply
You must log in to post.