react-native icon indicating copy to clipboard operation
react-native copied to clipboard

AppState change doesn't fire on launch on iOS

Open gabrieldonadel opened this issue 4 years ago • 9 comments

Description

AppState's change event is not getting fired on the first launch on iOS but it is on Android.

React Native version:

System:
    OS: macOS 11.5.1
    CPU: (8) arm64 Apple M1
    Memory: 115.61 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.5.0 - /opt/homebrew/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 7.19.1 - /opt/homebrew/bin/npm
    Watchman: 2021.06.07.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
  Languages:
    Java: 13.0.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.2 => 0.64.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Open the app on Android and see the event being fired
  2. Open the app on iOS and see the event not being fired

Expected Results

  • Both OS behaving the same way

Snack, code example, screenshot, or link to a repository:

AppState.addEventListener('change', newState => {
  console.log('new state', newState);
});

gabrieldonadel avatar Aug 03 '21 22:08 gabrieldonadel

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 05 '22 02:04 github-actions[bot]

Is anyone else facing this problem?

gabrieldonadel avatar Apr 05 '22 20:04 gabrieldonadel

I see the same issue in React-Native 65. In addition, the transition from background => active does not get triggered for iOS

lfalkner avatar May 20 '22 16:05 lfalkner

i also face this issue

camboYY avatar Jul 16 '22 09:07 camboYY

@gabrieldonadel i have same issue

camboYY avatar Sep 21 '22 14:09 camboYY

Facing the same issue :(

filipemenezes avatar Aug 29 '23 22:08 filipemenezes

I have the some problem.In Android,when I first launched the app,AppState.addEventListener('change', newState => { console.log('new state', newState); }); these codes executed,but In IOS,these codes somtimes executed,but sometimes not executed,Is anyone have the same problem?

Ellenyyyy avatar Oct 24 '23 13:10 Ellenyyyy

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 22 '24 05:04 github-actions[bot]

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 22 '24 05:04 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Apr 29 '24 05:04 github-actions[bot]

i have same problem

kriit24 avatar Jun 03 '24 08:06 kriit24