Using Firebase In-App Messaging π Lovely feature in your Apps Now
So here we are gonna discussing the latest released( for BETA use) feature of firebase SDK which is Firebase In-App Messaging π
As in the above image you can see there are three User Interfaces, we can say Modal Dialog and most right is a type of Banner UI.
You can use this awesome feature in your app as per your requirement, dynamically. Without writing the single line of code,β¦.Cool na π
Firebase In-App Messaging is used to grow your app retention,engagement by sending them targeted contextual messages in the form of Modals and Banners form, that encourage them to use key app features.
π You can show Images and Text as well as Actions along with it if user clicks on it, then a particular action will happen. Basically, action will be Dynamic Deep Links
Use cases-
- Show welcome messages on the app_launch event
- Show a particular notice on the app_update event
- Show festival,birthday wish card
- Show discount offers on a particular day
- Much more possibilities with itβ¦
Uhhβ¦Enough talk, Letβs see the implementation π
Steps:
- Add dependencies
// ...
dependencies {
// ...
// Add the In-App Messaging depencency:
implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.0'
// Check that your Firebase dependency is up-to-date:
implementation 'com.google.firebase:firebase-core:16.0.1'
}
2. Get Firebase Instance ID ( for testing)
Print your firebase instance ID on test mobile with following code
Log.d("Instance ID",FirebaseInstanceId.getInstance().getId());
3. Go to In-App Messaging console
- Once there, click New Campaign.
- Enter a Title for your first message.
- Select UI among three styles ( Modal, Image, Banner) and customize colors as per need
- Set Matter -Title, Body, and Image Url
- Click Test on your Device
- Enter your appβs Instance ID in the Add an instance ID field.
- Click Test to send the message.
Note : If you want to test, there is one problem. You have to get fresh Firebase Instance ID from code and then add it to test device instance ID in the console and after click on Test button, you should kill your app and then REOPEN it to get the result
And then at last Click on Test and see the output
ππ» Here is my own App and I am using this feature in my app to show Festival wishes greetings β¨ to users
Reference
https://firebase.google.com/docs/in-app-messaging/get-started
#HappyCoding π»
Clap π , Share and follow me if you like it π
And also connect with me on social networks Facebook, Twitter, Linkedin