How Can I Distinguish Between Different Apple Devices in a Browser?

0
25
Asked By TechGuru42 On

I've created a tool called detect-apple-device that attempts to identify Apple devices by analyzing window.screen.width and window.devicePixelRatio. However, many Apple devices have the same specifications; for instance, the iPhone 15 and the iPhone 14 Pro both match at 393×852@3x. I'm looking for other browser APIs that might help me distinguish between different models more accurately, since Apple doesn't include specific device info in their User-Agent strings. Are there any other options available?

4 Answers

Answered By CoderNinja99 On

You might want to consider using the Client Hints API, though I've never tried it myself. It could offer some additional details, but keep in mind it might require user permission for the more detailed info. It’s worth a shot!

GadgetWizard22 -
Answered By ScriptMaster On

To be honest, Apple doesn't want websites to accurately distinguish between their devices. They’re working against that kind of tracking, so outside of screen resolution, your options are pretty limited. Checking for quirks or bugs in Safari might be one of the better paths to take!

CuriousCat19 -
DataDive33 -
Answered By User1618 On

Sometimes, feature detection is just not feasible! I’ve faced crashes in Safari when attempting to access certain APIs that seemed supported. That’s a real headache for developers!

TechieTina -
CommenterX -
Answered By AdGuru75 On

Imagine the day when we have an API that provides actual device information. That would open up so many possibilities for advertisers to refine their targeting based on device types and possibly income levels too!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.