react-device-detect
react-device-detect copied to clipboard
isIOS13Check results in false positives
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.
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.
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>}
</>
);
}
isIOS13 returns true for iOS 15.2 on iPhone 12 simulator
~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:
