Home
Softono
notification-example

notification-example

Open source MIT Kotlin
19
Stars
2
Forks
0
Issues
2
Watchers
3 years
Last Commit

About notification-example

đź”” A simple example of sending a notification from one user to another using Firebase

Platforms

Web Self-hosted Android

Languages

Kotlin

Links

Simple example of sending a notification

Send a notification from one user to another using Firebase.

Screenshots

App Screenshot

Installation

Step 1:Add Libraries

Add firebase messaging library:

   implementation 'com.google.firebase:firebase-messaging-ktx:23.0.0'

Add this lines:

biuld.gradle(app)

plugins {
    ...
    id 'com.google.gms.google-services'
}

biuld.gradle(Project)

plugins {
    ...
    id 'com.google.gms.google-services' version '4.3.10' apply false
}

Step 2:

To use Firebase in your Android app, you need to register your app with your Firebase project. Registering your app is often called "adding" your app to your project.

App Screenshot

Step 3:

Download and put google-serveces.json into project:

App Screenshot

Step 4:

Get your Server key from firebase console and put here.

 interface ApiService {
    @Headers(
            "Content-Type:application/json",
            "Authorization:key=your_Server_key"
    @POST("fcm/send")
    fun sendNotifcation(@Body body: Response?): Call<MyResponse?>?
}

App Screenshot