Discover Firebase In-App messaging

Tram Ho

Source: https://medium.com/coding-blocks/exploring-firebase-in-app-messaging-e3cbcf3d6895

A great day, a great team behind Firebase announced that In-App-Messaging for Android and IOS users

In this Beta version, this new service allows you to display Alert Dialogs on a User’s device while they are using your App to give interaction or as a guide to perform an action in the App. For example, you can send In-App Messaging to users to register, watch videos, complete a level or buy an item.

You can see Firebase’s introduction: https://www.youtube.com/watch?v=5MRKpvKV2pg

Let’s try to explore it, They create a simple message to display a notice to the User to see about a match.

After completing each step And executing In-App messaging in the App, then the Message should look like this: https://firebase.google.com/docs/android/setup

Step 1: Connect to your App

This is a simple step to set firebase into your project. You can refer to the instructions here

Step 2: Integrate the SDK

In-App messaging requires you to add dependency to your App:

Create MyClickListenerBundles.class

In MainActivity :

In AndroidManifest.xml

Step 3: Create the first message

Sending and receiving messages does not require any code setup.

We can send and receive messages directly on the device from Firebase Console.

You can create campaigns and within each campaign, there are 4 different types of In-App messages, we can create Card, Modal, Image and Top Banner.

Step 3.1: Create a Card message

The card is similar to AlertDialog and it has the following properties:

Background : Used to define the background for the dialog

Text Color : Specify the text color in the dialog

Title : Text displays the Title dialog box

Body (Optional): is the message as the body of Dialog

Image URL (Optional): Image URL if you want to display the image

Button Text (Optional): Text for button if you want the button

Button Action : URL to navigate when the user clicks the button

Step 3.2: Select Target for your message

You can select the Target user to whom the Message is sent. If you use Push Message, it’s quite similar:

Campaign Name : Does not appear for users, and is used to mark your campaigns

Campaign Description (Optional): Briefly describes the campaign and does not appear to users

Target app and other conditions : Define the condition that all users see the message

Step 3.3: Scheduling the message

In this section, you can adjust the start date and end date for your campaign, with the number of notifications displayed:

Start time : The campaign start time is by default “Now”.

End time : Time to end the campaign

Trigger : Activate the displayed message. This has some default fields like app_exception, app_clear_data, first_open, app_start and you can add some custom triggers using Firebase Anlytics.

Frequency Limit : Frequency messages appear in a day. By default, only 1 message per day

Step 3.4: Conversion eventsConversion events

This is an optional case. You can trigger this transition based on the event selection you choose. Which you can track it later in your analysis.

You can output the event and you can see the messages on the user device.

To create different types of messages (Image or Top Banner), you can choose other types in step 3.1: Create a Modal message

You can create other campaigns that will show you lists like this:

You can see how many people view the message or how many people click on the message as shown below:

Step 4: Test

You can test with specific device with the following id in Android studio Log as follows:

Remember to get the ID, then assign it to the test section of In App Message and open the test as follows:

After :

The remaining is that you wait for the message to return

Step 5: Achievements

This article helps you perform the basic steps of In App Message. Hope this post will help you a bit. If anything is wrong. You can comment on the side to help me improve.

Document :

https://medium.com/coding-blocks/exploring-firebase-in-app-messaging-e3cbcf3d6895

https://firebase.google.com/docs/in-app-messaging/get-started

Link Github: https://github.com/haiminhtran810/InAppMessageDemo

Share the news now

Source : Viblo