Page 1 of 1

iphone model number/string

Posted: Tue Nov 05, 2013 7:12 am
by pkocsis
Looking for a way to get the hardware model number/string of an iphone. On android, mobileBuildInfo("MODEL") suffices, but on iphone, is there any way to know if the device is an "iphone 5c" or "iphone 4" or "iphone 4s" or ....whatever?

Thanks!

Re: iphone model number/string

Posted: Tue Nov 05, 2013 10:47 am
by Nakia
The way we used to do this was through mibileDeviceResolution but now there are many devices running the same resolution. I am not aware of another way (I could
be wrong) to do this but I don't imagine putting an external together to do this would be
Overly hard..

I know zero about any other language than livecode but Might just give this a go as a trivial exercise..I managed to put one together a while ago to get the current WIFI SSID...

Look here https://developer.apple.com/library/ios ... evice.html

Re: iphone model number/string

Posted: Tue Nov 05, 2013 11:17 am
by pkocsis
Thank you for responding Nakia...

I didn't know if there was something fundamental I was missing. I may very well put an external together...thanks for the link!

Paul

Re: iphone model number/string

Posted: Tue Nov 05, 2013 2:06 pm
by Nakia
Hello again,

I had nothing better to do tonight so I had a go at putting an external together to do this.
From my testing on the 2 devices I have (iPhone 5 and iPad 2) it is working (doesn't run in the simulator though??? not sure why, maybe something to do with how i am building it)..

I have included what is said to be the device identifiers for the new iPad Air into it also (Taken from Stack posts which were updated just today)

I will upload it into a Github Repository tomorrow when I get time and will share the link here.

Please note: use as your own risk, the source will be there in Git so feel free to improve it if need be..

Cheers
Kia

Re: iphone model number/string

Posted: Tue Nov 05, 2013 8:59 pm
by pkocsis
WOW! Thanks Kia!! That'll be a great help!!!

Paul

Re: iphone model number/string

Posted: Tue Nov 05, 2013 10:53 pm
by Nakia
It should be here https://github.com/nakia010985/getdevicemodel.git
Again, use at your own risk and feel free to modify/improve.