Skip to content

[πŸ›] iOS app opens with white blank screen when click on notification from quit stateΒ #8725

@mansi-avesta-rev

Description

@mansi-avesta-rev

Issue

I have updated React native from 0.74.5 to 0.81.4, in iOS app opens with white blank screen when click on notification from quit state, foreground and background states are working fine.

const HeadlessCheck = ({ isHeadless }) => {
if (isHeadless) {
return null;
}
return <App />;
};

The code above is the index.js (root) file. If I update 'if (isHeadless) { return null }' to 'if (isHeadless) { return <App/> }', it works fine. But I don't want to open the app silently when a notification arrives.

FYI only - I am using expo specifically for OTA.


Project Files

Javascript

Click To Expand

package.json:

{
  "name": "RevMobileApp",
  "version": "6.4.1",
  "private": true,
  "scripts": {
    "lint": "eslint . --rulesdir .eslint-rules 'src/**/*.{ts,tsx,js,jsx}'",
    "lint:fix": "eslint . --rulesdir .eslint-rules --fix",
    "check-format": "npx prettier src test --check",
    "format:fix": "npm run check-format -- --write",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "pod": "cd ios && pod install && cd..",
    "start": "react-native start",
    "test": "jest",
    "test-coverage": "jest --coverage",
    "shake": "adb shell input keyevent 82",
    "adb": "adb reverse tcp:8081 tcp:8081 && adb reverse tcp:8333 tcp:8333 && adb reverse tcp:9090 tcp:9090",
    "android:dev": "expo start --dev-client & react-native run-android --mode=developmentdebug",
    "android:dev-release": "react-native run-android --variant=developmentrelease",
    "android:prod": "expo start --dev-client & react-native run-android --mode=productiondebug",
    "android:prod-release": "react-native run-android --variant=productionrelease",
    "ios:dev": "react-native run-ios --simulator=\"iPhone 16\" --scheme \"RevMobileAppUAT\"",
    "ios:sta": "react-native run-ios --simulator=\"iPhone 16\" --scheme \"RevMobileAppSTA\"",
    "ios:pro": "react-native run-ios --simulator=\"iPhone 16\" --scheme \"RevMobileApp\"",
    "ios:dev:device": "react-native run-ios --device=\"Harsh's iPhone\" --scheme \"RevMobileAppUAT\"",
    "postinstall": "patch-package",
    "removeNodeModules": "rm -rf package-lock.json node_modules ios/Pods ios/Podfile.lock ios/build",
    "prepare": "husky",
    "eas-build-pre-install": "npm config set legacy-peer-deps true"
  },
  "lint-staged": {
    "*.{ts,tsx,js,jsx}": "eslint --rulesdir .eslint-rules"
  },
  "dependencies": {
    "@d11/react-native-fast-image": "^8.12.0",
    "@gorhom/bottom-sheet": "^5.2.6",
    "@likashefqet/react-native-image-zoom": "2.1.1",
    "@mccsoft/react-native-matomo": "1.0.3",
    "@microsoft/react-native-clarity": "^4.3.3",
    "@notifee/react-native": "^9.1.8",
    "@react-native-async-storage/async-storage": "^2.2.0",
    "@react-native-clipboard/clipboard": "1.11.2",
    "@react-native-firebase/app": "^22.4.0",
    "@react-native-firebase/messaging": "^22.4.0",
    "@react-native/assets-registry": "^0.79.2",
    "@react-native/new-app-screen": "0.81.4",
    "@react-navigation/bottom-tabs": "6.5.7",
    "@react-navigation/native": "6.1.6",
    "@react-navigation/stack": "6.3.16",
    "@realestateview/avesta-js-core": "^13.0.0",
    "@realestateview/avesta-ui-core": "^15.1.0",
    "@reduxjs/toolkit": "1.9.5",
    "@rneui/base": "^4.0.0-rc.7",
    "@rneui/themed": "^4.0.0-rc.8",
    "@rnmapbox/maps": "10.1.44",
    "@tanstack/query-async-storage-persister": "5.60.5",
    "@tanstack/react-query": "5.60.5",
    "@tanstack/react-query-persist-client": "5.60.5",
    "@testing-library/jest-native": "5.4.2",
    "@testing-library/react-native": "12.0.1",
    "@turf/turf": "7.0.0-alpha.2",
    "@types/lodash": "4.14.198",
    "@types/proj4": "2.5.5",
    "async-barrier": "1.0.0",
    "await-to-js": "3.0.0",
    "axios": "^1.12.2",
    "date-and-time": "3.0.2",
    "expo": "^54.0.12",
    "expo-asset": "~12.0.9",
    "expo-constants": "~18.0.9",
    "expo-dev-client": "~6.0.13",
    "expo-font": "~14.0.8",
    "expo-updates": "~29.0.12",
    "formik": "2.4.5",
    "lodash": "4.17.21",
    "md5": "2.3.0",
    "moment": "^2.30.1",
    "moment-timezone": "^0.5.48",
    "native-base": "3.4.28",
    "number-abbreviate": "2.0.0",
    "patch-package": "8.0.0",
    "proj4": "2.11.0",
    "query-string": "8.1.0",
    "react": "19.1.0",
    "react-dom": "19.1.0",
    "react-moment": "1.1.3",
    "react-native": "^0.81.4",
    "react-native-add-calendar-event": "4.2.2",
    "react-native-base64": "0.2.1",
    "react-native-config": "1.5.1",
    "react-native-device-info": "10.6.0",
    "react-native-feather": "1.1.2",
    "react-native-gesture-handler": "~2.28.0",
    "react-native-gifted-charts": "^1.4.64",
    "react-native-image-zoom-viewer": "3.0.1",
    "react-native-inappbrowser-reborn": "3.7.0",
    "react-native-keyboard-aware-scroll-view": "0.9.5",
    "react-native-linear-gradient": "2.8.3",
    "react-native-mmkv": "^3.3.1",
    "react-native-modal": "^14.0.0-rc.1",
    "react-native-network-info": "5.2.1",
    "react-native-network-logger": "1.16.1",
    "react-native-pager-view": "^6.9.1",
    "react-native-permissions": "^5.4.2",
    "react-native-public-ip": "1.0.2",
    "react-native-reanimated": "~4.1.1",
    "react-native-redash": "18.1.3",
    "react-native-render-html": "6.3.4",
    "react-native-safe-area-context": "^5.5.2",
    "react-native-screens": "~4.16.0",
    "react-native-share": "12.0.9",
    "react-native-svg": "15.12.1",
    "react-native-svg-transformer": "^1.5.1",
    "react-native-tab-view": "^4.1.3",
    "react-native-tooltip-2": "^0.1.3",
    "react-native-vector-icons": "^10.2.0",
    "react-native-webview": "13.15.0",
    "react-native-worklets": "0.5.1",
    "react-native-youtube-iframe": "^2.3.0",
    "react-redux": "8.0.5",
    "reactotron-core-client": "^2.9.7",
    "reactotron-redux": "3.1.3",
    "yup": "1.3.3"
  },
  "devDependencies": {
    "@babel/core": "^7.25.2",
    "@babel/preset-env": "^7.25.3",
    "@babel/preset-typescript": "7.22.5",
    "@babel/runtime": "^7.25.0",
    "@react-native-community/cli": "20.0.0",
    "@react-native-community/cli-platform-android": "20.0.0",
    "@react-native-community/cli-platform-ios": "20.0.0",
    "@react-native/babel-preset": "0.81.4",
    "@react-native/eslint-config": "0.81.4",
    "@react-native/metro-config": "0.81.4",
    "@react-native/typescript-config": "0.81.4",
    "@tanstack/eslint-plugin-query": "^5.60.1",
    "@testing-library/jest-native": "5.4.2",
    "@testing-library/react-native": "12.0.1",
    "@types/jest": "^29.5.13",
    "@types/md5": "2.3.2",
    "@types/react": "^19.1.0",
    "@types/react-test-renderer": "^19.1.0",
    "@typescript-eslint/eslint-plugin": "^7.18.0",
    "@typescript-eslint/parser": "^7.18.0",
    "babel-plugin-module-resolver": "5.0.0",
    "babel-plugin-transform-remove-console": "6.9.4",
    "eslint": "^8.57.1",
    "eslint-plugin-react": "^7.37.5",
    "eslint-plugin-react-native": "^5.0.0",
    "husky": "^9.1.7",
    "jest": "^29.6.3",
    "lint-staged": "^16.1.0",
    "prettier": "2.8.8",
    "react-native-dotenv": "^3.4.11",
    "react-test-renderer": "19.1.0",
    "reactotron-react-native": "^5.1.17",
    "tslint-config-prettier": "1.18.0",
    "typescript": "~5.9.2"
  },
  "jest": {
    "coveragePathIgnorePatterns": [
      "src/components/library/rangeSlider/",
      "src/shared"
    ],
    "preset": "react-native",
    "setupFiles": [
      "./node_modules/react-native-gesture-handler/jestSetup.js",
      "./jest/setup.js"
    ],
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx"
    ],
    "transformIgnorePatterns": [
      "src/library/rangeSlider/",
      "node_modules/(?!((jest-)?@?react-native|@react-native-community|@rnmapbox/maps|@react-navigation|@react-native|react-native|decode-uri-component|filter-obj|split-on-first|query-string)|react-native-base64/)"
    ]
  },
  "expo": {
    "autolinking": {
      "exclude": ["expo-keep-awake"]
    }
  }
}

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")

