We have seen the implementation of Firebase In-App Messaging in Android. In that article, we have implemented the Card Message Layout. In this article, we will take a look at the implementation of the Top banner Message Layout. A sample image is given below to get an idea about how Top banner Message Layout looks like.
Step by Step Implementation
Step 1: Creation of our app
In the previous article (How to Push Notification in Android using Firebase In-App Messaging?) We have already created our first part. We have to use a similar app. We don’t have to make any changes to that app. Check out the first part to take a look at the implementation of Firebase In-App Messaging in that app.
Step 2: Navigate to Firebase Console and Navigate to In-App Messaging
Browse Firebase Console inside your browser and click on the In-App Messaging tab on the left pane and you will get to see the below screen.
After clicking on Create your first campaign it will ask for integration of Firebase Analytics select your analytics account and proceed further. After specifying your Google Account for analytics you will get to see the below screen to design your notification which we want to display. We have seen the Card, Modal, and Image only types of notification in our previous article. In this article, we will take a look at the implementation of the Top Banner Notification type of notification in our app.
Step 3: Implementing Top banner Message Layout
Now in the above image, you will get to see different usages of the fields as we scroll down we will get to see the below screen.
Inside the above screen, we have to add campaign name and description to our campaign we can specify any name and description to our campaign, and now we have to select the app to which we have to send the notification. After selecting your app click on the Next option to proceed further. After clicking on the next option you will get to see the below screen.
Inside this screen, we have to schedule our notifications when we have to send our notifications to our users. Inside this, we can modify our time and schedule our notification. After scheduling our notification click on the Review option and you will get to see a pop-up option. Inside this option click on Publish option to publish your notification. Make sure to add your device installation ID for sending your notification. After sending this notification it will take some time to display inside your app. Make sure to close and reopen your app to display your notification. You will get to see the notification in your Android app.