A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto
npm install @i14/react-native-exact-notification$ npm install @i14/react-native-exact-notification --save
#### iOS
Refer to this docs: https://v5.rnfirebase.io/docs/v5.x.x/notifications/ios
#### Android
Install the RNFirebase Notifications package
Add the RNFirebaseNotificationsPackage to your android/app/src/main/java/com/[app name]/MainApplication.java:
``
import com.facebook.react.ReactApplication;
import com.reactlibrary.notifications.RNFirebaseNotificationsPackage;
public class MainApplication extends Application implements ReactApplication {
// ...
@Override
protected List
@SuppressWarnings("UnnecessaryLocalVariable")
List
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new RNFirebaseNotificationsPackage()); // <-- Add this line
return packages;
}
};
// ...
}
`
Add the following to android/app/src/main/AndroidManifest.xml:
Add permissions:
``
Set app launch mode inside activity props:
``
android:launchMode="singleTop"
>
Default icon and color (Optional)
Within the application component, add metadata elements to set a default notification icon and color. Android uses these values whenever incoming messages do not explicitly set icon or color.
``
android:resource="@drawable/ic_stat_ic_notification" />
android:resource="@color/colorAccent" />
Notification channels
From Android 8.0 (API level 26) and higher, notification channels are supported and recommended. FCM provides a default notification channel with basic settings. If you prefer to create and use your own default channel, set default_notification_channel_id to the ID of your notification channel object as shown; FCM will use this value whenever incoming messages do not explicitly set a notification channel.
``
android:value="@string/default_notification_channel_id"/>
Scheduled Notifications
You need to add the following to the application component of android/app/src/main/AndroidManifest.xml:
```