0

I'm trying to create a signature for web-to-mobile user-attribution purposes.

I'm on an iPhone 14 Pro and I'm trying to look at screen resolution as a criteria, but the reported values seem to differ across browser (Safari) and React Native.

I'm doing the following on web:

alert(`${window.outerWidth}x${window.outerHeight}x${window.devicePixelRatio}`)

Which produces the following:

enter image description here

And this React Native code:

import { Dimensions  } from 'react-native'

const { width, height, scale } = Dimensions.get('window') // same with `get('screen')`
Alert.alert(`${width}x${height}x${scale}`)

Which produces the following:

enter image description here

Why is there this difference here? Which one is the true screen resolution and how can I get the two to match? Thanks.

EDIT: This issue is not iOS-specific apparently. It spans across OS/Vendors.

Android (Samsung): enter image description here

Android (Huawei): enter image description here

iuliu.net
  • 6,666
  • 6
  • 46
  • 69

0 Answers0