Firebase In-App Messaging

Updated 28 May 2019

Save

Firebase In-App Messaging helps you engage your app’s active users by sending them targeted, contextual messages. Through which you can 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 customise messages as banners, modals, or images.You can design you message view on firebase console. There is no need to create message layout in application.

There is also clickable button option which can navigate user on another web-link also.

Steps

If you haven’t configured your project on firebase console, then add Firebase to your Android project.

After configuring,  download google-services.json to obtain your Firebase Android config file and add in project.

  1. In your root-level (project-level) Gradle file (build.gradle), add rules to include the Google Services plugin. Check that you have Google’s Maven repository, as well.

2. In your module (app-level) Gradle file (usually app/build.gradle), add a line to the bottom of the file.

3. Add dependency

Send a test message

To conserve power, Firebase In-App Messaging only retrieves messages from the server once per day. That can make testing difficult. So the Firebase console allows you to specify a test device. Test device displays messages on demand.

That testing device is determined by a FirebaseInstanceId. Find your testing app’s Instance ID by checking the Logcat in Android Studio for the following Info level log:

Send a message to your testing device

I wanna send my new application link to all the users who are using my current application.

Also, I want to share downloading link with them.

In the Firebase console, open In-App Messaging. and click on New Campaign.

Fill all the details and click on publish button. For reference please check attached images.

After clicking on publish button, whenever your application comes in foreground state, a dialog will open.

An idea of demo can be seen in video below.

 

Hope, this blog is helpful for you to integrate Firebase-In-App-Messaging in your android application.

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home