device
device copied to clipboard
Return desktop for Ipad Simulator from XCode
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
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