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.
In the first step, we will create a new Android Studio project with an empty activity and Kotlin language and name it InAppMessaging.
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.
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.
Now, we will check Logcat and search for the Instance ID and copy it from here.
Now, go to Firebase console and select In-App Messaging from Firebase-> Grow-> In-App Messaging. After that, click on Create your first campaign.
After clicking on create your first campaign, the following console will be shown
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.
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.
After clicking on the Test, we will reopen our app from the background, and we can see our message there.