device icon indicating copy to clipboard operation
device copied to clipboard

Return desktop for Ipad Simulator from XCode

Open EdmondWang opened this issue 4 years ago • 1 comments

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

EdmondWang avatar Sep 25 '20 02:09 EdmondWang

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

rguerreiro avatar Oct 26 '20 16:10 rguerreiro