Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 836 Bytes

File metadata and controls

29 lines (24 loc) · 836 Bytes

FCM-Snippet

Firebase Cloud Messaging snippet Using HTTP V1 api without using server

Things to get started

  • goto this url
  • Select firebase admin sdk and then click on generate new private key. Rename the downloaded file into service_account.json
  • Copy that file into res/raw directory

In MainActivity.java
Find function getTokenForNotification.
Replace the token value with the token of the person whom you want to sent the notification.

Important : In module level build.gradle file

android{
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
    }
    .
    .
    .
    
    implementation 'com.android.volley:volley:1.2.0'
    implementation 'com.google.auth:google-auth-library-oauth2-http:0.25.3'
}