Search code examples
javascriptuser-agentsamsung-mobile

Detect if Browser is Samsung Phone


Has anyone figured out a good way to detect if the client's browser is a Samsung phone. I'm specifically looking for Samsung S3 And Note 2, but if it catches S2 and Note 1 or other Samsung phones I can live with that. Something that is future proof (i.e. likely to work with S4 / Note3 is obviously ideal).

There seems to be no straight-forward way to do this like there is with iPhones, but with the large S3 and Note2 user base we would like to customize for those devices.

I'm aware that not all S3's have the same user agent (http://stackoverflow.com/questions/11282944/what-is-the-samsung-s3-user-agent)

And if someone has set there phone to PC version then I don't expect to catch these (http://stackoverflow.com/questions/11597940/android-phone-browser-detection)

I realize this is likely a problem with no good solution.


Solution

  • It's obviously very hard to detect only a Samsung phone, but if you check here, and check back to the User Agent question in your question here, you'd notice that the User Agent depends on the phone model.

    Limiting to just the GS3, there are plenty of model numbers, such as GT-I9300[T], SHV-E210K/L/S, SGH-T999[v], SGH-I747[m], SGH-N064 (SC-06D), SCH-R530, SCH-I535, SPH-L710, GT-I9305[T], GT-I9308

    I'm not a web developer, I'm not sure how you would go about detecting that certain part of the User Agent, but if you can adapt your code for every model of the GS3, I'm assuming that would work well. Same goes with the model numbers of the Note 2, and when they come out, the GS4/Note 3.