Home > Software design >  React Native: How to detect phone with dynamic island?
React Native: How to detect phone with dynamic island?

Time:12-04

Is it possible to target phones (iPhone 14 Pro and iPhone 14 Pro Max) with dynamic islands with React Native?

CodePudding user response:

The npm package react-native-dynamic-island might be what you are looking for. It's also available on GitHub so you can take a look at the implementation.

CodePudding user response:

Just to complement the other answer it is also possible to use react-native-device-info

  const iPhonesWithDynamicIsland = ['iPhone15,2', 'iPhone15,3']; // iPhone 14 Pro, iPhone 14 Pro Max
  const isIphoneWithDynamicIsland = iPhonesWithDynamicIsland.includes(DeviceInfo.getDeviceId());
  console.log(isIphoneWithDynamicIsland);
  • Related