firebase in app messa1ging Integration Android Project without any code
firebase in app messa1ging Integration Android Project without any code

Hi Guys, Welcome to Proto Coders Point in this post we are going to Implement Firebase In-app Messaging services.

What is Firebase In-app Messaging Service?

Firebase In-App Messaging is a service that helps you to engage your apps active users i.e by sending In-app messages to your targeted users.

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.

So, Now Let’s Start Implementing Firebase In-App Messaging in android Studio

Follow Video Tutorial

Follow the Steps to Integrate Firebase Messaging Services

Step 1: Create a new Project

Create a new android Project
Create a new android Project

Open your android studio and Create a new Project.

if you already have Project and want to integrate Firebase In-App Messaging then jump to Step no 3.

Give name to the android project
Give name to the android project

Then, Click on Finish, your new Android Project will get created, and BUILD the ProjectΒ  SUCCESSFULΒ  any take some time depending on you system speed.

Step 2 : Sign-In with Gmail account in android-studio

Then, Navigate towords top right corner of android studio window, you will see a small login profile icon.

how to sign in google account in android studio
how to sign in google account in android studio

Android Studio wants to access your google account.

Allow the Access permission from android studio to get sign-in.

google sign-in android studio
google sign-in android studio

Now, you are done with sign-in process.

Step 3 : Connecting Firebase to your android Project with In-App Messaging

Then, you need to Connect Firebase into your android project

So, Go to the toolbar on the top of android studio window

ToolBar > Tools > Firebase

you will now get this Window opened by android studio Assistant

adding firebase to android studio project
adding firebase to android studio project

Connect to Firebase

connect to firebase
connect to firebase

Add In-app Firebase dependencies in your android project

Add Firebase In-App Messaging to your app
Add Firebase dependencies to your app.

Then, it’s all set app is now ready to run and display Firebase In – App messaging.

Step 4: Add Internet Uses permission under android_manifest.xml

Don’t Forget to Add user-permission ( internet ) in manifest file

<uses-permission android:name="android.permission.INTERNET"/>

Step 5 : Create Firebase In-App Messaging Campaign in the Firebase Console

Now, Go to Your Firebase Console and create a Campaign to show Free In-app Messages.

Firebase Console > Right sidebar GROW > Select In-app Messaging > Create your first Campaign
firebase in app messaging services campaign
firebase in app messaging services campaign

Here you will find a option to Test on DeviceΒ where you can easily run on your test device for testing purpose

Test on device firebase
Test on device firebase

Then, To get Instance Id you need to run the project in physical device or emulater device so that firebase can generate a Instance ID for testing purpose.

Now, your app is been build successfully and is running on the device.

Navigate to Logcat at the bottom of Android Studio and search for ” Instance β€œ, you will get the instance ID generated by firebase for texting, The instanse ID will look something like this :

I/FIAM.Headless: Starting InAppMessaging runtime with Instance ID " esfS9Au1vYw "

Then, Copy the Instance ID and paste it into Firebase console test on device.

test on device instance id Firebase
test on device instance id Firebase

and then , Hit the Test button.

after that close the app if running and re-open the app.

Now, you will be able to see Firebase In-app Message been poped up as below.

In-app firebase messaging
In-app firebase messaging

Learn how to send Push notification using Firebase Cloud Messaging

Β 

Β 

Β