Skip to content

🔔 A simple example of sending a notification from one user to another using Firebase

License

Notifications You must be signed in to change notification settings

alidehkhodaei/notification-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🔔 A simple example of sending a notification from one user to another using Firebase

Topics

Resources

License

Stars

Watchers

Forks

Languages