react-device-detect icon indicating copy to clipboard operation
react-device-detect copied to clipboard

isIOS13Check results in false positives

Open ZedLove opened this issue 4 years ago • 2 comments

Testing isIOS13 in iOS Simulator using an iPhone running iOS 12 returns true. Please see the screenshot attached.

For some reason, isIOS13Check does not appear to take into account the version number as reported by other utilities such as fullBrowserVersion and getUA.

Screenshot 2020-08-25 at 6 32 01 PM

ZedLove avatar Aug 25 '20 22:08 ZedLove

Noticed the first screenshot did not properly include the value of isIOS13, so I'm including another screenshot illustrating iOS Simulators on iOS 11, 12 and 13 all reporting isIOS13 === true.

Screenshot 2020-08-31 at 9 51 17 AM

The screenshots are rendering a page generated in part from the following snippet:

import React, { ReactElement } from 'react';
import { isIOS13, getUA, fullBrowserVersion, osVersion, browserVersion,  isMacOs } from 'react-device-detect';

export default function App(): ReactElement {

  return (
    <>
      <ul>
        <li>isIOS13: {String(isIOS13)}</li>
        <li>getUA: {getUA}</li>
        <li>fullBrowserVersion: {fullBrowserVersion}</li>
        <li>osVersion: {osVersion}</li>
        <li>browserVersion: {browserVersion}</li>
        <li>isMacOs: {String(isMacOs)}</li>
      </ul>
      {isIOS13 ? <p>shown if isIOS13 is true</p> : <p>NOT iOS13</p>}
    </>
  );
}

ZedLove avatar Aug 31 '20 13:08 ZedLove

isIOS13 returns true for iOS 15.2 on iPhone 12 simulator

Screen Shot 2022-01-26 at 1 13 23 PM

~Since this is still broken over a year later, I'd assume the best solution (until it is fixed) would be to check the actual osName & osVersion and not use isIOS13~


update: I should have known it is never safe to assume.

My results running a simulator with iPad 7 on iOS 13.7 returned unexpected results: Screen Shot 2022-01-26 at 1 27 15 PM

chranderson avatar Jan 26 '22 20:01 chranderson