How to add Firebase Cloud Messaging into you app

Visit https://firebase.google.com/docs/cloud-messaging/android/client for more details

1) Create your app and add it as a project in firebase https://console.firebase.google.com/

CreateProject

2) Add your projects package name while creating the project

Notification

Packagename

3) Download the google-services.json (will be downloaded automatically) and save it in your app module (while opening the project in project tab)

project

4) Add the classpath dependency in project level gradle and apply plugin dependency in app level gradle

5) Add the firebase dependency for fcm to support cloud messaging

projectlevel

applevel

6) In your Manifest create two services which extend

Add these two services in your manifest

7) You can test notifications from the notification console of your app https://console.firebase.google.com/project/<YOUR_PROJECT_NAME_HERE>/notification

TestNotification

  Like
Author: sanket on June 28, 2016
Category: Uncategorized

Your comment:

Your Name

Comment:




Last articles