Skip to content

The BootTheme is not dismissed when the application is launched via a notification. #736

@marjen0

Description

@marjen0

Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

I am encountering an issue on Android using react-native-bootsplash. When the app is in the background and I tap a notification to open it, the app launches but displays the BootTheme (splash screen) again.

The critical issue is that occasionally the app never transitions away from the BootTheme, leaving it displayed over the UI indefinitely. When this "stuck" state occurs:

  • BootSplash.isVisible() returns false.
  • Calling BootSplash.hide() has no effect.

Library version

6.3.11

Environment info

System:
  OS: macOS 15.3.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 92.80 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: /private/var/folders/c6/48042cb151s24_4k0jgbjsxc0000gp/T/xfs-c2a99bc9/node
  Yarn:
    version: 3.6.4
    path: /private/var/folders/c6/48042cb151s24_4k0jgbjsxc0000gp/T/xfs-c2a99bc9/yarn
  npm:
    version: 10.1.0
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman:
    version: 2025.05.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.2 AI-252.27397.103.2523.14454243
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.1.1
    wanted: 19.1.1
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.80.2
    wanted: 0.80.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

  1. Install dependencies
    "react-native": "0.80.2",
    "react-native-bootsplash": "^6.3.11",
    "@notifee/react-native": "9.1.8"
  2. Set up bootsplash, firebase messaging and notifee
  3. Put app to background
  4. Send push notification
  5. Press on received notification
  6. BootTheme appears. Sometimes it disappears and sometimes it stays on forever.

I am experiencing this behaviour only on android, since i don't use notifee in iOS app.

Reproducible sample code

Library versions:

"react-native": "0.80.2",
"react-native-bootsplash": "^6.3.11",
"@notifee/react-native": "9.1.8"

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission
        android:name="android.permission.READ_EXTERNAL_STORAGE"
        android:maxSdkVersion="32" />
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="32" />
    <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC" />
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />

    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:mimeType="*/*" />
        </intent>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="https" />
        </intent>

        <intent>
            <action android:name="android.support.customtabs.action.CustomTabsService" />
        </intent>
    </queries>

    <application
        android:name=".MainApplication"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:installLocation="internalOnly"
        android:label="@string/app_name"
        android:networkSecurityConfig="@xml/network_security_config"
        android:requestLegacyExternalStorage="true"
        android:resizeableActivity="false"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true"
        tools:replace="android:allowBackup">
        <meta-data
            android:name="asset_statements"
            android:resource="@string/asset_statements" />


        <activity
            android:name=".presentation.base.MainActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
            android:exported="true"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@style/BootTheme"
            android:windowSoftInputMode="adjustResize">
          

        </activity>
        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths" />
        <provider
            android:name="com.vinzscam.reactnativefileviewer.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_viewer_provider_paths" />
        </provider>
        <meta-data
            android:name="google_analytics_adid_collection_enabled"
            android:value="false"
            tools:replace="android:value" />
        <service
            android:name=".presentation.push.PushMeFirebaseMessagingService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
    </application>
</manifest>

PushMeFirebaseMessagingService.kt

import android.content.Intent
import com.example.restapi.util.Logger
import com.google.firebase.messaging.FirebaseMessagingService
import java.util.concurrent.atomic.AtomicInteger

class PushMeFirebaseMessagingService : FirebaseMessagingService() {
    override fun handleIntent(intent: Intent) {
        // this skips showing notification, so we can handle it on RN side using notifee
        Logger.log("Running handleIntent().")
    }

    override fun onNewToken(token: String) {
        Logger.log("New token received in PushMeFirebaseMessagingService.kt in onNewToken function. Handling of new token will be skipped as it should be handled in RN")
    }

    object NotificationID {
        private val c: AtomicInteger = AtomicInteger(0)
        val id: Int
            get() = c.incrementAndGet()

        fun getLastId() = c.get()
    }

}

MainActivity.kt

iimport android.os.Bundle
import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate
import com.zoontek.rnbootsplash.RNBootSplash;

class MainActivity : ReactActivity() {

  /**
   * Returns the name of the main component registered from JavaScript. This is used to schedule
   * rendering of the component.
   */
  override fun getMainComponentName(): String = "MyApp"

  /**
   * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
   * which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
   */
  override fun createReactActivityDelegate(): ReactActivityDelegate =
          DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
    
  // Needed for react-native-screens
  override fun onCreate(savedInstanceState: Bundle?) {
    RNBootSplash.init(this, R.style.BootTheme) // ⬅️ initialize the splash screen
    super.onCreate(null)
  }
}

Code to display notification:

notifee.displayNotification({
	title: notificationTitle,
        body: notificationBody,
	android: {
		channelId,
		importance: AndroidImportance.HIGH,
		pressAction: {
			id: "default",
			launchActivity: "default",
		},
		smallIcon: "ic_notifications_small_icon",
		largeIcon: "ic_launcher_large_icon",
		color: colors.primary,
		showTimestamp: true,
		style: {
			type: AndroidStyle.BIGTEXT,
			text: notificationBody || "",
		},
	},
}),

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions