Skip to content

A basic java spring boot application which uses Firebase Cloud Messaging (FCM) to send notifications to Android clients when an Image is uploaded through an Androidthings IOT device.

Notifications You must be signed in to change notification settings

MoizAli/fcmserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FCM Java Server

A java springboot application which uses Firebase Cloud Messaging (FCM) to send notifications to Android clients when an Image is uploaded through an Androidthings IOT device. Androidthings repo link

Diagram

Main functionality includes:

  • Save and FCM push tokens from Android clients
  • Send push tokens to Android clients
  • Saves images from IOT device

Main Controllers

There are two main controllers. One for providing image upload/download related service. The other controller for saving and retrieving FCM push tokens

  • Main Controller
    • @PostMapping("/uploadFile")
    • @GetMapping("/downloadFile/{fileName:.+}")
  • Notification Controller
    • @PostMapping(path = "/subscribe")
    • @GetMapping(path = "/all")

Installation

Install the dependencies and devDependencies and start the server.

  • Install MySql and follow the link to create a database MySql
  • Create a folder gcloud in root folder. Add your serviceAccountKey.json file. Follow FCM Server for more information on how to create the key.
    • Set your database url in FirebaseConfig class.
  • Import pom.xml from source folder and run reimport dependencies
  • Create new java application from the configuration menu to run the project:
    • copy enviornment variables from src -> main -> resources -> application.properties

Enjoy :)

About

A basic java spring boot application which uses Firebase Cloud Messaging (FCM) to send notifications to Android clients when an Image is uploaded through an Androidthings IOT device.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages