0

I tried to use AppState from react-native with the blur listener but nothing is showing up. I did the same exact code https://reactnative.dev/docs/appstate but the blur listener is not working. I just want to know when the notification drawer (https://developer.android.com/guide/topics/ui/notifiers/notifications#bar-and-drawer) appear on my application screen

  export default class AppStateExample extends Component {
  state = {
    appState: AppState.currentState
  };

  componentDidMount() {
    AppState.addEventListener("blur", this._handleAppStateChange);
  }

  componentWillUnmount() {
    AppState.removeEventListener("blur", this._handleAppStateChange);
  }

  _handleAppStateChange = nextAppState => {
   console.log("test")
  };
}

Thank s for help !

  • I think this [answer](https://stackoverflow.com/questions/61370290/how-to-replicate-ondidblur-or-onwillblur-with-react-navigation-5/61374144#61374144) can help you. – CevaComic May 13 '20 at 21:32
  • Already saw that post, but it s not what i m looking for. Thank's man – Draowin May 13 '20 at 22:39

0 Answers0