FCM : FirePush is a lightweight Kotlin/Android library to send FCM push notifications to Android, iOS & Web like a pro.

Overview

FirePush - A Lightweight Kotlin Library for sending FCM push notification

Android Arsenal

Hi, I made this Library for a Chat based project I was working on. So I decided to make it publicly available. It is light weight Library. I have used Java's HttpURLConnection for network requests along with Kotlin Coroutines.

Dependencies

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {
	  ...
	  maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
	  implementation 'com.github.karanatwal:FirePush:1.0.0'
}

Usage

Server Key

Step 1. Get Server Key and add below in your Application's/Activity's onCreate :

 override fun onCreate(savedInstanceState: Bundle?) {  
    super.onCreate(savedInstanceState)
    Fire.init("YOUR_SERVER_KEY_HERE")
 }

Step 2. Use Below to send Push Notification.

Fire.create()  
    .setTitle("TITLE HERE")  
    .setBody("BODY HERE")  
    .setCallback { pushCallback, exception ->  
         //get response here
     }  
    .toIds("TOKEN ID 1","TOKEN ID 2",...)  //toTopic("FOR TOPIC") or toCondition("CONDITION HERE")
    .push()

There are many other functions :

    Fire.create()  
        .setTitle("")  
        .setBody("")  
        .setBadgeCount(2)  
        .setClickAction("")  
        .setAndroidChannelId("")  
        .setColor("")  
        .setIcon("")  
        .setSound("")  
        .setTag("")  
        .setPriority(FirePushPriority.HIGH)  
        .addData("key","value")  
        .addData(HashMap())  
        .toTopic("")// or toIds or toCondition  
        .push()

There is detailed Documentation regarding FCM keys are given here.

Please mark Star, if you find this library useful, Thanks!!

Karandeep Atwal

You might also like...
Link-converter - A web service that converts links between web url and deeplink for mobile and web applications

Deep Link Converter Linkleri, mobil ve web uygulamaları için web url ile deeplin

Authenticator Pro is a free open-source two factor authentication app for Android
Authenticator Pro is a free open-source two factor authentication app for Android

Authenticator Pro Authenticator Pro is a free open-source two factor authentication app for Android. It features encrypted backups, icons, categories

Belajar Android Jetpack Pro Dicoding - with Hilt, LiveData, Online-Offline Caching, etc

movie-catalogue-jetpack-pro-dicoding Ini adalah final submission pada kelas Belajar Android Jetpack Pro di dicoding (get 5 star) Pada project ini terd

Nativní verze movapp.cz pro Android
Nativní verze movapp.cz pro Android

Cílem Movapp.cz je usnadnit dorozumění mezi Čechy a Ukrajinci. Mова [mova] znamená ukrajinsky jazyk. Movapp je aplikace pro trénink jazyků. Projekt vz

Improve automated and semi-automated active scanning in Burp Pro

PentagridScanController Improve automated and semi-automated active scanning for BurpSuite Author: Tobias "floyd" Ospelt, @floyd_ch, http://www.floyd.

The idea of ResideMenu is from Dribbble 1 and 2. It has come true and run in iOS devices. iOS ResideMenu This project is the RefsideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu. And thanks to the authors for the above idea and contribution. Social media app but with new features like translate messages and posts , support video & images as posts  , chat and  notifications , etc...
Social media app but with new features like translate messages and posts , support video & images as posts , chat and notifications , etc...

social-media-app Social media app but with new features like translate messages and posts , support video & images as posts , chat and notifications ,

Utility logger library for storing logs into database and push them to remote server for debugging
Utility logger library for storing logs into database and push them to remote server for debugging

HyperLog Android Overview Log format Download Initialize Usage Get Logs in a File Push Logs Files to Remote Server Sample Testing Endpoint using Reque

Push notification application using One Signal + Spring Boot + Kotlin

Spring Boot push notification system using One Signal This project was created to demonstrate a simple application built with Kotlin + Spring Boot inc

PPNS(public-push-notification-service) for android SDK
PPNS(public-push-notification-service) for android SDK

Public Push Notification Service - PPNS What is PPNS? It's a cross-platform messaging solution that lets you reliably send messages for free. Inspired

push note is a free Android app that you can keep your notes in the notification bar in seconds.
push note is a free Android app that you can keep your notes in the notification bar in seconds.

push note - notification notes push note is a free Android app that you can keep your notes in the notification bar in seconds. Features 🌟 Super quic

Here OneSignal push and in-app-message have been implemented

OneSIgnal demo project Here we have implemented OneSignal inAppMessage and Push Notification ANDROID SDK SETUP WITH ONESIGNAL: https://documentation.o

Intellij Idea plugin to push indexing metrics into an Elasticsearch cluster
Intellij Idea plugin to push indexing metrics into an Elasticsearch cluster

