rguerreiro / device

Device type detection library based on the useragent string. Refactored from my express-device repo.
MIT License
79 stars 27 forks source link

Return desktop for Ipad Simulator from XCode #36

Open EdmondWang opened 4 years ago

EdmondWang commented 4 years ago

Target Device:

XCode Simulator: IOS 13.3 - Ipad (7th generation) IOS 13.3 - Ipad Pro (11 -inch)

Code Snippet:

const express = require('express');
const router = express.Router();

router.get('/', function(req, res, next) {

  const ua = req.headers['user-agent'];
  const theDevice = device.useragent_is(ua);
  console.log(theDevice.type);

  res.render('index', { title: 'Express' });
});

Actual Result

desktop

Expected Result

tablet

rguerreiro commented 3 years ago

It seems that the useragent string is the same for iPadOS and Mac OS, so there's no way to check which is which by using the useragent alone.

Please see here: https://developer.apple.com/forums/thread/119186

I'll keep the issue open until there's a solution just that we don't forget it