Code Monkey home page Code Monkey logo

minimal-notifications-app's Introduction

Firebase Push Notifications App

This is a lightweight application designed to simplify the process of sending push notifications using Firebase services.

Purpose

The main objective of this app is to streamline the testing of Firebase's notification handling mechanisms within client applications. It deliberately excludes the use of the Vibes Push SDK, allowing for a more focused examination of notification functionality directly from the client side.

This decision serves a dual purpose. Firstly, it provides developers with a clearer understanding of Firebase's native notification handling. Secondly, it offers a valuable resource for those seeking to explore notification functionalities without the added complexity of external SDKs.

Specific Requirements for Building Locally

Local Setup

To build this project locally, ensure you have the following prerequisites:

  • Java 11
  • Android Studio Iguana | 2023.2.1 Patch 1
  • Gradle 8.4

Running the App

Follow these steps to run the application locally:

  1. Open the project in Android Studio and run it.
  2. Retrieve the push token necessary for sending notifications by executing adb logcat | grep MainActivity in a separate terminal.
  3. Copy the token from the terminal and use it in the payload to send to Firebase. More on this in the next step.
  4. In Postman, make a POST request to https://fcm.googleapis.com/v1/projects/fir-pushapp-29fc2/messages:send.
  5. Configure authorization in Postman. When adding the Firebase URL, Postman automatically detects the Firebase application and prompts you to authorize requests. Note that Vibes Email credentials are required to obtain the Auth token for this app.
  6. Construct your payload according to the guidelines provided here.

Example payload:

{
   "message":{
      "token":"tokenTJCzShi5HrrMUzZRvM:APA91bHSrqc5XjnleH6Ff1bB-BLXzLfyHkqoqBqpZK0HjFiiIDQ6I6dnWaZS92XvmbgZ0QD8PH6SJTdPXrg",
      "notification":{
         "body":"This is an FCM notification message!",
         "title":"FCM Message"
      },
      "data": {
         "story_id": "story_12345"
      }
   }
}

By adhering to these steps, you can seamlessly test and explore Firebase push notifications within your application environment.

minimal-notifications-app's People

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.