0

I need to grab the device model my iOS code is running on in Objective-C. However, as this will be pushed out to an analytic/metric that will be seen by less tech savvy people, I need the advertised model like "iPhone 6S" instead of the comparatively odd-looking "iPhone8,1". If I was to show the less-friendly version I'd get "But there's no such thing as an iPhone 8 yet" complained back at me, no matter how many memos I could send. As a result I'd like to report a human-readable model to them.

I've seen a few questions on here about this, and all I found were opened over 2 years ago, and perhaps updated 1 year ago. Most were referencing a github library that hasn't been updated in an even longer period, while the rest proposed a long, unwieldy list of string conversions that would need constant maintainance. There were a couple of others, but they were also suggesting libraries that I can't integrate into my project for other reasons

Is there any method that could take the pain out of this issue? Anything new in the iOS SDK that supplies this?

Examples of the questions I've seen with out-of-date or unsuitable methods:

How to get device make and model on iOS?

UIDevice currentDevice model possible values

Determine device (iPhone, iPod Touch) with iOS

Cœur
  • 37,241
  • 25
  • 195
  • 267
Force Gaia
  • 514
  • 2
  • 8
  • 24
  • 2
    There is not such "human friendly list" in iOS SDK, you have to do it yourself. But you won't be able to guess in future if Apple skip a "S" version (6,6S), etc. SDVersion (https://github.com/sebyddd/SDVersion) is up to date, or else, you have to use a WebService that may manage it. – Larme Nov 14 '16 at 14:52
  • You can get the tech savvy name convert to it a human readable value using a dictionary. You can use that has a reference: http://stackoverflow.com/a/20062141/4370893 and use the last comments in these pages to get more values: https://gist.github.com/Jaybles/1323251 – VitorMM Dec 08 '16 at 12:32
  • @vitormm i did say i'd like to avoid a "long, unwieldy list of string conversions that would need constant maintainance" and was looking to see if anything official had been added to the SDK or some other painless method. – Force Gaia Dec 09 '16 at 16:16
  • Ops, sorry, haven't read that part :P Well, there is another way. I've used it in macOS, but I suppose it might work in iOS has well. Just append the iOS system serial number in the end of that link and it you will receive a XML file which contains (among other informations) a human readable device model: http://support-sp.apple.com/sp/product?cc= – VitorMM Dec 10 '16 at 16:55
  • Yup, according to that page it works has well: http://blog.coriolis.ch/2011/08/01/get-your-apple-device-model-name-in-a-readable-format/ I just don't know how to retrieve the system serial number, but I guess this is the best solution. – VitorMM Dec 10 '16 at 17:01
  • Never mind, apparently there is no way to retrieve it programmatically: https://forums.developer.apple.com/thread/9948 – VitorMM Dec 10 '16 at 17:59

0 Answers0