indexing-metrics-collector Allows gathering IntelliJ IDEA project scanning & indexing metrics for further analysis by ingesting them into an elasticse

Bringing webhooks into Telegram. Push messages to chats via URL with a simple API.
Bringing webhooks into Telegram. Push messages to chats via URL with a simple API.

Webhooks over Telegram (WoT) WoT aims to provide a simple API for registering webhooks and sending messages to Telegram chats via them using a single

To Do List App is built in Kotlin using Material 3, Data Binding, Navigation Component Graphs, Room persistence library, Kotlin coroutines, LiveData, Dagger Hilt, and Notifications following MVVM Architecture.
To Do List App is built in Kotlin using Material 3, Data Binding, Navigation Component Graphs, Room persistence library, Kotlin coroutines, LiveData, Dagger Hilt, and Notifications following MVVM Architecture.

ToDoListApp ToDoList App demonstrates modern Android development with Hilt, Coroutines, LiveData, Jetpack (Room, ViewModel), and Material 3 Design bas

Handy library to send & receive command with payload between subscribers for Android.

Commander Handy library to send & receive command with payload between subscribers for Android. Features Subscription based No dependency on Framework

SimpleApiCalls is a type-safe REST client for Android. The library provides the ability to interact with APIs and send network requests with HttpURLConnection.

SimpleApiCalls 📢 SimpleApiCalls is a type-safe REST client for Android. The library provides the ability to interact with APIs and send network reque

This is a specified proportion to the size of the Layout or View support library, with which you can easily set a fixed ratio of the size of the Layout or View, internal adaptive size calculation, completely abandon the code to calculate the size! If you have any questions in the course or suggestions, please send an e-mail to the following e-mail, thank you!
Web Container: A simple web container library for Android to help fellow developer to open WebView easily

WebContainer Description Web Container is a simple web container library for And

Comments
  • Consider adding a warning

    Consider adding a warning

    Hi there

    Could you consider adding a fair warning that including this library into a client application is highly insecure and should not be done unless the developer knows 100% sure the .apk can't fall in the wrong hands? Even with encryption, obfuscation or whatever, the Firebase secret token can be captured through an injected debugger or simply by intercepting the outgoing call.

    help wanted 
    opened by zunjae 2
Owner
Karandeep Atwal
Find my tutorials on ANDROID at www.coderzpassion.com
Karandeep Atwal
Android app to search for covid vaccine slots, turn on background search & get notifications when slots are available

CowinNotifier Android app to search for covid vaccine slots, turn on background search & get notifications when slots are available Glipmse of the App

Ujjwal Kumar Maharana 3 Dec 29, 2022
Pulls notifications from a remote JSON file and shows them in your app.

android-remote-notifications A Google GCM/Amazon SNS alternative using pull instead of push. Main features Independent user notifications (no Google G

Kai Winter 97 Dec 23, 2022
Remote Notification Manager for Kotlin Multiplatform Mobile iOS and android

Remote Notification Manager for Kotlin Multiplatform Mobile Features Super easy to use APNs and FCM in one interface Dramatically reduce code to write

LINE 24 Dec 10, 2022
Tsunami - An open-source SMS & Call flooding Android application with unlimited OTP bombing capability

An open-source OTP & Call flooding android application with unlimited sending capability

Utsanjan 83 Jan 2, 2023
An android app to display meaning for selected word as notification

Notification Dictionary An Android application to display meaning of selected word as a notification. Features Easy access from all apps that have tex

Karthikeyan Singaravelan 25 Nov 22, 2022
The AppMetrica Push SDK is a set of libraries for working with push notifications.

Flutter AppMetrica Push AppMetrica Push SDK — это набор библиотек для работы с push-уведомлениями. Подключив AppMetrica Push SDK, вы можете создать и

Mad Brains 6 Oct 12, 2022
Coinbase-pro-feed-kotlin - Kotlin Coinbase Pro Level 2 Order Book Feed

Kotlin Coinbase Pro Level 2 Order Book Feed Quick start Depending on your OS run

Eric McEvoy 0 Jan 2, 2022
Jetpack Compose android app that you can send push notification among devices using KTOR and One Signal

Jetpack Compose android app that you can send push notification among devices using KTOR and One Signal, Clean Architecture, Dependency Injection...

Raheem 2 Nov 15, 2022
Push Notifications Android

Push Notifications Android This repository shows how to use Huawei or Google services for Push-notification in different flavors. Preparations You nee

MobileUp 3 Oct 3, 2022
In-layout notifications. Based on Toast notifications and article by Cyril Mottier (http://android.cyrilmottier.com/?p=773).

Android AppMsg (Crouton) Library Implementation of in-layout notifications. Based on Toast notifications and article The making of Prixing #4: in-layo

Evgeny Shishkin 1.4k Nov 25, 2022