Implementation of Firebase In-App Messaging in Android development
Firebase In-App Messaging helps you engage your app’s active users by sending them targeted, contextual messages that encourage them to use key app features. For example, you could send an in-app message to get users to subscribe, watch a video, complete a level, or buy an item. You can customize messages as cards, banners, modals, or images, and set up triggers so that they appear exactly when they’d benefit your users most.
In this article, you will learn how to create an In-App Updater using a card that will notify your users to update their app and give them a button or text to click using Firebase In App Messaging in android development.
In-App messaging is a dream come true, do you know why? If you want to implement it on your own, you will have to write lots of code to achieve it, but you don't have to even write a single code 🥳🤯😳 to make it work using In-App Messaging.
Examples of In App messaging format(Card, Image)
In this section, you will see how your messages are been shown to the users in a Card,banner,modal or image form below
This display your message using a card that can contain an image, a text and a button too another fun part about it is that the button can trigger an action or just close the card.
This will display your message in a modal form having an “X” button to close the modal after reading the message, it can contain an image, a text and the x button to close it.
Image Only Layout
This will just display the message using an image, it can contain an image and also have an x button that will enable the users to close it.
Top Banner Layout
This will display the message at the top of the Android device, it can contain an image, a text? to close it just click any where on the screen it will close.
You can choose any of the layouts above that fits your app feature that you want the users to engage with. they are very easy to configure and within minutes you are done setting it up, good point to note is that you wont write any line of code 🥳.
Step by step guide to setup Firebase In-App Message
Step 1: Connect Android project to Firebase
Click on “Firebase” in the list and the below image will showup
To connect your Android project to firebase in Android studio check this link: https://wise4rmgodadmob.medium.com/how-to-connect-your-android-studio-project-to-firebase-a5f5c4d67e87
Step 2: Add Firebase In-App Messaging dependency
click on the “Add Firebase In-App Messaging to you app” button to add the dependency to your project as seen in the image below
Step 3: Create a campaigne in firebase console
At this point, you will decide which of the layout will fit what you want to display to the users, for this article we want the users to click a button that will take them to a playstore where they will update the app. So, you will have to choose the “Card Layout” because with it you can add a button/Text with an action.
Its time to modify the fields to suit your taste, you will have to add a “message title” , the “body message”, add an “Image” if you want to and also add the button with or without an action. you should notice that the phone image beside changes as you modify the fields.
Click the “Next” button that will take you to the next screen
In this section, you will give your campaigne a name, a description and select the device you want to receive this campaigne and fill other fields too then click the “Next” button.
In this section, you decide if you want the device to receive the campaigne immediately or schedule a date for that, secondly you will choose the event you want to take place before showing the campaigne and lastly, select per device frequency and click the “Next” button or click the Review button because the two other sections are optional.
In this section, you will “select conversion event” and click on the “Next” button.
In this section, add a custom data key and value or leave it blank(this section is optional) then click “Review”
In this section, you can go over and modify them or proceed to click the publish button if everything looks okay and good.
Then head over to your device, restart it and you will see the result 😍
Viola you have it live on your device, at this point you can click on the Update button and it will take you to google play store to update the app.
With Firebase In-App Messaging, you don't need coding to set it up and have it running on your app live.
Thank you for reading my article.
Let’s connect on