def node_require(script)
  # Resolve script with node to allow for hoisting
  require Pod::Executable.execute_command('node', ['-p',
    "require.resolve(
      '#{script}',
      {paths: [process.argv[1]]},
    )", __dir__]).strip
end

$RNMapboxMapsImpl = 'mapbox'

require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}

ENV['RCT_NEW_ARCH_ENABLED'] = '1'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
# ENV['RCT_USE_RN_DEP'] = '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
# ENV['RCT_USE_PREBUILT_RNCORE'] = '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'

node_require('react-native/scripts/react_native_pods.rb')
node_require('react-native-permissions/scripts/setup.rb')

setup_permissions([
  # 'AppTrackingTransparency',
  # 'Bluetooth',
  # 'Calendars',
  # 'CalendarsWriteOnly',
  # 'Camera',
  # 'Contacts',
  # 'FaceID',
  'LocationAccuracy',
  'LocationAlways',
  'LocationWhenInUse',
  # 'MediaLibrary',
  # 'Microphone',
  # 'Motion',
  # 'Notifications',
  # 'PhotoLibrary',
  # 'PhotoLibraryAddOnly',
  # 'Reminders',
  # 'Siri',
  # 'SpeechRecognition',
  # 'StoreKit',
])

platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
prepare_react_native_project!

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end
 

target 'view.com.au' do
  use_expo_modules!
  config = use_native_modules!

  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
  pod 'Dotmetrics', :git => "https://github.com/DotMetrics/iOSDistribution.git", :tag => "1.7.7"

  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true

  if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
    config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
  else
    config_command = [
      'node',
      '--no-warnings',
      '--eval',
      'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
      'react-native-config',
      '--json',
      '--platform',
      'ios'
    ]
  end

  config = use_native_modules!(config_command)

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    :privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
  )

  target 'view.com.au-UAT' do
    inherit! :complete
    # Pods for testing
  end

  pre_install do |installer|
    $RNMapboxMaps.pre_install(installer)
    
  end

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
      end
    end
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false,
      :ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
    )
     # Fix for Swift standard libraries
     installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = '$(inherited)'
      end
    end
    $RNMapboxMaps.post_install(installer)
  end
  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
end

AppDelegate.m:

import RNFBMessaging
import UIKit
import FirebaseCore
import Expo
import React
import EXUpdates
import React_RCTAppDelegate
import ReactAppDependencyProvider
import Firebase
import Dotmetrics

@main
class AppDelegate: ExpoAppDelegate {
  var window: UIWindow?

  var reactNativeDelegate: ReactNativeDelegate?
  var reactNativeFactory: RCTReactNativeFactory?

  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
  ) -> Bool {

    if FirebaseApp.app() == nil {
      FirebaseApp.configure()
    }

    // Inject initial props from RNFB Messaging
    let initialProps = RNFBMessagingModule.addCustomProps(toUserProps: nil, withLaunchOptions: launchOptions)

    let delegate = ReactNativeDelegate()
    let factory = ExpoReactNativeFactory(delegate: delegate)
    delegate.dependencyProvider = RCTAppDependencyProvider()

    reactNativeDelegate = delegate
    reactNativeFactory = factory
    bindReactNativeFactory(factory)

    window = UIWindow(frame: UIScreen.main.bounds)

    // Initialize expo-updates before any access to AppController.sharedInstance
    AppController.initializeWithoutStarting()

    // Configure Dotmetrics based on environment and distribution channel
    if let envDict = Bundle.main.infoDictionary?["LSEnvironment"] as? [String: String],
       let _ = envDict["RELEASE_ENV"] {
      let receiptURLString = Bundle.main.appStoreReceiptURL?.path ?? ""
      let isRunningTestFlightBeta = receiptURLString.contains("sandboxReceipt")
      #if targetEnvironment(simulator)
      let isSimulator = true
      #else
      let isSimulator = false
      #endif
      if !isRunningTestFlightBeta && !isSimulator {
        if let env = RNCConfig.env(),
           let urlString = env["IOS_IPSOS_ANALYTICS_URL"] as? String,
           let configURL = URL(string: urlString) {
          DotmetricsSession.shared().configureAndStart(withConfigurationURL: configURL) { _ in
            DotmetricsSession.shared().loggingEnabled = true
          }
        }
      }
    }

    factory.startReactNative(
      withModuleName: "RevMobileApp",
      in: window,
      initialProperties: initialProps,
      launchOptions: launchOptions
    )

    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
  // πŸ”— Deep links via custom schemes
  override func application(_ app: UIApplication,
                   open url: URL,
                   options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
    return RCTLinkingManager.application(app, open: url, options: options)
  }

  // πŸ”— Universal Links
  override func application(_ application: UIApplication,
                   continue userActivity: NSUserActivity,
                   restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
    return RCTLinkingManager.application(
      application,
      continue: userActivity,
      restorationHandler: restorationHandler
    )
  }
}

class ReactNativeDelegate: ExpoReactNativeFactoryDelegate {
  override func sourceURL(for bridge: RCTBridge) -> URL? {
    // needed to return the correct URL for expo-dev-client.
    bridge.bundleURL ?? bundleURL()
  }

  override func bundleURL() -> URL? {
    #if DEBUG
      RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: ".expo/.virtual-metro-entry")
    #else
      Bundle.main.url(forResource: "main", withExtension: "jsbundle")
    #endif
  }
}


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

System:
  OS: macOS 15.5
  CPU: (8) arm64 Apple M2
  Memory: 129.45 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.19.5
    path: /Users/avesta/.nvm/versions/node/v20.19.5/bin/node
  Yarn: Not Found
  npm:
    version: 10.8.2
    path: /Users/avesta/.nvm/versions/node/v20.19.5/bin/npm
  Watchman:
    version: 2025.06.30.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/avesta/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.5
      - iOS 18.5
      - macOS 15.5
      - tvOS 18.5
      - visionOS 2.5
      - watchOS 11.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2513.14007798
  Xcode:
    version: 16.4/16F6
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.3.5
    path: /Users/avesta/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.81.4
    wanted: ^0.81.4
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • ^22.4.0
  • Firebase module(s) you're using that has the issue:
    • I think headless for iOS
  • Are you using TypeScript?
    • Y & ~5.9.2


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions