Integrate with Expo based React Native app
This article provides information on how to integrate your Expo based React Native app with Blueshift's React Native plugin.
Expo is an open-source platform that you can use to develop native apps for Android, iOS, and the web with JavaScript and React. Blueshift's React Native Plugin is created using Native Modules. Hence to integrate your Expo based React Native app, you must add some code in the native Android and iOS projects.
Prerequsite
Before you can start to integrate, you must generate the native Android and iOS projects using expo prebuild.
Android apps
- Integrate the plugin by following the steps given in the Install and set React Native plugin documentation.
- Integrate Firebase messaging for Android to enable push notifications by completing the following steps:
- Download the
google-services.json
file from the Firebase project’s Project Settings tab and place it in the path:/android/app/google-services.json
. - Add the following dependency under the project-level
build.gradle
file’s dependencies section:classpath 'com.google.gms:google-services:4.3.15'
- Add the following plugin inside the app-level
build.gradle
file:apply plugin: "com.google.gms.google-services"
- Now register the Firebase messaging service of Blueshift SDK in the AndroidManifest file.
- Download the
<service
android:name="com.blueshift.fcm.BlueshiftMessagingService"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
iOS apps
- Integrate the plugin by following the steps given in the Install and set React Native plugin documentation.
- Follow the steps in the Integrate your React Native iOS app documentation to configure and initialize the Blueshift iOS SDK in your project.
Updated over 1 year ago