Skip to content

ScreenOrientation orientation change event does not fire on iPads #5693

@mymattcarroll

Description

@mymattcarroll

🐛 Bug Report

Environment

  Expo CLI 3.0.10 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 5.5.1 - /usr/local/bin/zsh
    Binaries:
      Node: 10.15.3 - /usr/local/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 6.11.3 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.3/10G8 - /usr/bin/xcodebuild
    npmPackages:
      expo: 34.0.4 => 34.0.4 
      react: 16.8.6 => 16.8.6 
      react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8 
      react-navigation: 3.11.1 => 3.11.1 

Targeting iOS and Android as standalone apps

I can replicate this problem in the Expo Client and a standalone app for the following iPads:

  • iPad 5th Generation - iOS 12.4.1
  • iPad 5th Generation - iOS 13.1.0
  • iPad Air 2 - iOS 11.0

This problem does NOT occur on the following devices (this is all I have access to, I expect there are other devices it works fine on):

  • iPhone 5 - iOS 10.3.4
  • iPhone 6s - iOS 12.3.1
  • iPhone Xr - iOS 12.4.1
  • HTC Desire 530 - Android 6.0.1
  • Samsang Galaxy Tab S2 - Android 7.0.0
  • Samsang Galaxy A5 (2017) - Android 8.0.0
  • Samsang Galaxy S8 - Android 9.0.0
  • Nokia 6.1 - Android 9.0.0

Steps to Reproduce

  1. Create template expo app
npm i -g expo-cli@3.0.10
expo init (picking the blank template)
// App.js
import * as React from 'react';
import { Alert, Text, View } from 'react-native';
import { ScreenOrientation } from 'expo';

export default function App() {
  React.useEffect(() => {
    const subscription = ScreenOrientation.addOrientationChangeListener(() => {
      Alert.alert('ScreenOrientation change event');
    });
    return () => {
      ScreenOrientation.removeOrientationChangeListeners(subscription);
    };
  }, []);
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Text>Change orientation to see alert</Text>
    </View>
  );
}
  1. Turn device to landscape orientation

Expected Behavior

Alert should display

Actual Behavior

No alert displays

Reproducible Demo

https://snack.expo.io/@oneblinkdevelopers/screen-orientation-alert

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions