/android-firebase-fcm-client

Receive push notification from firebase without showing notification tray even if App is background

Primary LanguageJavaMIT LicenseMIT

Overview

android-firebase-fcm-client is example for receiving push notification from firebase without showing notification popup even if the App is in the background.

You can receive downstream message from firebase.

It is licensed under MIT license.

Quick Start

1.Clone or download this example project.

Change applicationId(package name) to yours.

RecvFcm/app/build.gradle

  applicationId "org.riversun.recvfcm"

to yours like

  applicationId "org.example.yourapp"

2.Setting up firebase account

2-1.Create Google account

2-2.Goto firebase console and setup cloud messaging for Android devices.

https://console.firebase.google.com/

firebase

firebase

firebase

firebase

firebase

firebase

firebase

  • This server API key is required to send notification to Android Device from your server.
  • Set this server API key with FcmClient#setServerKey

firebase

firebase

  • Input your app's applicationId(package name).

firebase

  • After automatic download finished,
  • Copy google-services.json to the RecvFcm/app/

See below.

firebase

firebase

OK, Firebase settings finished.

3.Let's send push notification

Send firebase cloud messaging from your server or your computer using client library.

See below.

https://github.com/riversun/java-firebase-fcm-client