iphone model number/string

Getting into LiveCode for iOS? Ask your questions here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
pkocsis
Posts: 105
Joined: Sat Apr 15, 2006 7:20 am

iphone model number/string

Post by pkocsis » Tue Nov 05, 2013 7:12 am

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!

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: iphone model number/string

Post by Nakia » Tue Nov 05, 2013 10:47 am

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

pkocsis
Posts: 105
Joined: Sat Apr 15, 2006 7:20 am

Re: iphone model number/string

Post by pkocsis » Tue Nov 05, 2013 11:17 am

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

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: iphone model number/string

Post by Nakia » Tue Nov 05, 2013 2:06 pm

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

pkocsis
Posts: 105
Joined: Sat Apr 15, 2006 7:20 am

Re: iphone model number/string

Post by pkocsis » Tue Nov 05, 2013 8:59 pm

WOW! Thanks Kia!! That'll be a great help!!!

Paul

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: iphone model number/string

Post by Nakia » Tue Nov 05, 2013 10:53 pm

It should be here https://github.com/nakia010985/getdevicemodel.git
Again, use at your own risk and feel free to modify/improve.

Post Reply

Return to “iOS Deployment”