Skip to main content

Configuration Firebase Cloud Messaging on Android

Get a Firebase configuration file

1. The first thing you need to do to get started with Firebase is, sign up for a free account. You can use your Google account to sign in to your Firebase account.
https://wolaris.blogspot.com |  Configuration Firebase Cloud Messaging on Android
2. After clicking on ‘Sign In with Google’, you might be asked to allow the Firebase to view your Email and your basic profile. Click on Allow button to continue.
3. Once you are signed in, Click on Go to your Console button if you are not automatically redirected to your Firebase console. Click on Create New Project button in your Firebase console.
4. Now you can see an overview of your new Firebase project. Now click on Add Firebase to your Android App as shown below.
https://wolaris.blogspot.com |  Configuration Firebase Cloud Messaging on Android
5. Now you need to enter your application details (your application’s package name) and also get SHA-1 finger print and paste it in the field as shown below. Check out the note below on how to get SHA-1 from Android Studio.
https://wolaris.blogspot.com |  Configuration Firebase Cloud Messaging on Android

Click on Add App button. Upon clicking it, a file named google-services.json gets downloaded to your machine.

Note : Following image shows how to get SHA-1 from Android Studio.
https://wolaris.blogspot.com |  Configuration Firebase Cloud Messaging on Android
6. Download the google-services.json file and paste in the app folder of your Android application.
https://wolaris.blogspot.com |  Configuration Firebase Cloud Messaging on Android
https://wolaris.blogspot.com |  Configuration Firebase Cloud Messaging on Android

Note: If you forget to place google-services.json file under app folder, you will get the following error when you build your app.
https://wolaris.blogspot.com |  Configuration Firebase Cloud Messaging on Android

7. Open the build.gradle (Project level) file of your android application and add classpath ‘com.google.gms:google-services:3.0.0’ in the dependencies section. Your build.gradle (Project level) file will look as shown below.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'com.google.gms:google-services:3.0.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

Popular posts from this blog

Tutorial Firebase Push Notification With Image on Android

Firebase cloud messaging (FCM) is a new version of Google Cloud Messaging (GCM). Using FCM you can send notification messages to your client application in order to drive user engagement. Notification messages can contain an optional data payload, which is delivered when users tap on the notification. Use notification messages when you want Firebase cloud messaging (FCM) to handle displaying a notification on your client app’s behalf. Use data messages when you want to process the messages on your client app. Create a new Android 1. Create a new Android Project in Android Studio. Give it a name and select the Minimum SDK on which your app will run on. I chose API 16 : Android 4.1 (JELLY_BEAN). 2. When you are prompted to add an activity to your application choose Blank Activity and click on next button. 3. In the next step click on Finish and in few seconds your application should be loaded in Android Studio. 4. Open build.gradle(Module:App) file of your application and add the ...

Learn to Make Ground Overlay Google Maps on Android

A land overlay is an image that is a permanent map. Unlike markers , ground cover on the ground to accommodate the screen oriented, turn, tilt, or zoom the map to change the orientation of the image. Terrestrial overlays are useful when you want to define an image in a region on the map. If you want to add rich images that cover a large part of the map, you should consider covering tiles. Create a new android maps project 1. Start Android Studio. 2. Create a new project as follows:  If you see the Welcome to Android Studio dialog, choose Start a new Android Studio project, available under 'Quick Start' on the right of the dialog.  If you see the Welcome to Android Studio dialog, choose Start a new Android Studio project, available under 'Quick Start' on the right of the dialog. Otherwise, click File in the Android Studio menu bar, then New, New Project. 3. Enter your app name, company domain, and project location, as prompted. Then click Next. ...

Learn to Use Google Maps With Multiple Markers on Android

This tutorial the use of aggregate tags when data requires a large number of data points on the map. The Tag Collection tool helps you manage multiple tags at different magnification levels. To be precise, the "signs" are actually 'objects' at this stage and only become "signs" when they are taken. But for clarity, this document will be called "signs" around. Google Maps Android Marker Clustering Utility By clustering your markers, you can put a large number of markers on a map without making the map hard to read. To use the marker clustering utility, you will need to add markers as ClusterItem objects to the ClusterManager . The ClusterManager passes the markers to the Algorithm, which transforms them into a set of clusters. The ClusterRenderer takes care of the rendering, by adding and removing clusters and individual markers. The ClusterRenderer and Algorithm are pluggable and can be customized. Create a new android maps pr...