yamill / react-native-orientation

Listen to device orientation changes in react-native and set preferred orientation on screen to screen basis.
https://www.npmjs.com/package/react-native-orientation
ISC License
1.72k stars 809 forks source link

Android: onHostResume does not take into account the new orientation #294

Open SudoPlz opened 6 years ago

SudoPlz commented 6 years ago

Issue:

If we minimise the app, change orientation and re-launch it, no orientationDidChange events will be dispatched

Steps to reproduce:

Step 1: Launch the app in portrait Step 2: Tap the home button Step 3: Change orientation to landscape Step 4: Launch the app again

No orientationDidChange events ever take place because the BroadcastReceiver is being unregistered onHostPause

Environment:

"react-native-orientation": "3.1.3", OS: Android 8.1.0 Device: Google Pixel 2 XL

SudoPlz commented 6 years ago

Pushed a fix. Hopefully that will get merged.

retyui commented 5 years ago

This repo dead , use the fork https://github.com/wonday/react-native-orientation-locker