react-native-safe-area-context icon indicating copy to clipboard operation
react-native-safe-area-context copied to clipboard

Android: Clicking on a push notification from a force closed app causes initialWindowMetrics.insets.bottom to be -48

Open kyle-ssg opened this issue 4 years ago • 4 comments

I have found that when using this module for insets, clicking a push notification whilst the app is terminated causes incorrect calculations for insets

Opening terminated app: insets.bottom = 0

Opening terminated app via clicking push notification: insets.bottom = -48

This seems to happen on every Android device.

kyle-ssg avatar Jul 15 '21 13:07 kyle-ssg

After testing further it seems the issue does not happen so long as initialWindowMetrics.frame is evaluated, which makes no sense to me.

Environment info, I can only replicate this with a bundled APK, in debug mode this seems to work correctly.

    OS: macOS 11.2.2
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor             
    Memory: 9.48 GB / 64.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
    Yarn: Not Found
    npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm
    Watchman: 2021.06.07.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    Android SDK:
      API Levels: 23, 28, 29, 30
      Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0
      System Images: android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7199119
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_281 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.1 => 0.64.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

kyle-ssg avatar Jul 15 '21 13:07 kyle-ssg

Same issue, clicking a push notification causes incorrect calculations for insets

BilalYazbek avatar Jul 15 '21 14:07 BilalYazbek

Is there any solution for issue? We are also facing this problem.

yasir-systemplus avatar Jan 24 '22 10:01 yasir-systemplus

Can someone try this in v4? If you’re still able to reproduce, could you make a minimal repo so we can understand the issue?

jacobp100 avatar Mar 16 '22 22:03 jacobp100

Re-open if this is still an issue

jacobp100 avatar Jan 19 '23 16:01 jacobp100