Push Noification with firebase in Android(send by console)




Hello Friends in this blog i will tell u how you can implement push Notification with console in android.



1. Create a Empty project with api level 23 or above.




2.Go on tools>Firebase>cloudmesseging>setupcloud messeging
    *connect firebase
    *Add Fcm




3. Make a class MyFirebaseMessegingService  and extends it with
FirebaseMessagingService




4. Inside that class make the methord named onMessageReceived given below-




5. Make one more methord named onNewToken given below to make -




6. create a fuction to create  Notification named sendNotification-




7.make service in Mainifest file inside Application tag and add permissions-




8.add some string used in String.xml file



                       


                   CLICK TO DOWNLOAD NOTIFICATION PROJECT

Post a Comment

4 Comments

  1. i m not receving notification. may i know why. first time receive in log cat. Now i added all notification receive background/foreground as per your steps. but i couldnt receive any notification in my mobile..
    Dependencies and manifest, in project also i added google json file..
    can you reply as soon as possible

    ReplyDelete
  2. if u want to recieve notification when app close you have to use alarmmanager or firebasejob dispatcher.

    ReplyDelete
  3. Thank you very much. You saved my life.

    ReplyDelete
  4. Thank you very much, it helped me a lot, I tried several times but with your code I was finally able to send messages.

    ReplyDelete