Posts

Showing posts from November, 2021

Android push notification using Firebase

  Step 1: Add following Libraries/Dependencies in your gradle (App-Level) :     //messaging     implementation 'com.google.firebase:firebase-messaging:20.2.0'     implementation 'com.squareup.retrofit2:retrofit:2.9.0'     implementation 'com.squareup.retrofit2:converter-gson:2.1.0'     //Database     implementation 'com.google.firebase:firebase-analytics:17.2.0'     implementation 'com.google.firebase:firebase-database:19.2.0'     implementation 'com.google.firebase:firebase-auth:19.1.0'      Step 2: Make A Package “SendNotificationPack” and add the following classes, two services and an interface: Interface: APIService.java // use to send request for notification to firebase server  package com.example.connect.SendNotificationPackage; import retrofit2.Call; import retrofit2.http. Body ; import retrofit2.http. Headers ; import retrofit2.http. POST ; public interface APIService ...