Javatpoint Logo
Javatpoint Logo

Firebase In-App Messaging Setup and Configuration

In this, we will learn how we can use Firebase In-App Messaging in an android application. For this, we need an android application. Just like other services of Firebase, the starting steps to use In-App Messaging are the same. So let's start with the starting steps and elaborate each step to set up and configure the application to use In-App Messaging in Firebase.

Step 1:

In the first step, we will create a new Android Studio project with an empty activity and Kotlin language and name it InAppMessaging.

Firebase In-App Messaging Setup and Configuration

Step 2:

In the next step, we will connect our Android Application with the Firebase either from Firebase Assistant or manually using the console. After that, we will add all the required libraries and plugin to our app.gradle file. And we will also add maven in our repository and all projects.

Firebase In-App Messaging Setup and Configuration

Step 3:

We will update our app.gradle file. We will add the plugin to the google-services. We will add the dependency of Firebase core and In-App Messaging.

Firebase In-App Messaging Setup and Configuration

Firebase In-App Messaging Setup and Configuration

Step 4:

Now, we will check Logcat and search for the Instance ID and copy it from here.

Firebase In-App Messaging Setup and Configuration

Step 5:

Now, go to Firebase console and select In-App Messaging from Firebase-> Grow-> In-App Messaging. After that, click on Create your first campaign.

Firebase In-App Messaging Setup and Configuration

Firebase In-App Messaging Setup and Configuration

Step 6:

After clicking on create your first campaign, the following console will be shown

Firebase In-App Messaging Setup and Configuration

We can figure out how we can send a message to the client. There is all sort of different nice styles which we can apply to our messages. It will ask to fill out the message title, the body that is optional, image, and primary button color.

Firebase In-App Messaging Setup and Configuration

Step 7:

After filling out all the required fields, we will click on Test on the device and paste the Instance ID, which we have previously copied from the Logcat. Add the device and click on the Test.

Firebase In-App Messaging Setup and Configuration

Firebase In-App Messaging Setup and Configuration

Firebase In-App Messaging Setup and Configuration

Firebase In-App Messaging Setup and Configuration

After clicking on the Test, we will reopen our app from the background, and we can see our message there.

Firebase In-App Messaging Setup and Configuration






Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA