Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
How to get specific mobile device model on webapps using reactjs?

I want to get the model name of mobile device like iphone 7, iphone 8 or iphone 12 when my web app runs on mobile but I only get iphone and not the specific device model. I m currently using react-device-detect.

Is there any way to achieve this? I don't want to use any paid service.

Any help will be appreciated. Thanks.

code:

    import {deviceDetect,mobileModel} from "react-device-detect"

    ....

    useEffect(() => {
     console.log("devicedata deviceDetect", deviceDetect()) // gives object shown in image below
     console.log("devicedata browserName", mobileModel) // gives "iphone"
    },[])

output: ImageOutput

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can read the user agent api data and do some regular expression to extract the useful information

const userAgent= navigator.userAgent
const device = {
  iPad: /iPad/.test(userAgent),
  iPhone: /iPhone/.test(userAgent),
  Android5: /Android 5/.test(uauserAgent,
 Android4: /Android 4/.test(uauserAgent
}

Read more about detecting information Detect Device - Broswer

MDN User Agent

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!