podigee/device_detector

Getting brand name for mobiles

Closed this issue · 1 comments

How to detect brand name for mobile? There has a device_name field but mostly it shows only the device model and can't detect phone brands such as Samsung, Mi etc...

Hi thetnswe, to get the brand name you can simply do this:

user_agent = 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.17 Safari/537.36'
client = DeviceDetector.new(user_agent)
client.device_brand

Make sure you are using the v1.1.1 or device_dectector as previous versions don't always return the correct brand.