I'm encountering issues with FCM push notifications in my React Native app specifically on Android 11 devices. Notifications work as expected on Android 13, but on Android 11, they only appear when the app is in the foreground or background, not when it's in the quit state.
Here's what I've already tried:
Followed Firebase's official React Native FCM integration guide. Verified notification payload format and structure, including high-priority elements. Double-checked AndroidManifest.xml for necessary permissions and services.
Additional Information:
Firebase SDK version: 18.5.0 React Native version: 0.72.1
How can I ensure FCM push notifications are delivered and displayed even when the app is in the quit state on Android 11 devices?
Android Manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<data
android:scheme="com.locom"
android:host="oauthredirect" />
</intent-filter>
</activity>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="false"/>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_fcm_notification" />
</application>
</manifest>
There is some problem with your AndroidManifest.xml file. Use
If it still does not work. You can simply copy paste this
Here android:exported is set to false for all activities. Also you are missing Actions and publisher tags for reciever