Send Android Push Notification From Your App Server using Firebase

Поделиться
HTML-код
  • Опубликовано: 10 авг 2016
  • In this video we are going to learn about how to send a simple push notification for android from your own application server using firebase cloud messaging. First you have to obtain the firebase registration token from each of your app instance and send it to the app server. In app server we save the fcm token in MySQL database. We use a simple html form for composing the push notification and submit to the app server. The app server send the push notification request to the firebase cloud server. Here we use the curl for sending the push notification from app server to FCM server. Here PHP is the app server scripting language.
    Like my Facebook page : / codeglympse
    Subscribe My RUclips channel : / ticoontechnologies

Комментарии • 401

  • @MohammedSalemDMC3
    @MohammedSalemDMC3 8 лет назад

    PRABEESH.....you are the best !
    I had a graduation project on an android app
    and your tutorials were really helpful...so thank you !

  • @curstinvisagie7689
    @curstinvisagie7689 6 лет назад

    Thank you Kindly, I've watched a lot of your tutorials, love the simplicity :)

  • @joseluisfernandez5981
    @joseluisfernandez5981 6 лет назад +1

    It works perfectly.Thank you so much, Sir! that was an awesome tutorial.

  • @coretancode
    @coretancode 7 лет назад

    hi mr. prabessh
    you are my teacher now,
    thank you from Indonesia

  • @muhammadbilaliqbal8999
    @muhammadbilaliqbal8999 4 года назад

    Hi PRABEESH SIR,
    Thankyou, I have learnt android from your tutorials.

  • @okuhlengada7038
    @okuhlengada7038 7 лет назад

    I love your channel!! Thanks for the amazing Android Tutorials!! Keep them coming!!

  • @garrydias
    @garrydias 6 лет назад

    Amazing video! I don´t know why Google didn´t use a video approach in its User Guides. Their User Guide has a lot of hyperlinks , uses a lot of terminologies to specify a single thing... I was completely lost reading that after a week. Your video has fixed my issues in minutes... Thanks a lot..
    PS: I didn´t use php but java server using Spring Rest Template API

  • @ioanaiftenie7246
    @ioanaiftenie7246 6 лет назад

    Thank you! This helped me so much. Instead PHP I used NodeJS.

  • @wassaufkhalid8593
    @wassaufkhalid8593 6 лет назад

    Ooh man u great .. was searching for this tutorial .. will definitely try it .. thanks man

  • @adriano_bp
    @adriano_bp 6 лет назад

    Amazing. The only one that works!

  • @whitemageFFXI
    @whitemageFFXI 7 лет назад

    So helpful! Thank you so much!

  • @VictorOkech
    @VictorOkech 7 лет назад

    Good tutorial Prabesh, always love your videos. Just want to make a request for a tutorial on how to use FCM for chat notifications between two devices in a chat app.

  • @kingarthurracosalem2188
    @kingarthurracosalem2188 6 лет назад

    It's working perfectly , thank you sir! kudos to you sir.

  • @saravanan.akumar3841
    @saravanan.akumar3841 7 лет назад

    really gud and fast teaching

  • @supriyantoscene
    @supriyantoscene 6 лет назад

    Easy. Working perfectly sir. Thank you

    • @rahulpawar451
      @rahulpawar451 6 лет назад

      Hey, Can you please share your send_notification.php file? I am not getting what is the problem exactly. User key is stored but not receiving the notification.

  • @rahulpawar451
    @rahulpawar451 6 лет назад

    Thank you so much, Sir. It's working perfectly. Had to make some changes in fcm_insert and send_notification php files to make it send to all users. But it works efficiently.

  • @borysnikolenko5579
    @borysnikolenko5579 6 лет назад

    thank you very much, very nice tutorial, works great!

  • @Msshrutinayak
    @Msshrutinayak 4 года назад

    Hi, Thank you for a great video. very helpful. It's simple and clean :-)

  • @saqada6701
    @saqada6701 7 лет назад

    Thanks for the tutorial, very helpful. Just wanted to ask, why do you use SharedPreferences to store Firebase token if we can use FirebaseInstanceId.getInstance().getToken() whenever we wish?

  • @amitwalke4398
    @amitwalke4398 7 лет назад

    Thank you very much for such great video

  • @deeshapatel9426
    @deeshapatel9426 3 года назад

    thank you so much for this video tutorial

  • @goncalobarbosa7224
    @goncalobarbosa7224 7 лет назад

    Good tutorial! Thank you

  • @hofiatmajaya9240
    @hofiatmajaya9240 7 лет назад

    Thank you sir, good tutorial

  • @hicham3341
    @hicham3341 8 лет назад +4

    salam / salut it is good
    جزاك الله خيرا

  • @Pabitraful
    @Pabitraful 7 лет назад

    very good tutorial, explained.

  • @user-ry3so6gk8k
    @user-ry3so6gk8k 7 лет назад

    Thanks for the video.

  • @surajdhole
    @surajdhole 7 лет назад

    Hello Sir, thanks for this great tutorial,
    Can we send notification to multiple devices
    using this tutorial....please reply....
    Thanks and keep posting great tutorials.....

  • @MOSA94ABUZAID
    @MOSA94ABUZAID 8 лет назад

    thank you man , you saved me really

    • @inbarajp3646
      @inbarajp3646 3 года назад

      hi sir do you know how can i send the notification for multiple users??

  • @androiddeveloper5134
    @androiddeveloper5134 7 лет назад

    good explanation.......

  • @indrajitchauhan1890
    @indrajitchauhan1890 6 лет назад

    Thanks for video....!!!!!!!!

  • @dedekk1188
    @dedekk1188 6 лет назад +1

    thank you , it works

    • @kamal98kumar
      @kamal98kumar 5 лет назад

      Can you please help here...Token is inserted in database..but send_notification.php do not send the notification...
      Please help

  • @mohammadsadeghkarami9334
    @mohammadsadeghkarami9334 4 года назад

    very nice. thanks

  • @silmasur7020
    @silmasur7020 7 лет назад +2

    Thanks for the video. I have a question: When I send a message and have the app open vibrates and sounds, but if I leave it in the sleep mode does not sound or vibrate. Could you help me please.

    • @agifa-life
      @agifa-life 7 лет назад

      Sil MaSur do you have solution for this issue?

  • @mahdih9283
    @mahdih9283 8 лет назад

    Hi PRABEESH,
    Thank you for your great tutorial,
    please can u make a tutorial how to send automatic notification message to the app ?

  • @muharifandi1580
    @muharifandi1580 7 лет назад

    hi, can you help me, I use my previous gcm want to move to the FCM whether you can memb natu me on this ...?

  • @pankajsolanki9741
    @pankajsolanki9741 6 лет назад

    thax alot sir

  • @MrGamerFunny
    @MrGamerFunny 7 лет назад

    Thanks sir For this outstanding tuts. Please make some tuts on firebase Dynamic linking

  • @mrthanh2029
    @mrthanh2029 7 лет назад

    thanks u so much

  • @Vibhor_
    @Vibhor_ 7 лет назад

    i wanted to implement push notifications for my current and furure websites what would you suggest
    thanks

  • @kalliatt
    @kalliatt 6 лет назад

    Thank You Prabeesh. Everything seems to be alright. Your tutorial is awesome. I'm getting notifications even my app is both in background or foreground. This is working good. But when my app killed or force stopped, it doesn't work. I'm not getting any notification in this situation. onMessageReceived() method doesn't invoke. Also, I have written code to upload received notification messages to my app server under this method. Since it won't invoke in this situation my notifications are not being uploaded to the server. But if my app is in background or foreground notifications are working fine and upon receiving notification, it will be uploaded to the server. Do you have a solution? Once again thank you for your awesome tutorails.

  • @waleeddev7006
    @waleeddev7006 7 лет назад +2

    how can send notification to specific user if i have user registered

  • @eliabekun
    @eliabekun 6 лет назад

    THAAAAAAAANK YOUUUUUUUUUUUUUUUU!

  • @simonebiliato3170
    @simonebiliato3170 8 лет назад

    Hello, many thanks for this tutorial. It would be possible to create an application, that send the notification an "User segment"?

  • @toukirulalam5755
    @toukirulalam5755 7 лет назад

    u r awsome sir (Y)

  • @vijayanpillai2387
    @vijayanpillai2387 4 года назад

    Good video

  • @chg_m
    @chg_m 7 лет назад +3

    THANKS GOD. IT IS WORKING PERFECTLY

    • @andrewanim8864
      @andrewanim8864 6 лет назад

      Please can you send me your php scripts...I am not able to send notifications to my phone...thanks in advance

    • @mohamedkarkouri7217
      @mohamedkarkouri7217 6 лет назад

      plz send me your php for send_notification.php

    • @andrewanim8864
      @andrewanim8864 6 лет назад

      I've resolved the issue and receive notifications now

    • @devershichandra2241
      @devershichandra2241 6 лет назад

      How did you do that? care to send the script? I am unable to send the notification although fcm_info table is filled correctly.

    • @andrewanim8864
      @andrewanim8864 6 лет назад

      kindly send your email so that I send it there

  • @dianamejia160
    @dianamejia160 6 лет назад

    Tanks a lot..

  • @ytshyue
    @ytshyue 8 лет назад +1

    Hi Sir, some lines of code are too long from your screen and can't read, can you share the source files of the mobile app?

  • @MihodiHasan
    @MihodiHasan 7 лет назад

    what about sending notification to multiple devices? I tried after changing send_notification.php, i took all tokens in key as array. but in that case notification doesn't work on any devices! and for this given code only one devices receives the notification.
    what to do?

  • @codeking1120
    @codeking1120 6 лет назад

    how to send push notifications as my token gets changes each time i start app and every time i dont want end user to click to send token as it creates complexity for end user
    what to do to send token automatically for push notification

  • @alfonso5552
    @alfonso5552 7 лет назад

    I already manage to send notification message from php file and send to mobile phone using fcm. Once the user click on the notification message on mobile tray, it will redirect to other layout with same message plus time and date…is it possible to do that…? Really appreciate your reply...

  • @simonebiliato3170
    @simonebiliato3170 7 лет назад

    Into the NotificationComapt.Builder, there is a method called: setSubText() that I want to use. So, how do I get the "remoteMessage.getNotification().getSubText()"?

  • @umeshsarode5734
    @umeshsarode5734 7 лет назад

    Hi,
    Can you please help me, I want to implement that thing using multiple client ......
    How I can implement ??? and What kind of changes i have to do ???

  • @ShortsnSmile
    @ShortsnSmile 7 лет назад

    sir,I tried to develop push notification using Firebase by your RUclips
    vidio, programm run correctly byt FCM_TOKEN not stored in xamp database
    's table only blank record add.

  • @marialijideveloper2006
    @marialijideveloper2006 7 лет назад

    Hi, Prabeesh RK, I have this error "mysqli_fetch_row() expects parameter 1 to be mysqli_result" on the script SEND_NOTIFICATION.php , although I'd followed yours instructions to write the script in PHP. could you help , please? thanks so much.

  • @AliHaider-gc4te
    @AliHaider-gc4te 6 лет назад

    what if i want to send a data message? what changes will i have to make in the sendNotification.php file?

  • @anwarsamer
    @anwarsamer 7 лет назад

    first i wanna thank you for this awesome video
    but i have a question i wanna send the notification to all token how can i do this
    thanks a lot

  • @gowthamgnan6673
    @gowthamgnan6673 6 лет назад

    Hi Prabeesh, If I want to work with real time project, Do I need to take any subscription from Firebase initially. Or initially any support free subscription kind of....... PLZ Reply

  • @mannatom
    @mannatom 7 лет назад

    is it work with Android Studio 1.4.1?
    Because a blank token key storing in my database...
    Can you help please?

  • @marialijideveloper2006
    @marialijideveloper2006 7 лет назад

    Hi, good tutorial. Ok, I've followed yours instructions from the tutorial, but the token didn't insert on the table on my database MySQL, could you please send me the scripts PHP??
    Thanks so much.

  • @TheRealRehman
    @TheRealRehman 7 лет назад

    I need help. I am trying to create an app that when the user enters in a date and a message the app will send a push notification the day before the date the user entered warning them that the date is near. any help and advice would be great.

  • @Kreandoapp
    @Kreandoapp 6 лет назад

    hello friend how can I send notifications using fcm, from my android application, I do not want to use another server, I want all this in the same client application.

  • @INFINITYINFO07
    @INFINITYINFO07 6 лет назад

    sir,i had followed it step by step app is working fine, but the token is not saving in database,but it storing as blank value,how to solve this?can anyone help me?

  • @proudibeastmode
    @proudibeastmode 7 лет назад

    Thx for youre awesome TuT,
    but how we can show the received message on a textview ?
    pls help, thx

  • @mohammadimran8944
    @mohammadimran8944 6 лет назад

    Hi sir,
    Will u plz tell what should I mention in url for finding script from Android real Device
    Where should I keep these php and html file , if I'm running mobile

  • @229masterchief
    @229masterchief 7 лет назад

    If there's multiple device running the app, will all of them be notified? If so, then how to avoid that? To send a notification to only to one device?

  • @truongphamvan4780
    @truongphamvan4780 7 лет назад +1

    When I turn off
    the app, there is a notification sent to the app, I want when the user
    opens the app, the app receives the previously sent notification, please
    help me.

  • @kishorereddy8487
    @kishorereddy8487 8 лет назад

    nice tutorial

  • @GaneshGirideveloper
    @GaneshGirideveloper 7 лет назад

    Nice Video sir.I want to send token when Token Refresh with primary key .

  • @lavanyanaik9934
    @lavanyanaik9934 5 лет назад +1

    com.android.volley:volley:1.0.0 , how to get this code?
    from where to get the token??

  • @himsikharai4286
    @himsikharai4286 5 лет назад

    Can i use firebase push notifications with mysql database for creating android app??

  • @richardnavalesca9444
    @richardnavalesca9444 7 лет назад

    is it working with just local server? without internet access to ISP.

  • @sajeelsarwar787
    @sajeelsarwar787 6 лет назад

    sir, when i run this app on one device it work perfectly but when i run this app to multiple devices then it works only for first device that we register. what is the problem can you help me sir plz its very impt for me.
    am waiting for your positive responce.

  • @sajeelsarwar3210
    @sajeelsarwar3210 7 лет назад

    Hello sir,
    sir am working on a specific android app in which i want to sent notification to specific user and also to all user when an event occur. How i can do this? Plz sir guide me. Am waiting for your positive response.
    Thank You

  • @munawwarahmedshaikh1557
    @munawwarahmedshaikh1557 7 лет назад +4

    Hi sir, FCM_TOKEN not generated and not stored in database table only blank record add.
    Please share the solution.

    • @mohamedkarkouri7217
      @mohamedkarkouri7217 6 лет назад

      i have this problem in first time so :
      you can unsinslall app from mobile
      and run again for new install its working for me ;)

    • @MySHIVNARAYAN
      @MySHIVNARAYAN 6 лет назад

      To get token you have to use your phone u will not get tokens while using Emulator

    • @ankitsrivastav1638
      @ankitsrivastav1638 5 лет назад

      use FirebaseInstanceId.getInstance().getToken();

  • @RajagopalBaskaran
    @RajagopalBaskaran 7 лет назад

    Nice video, Do you have any tutorial for andriod firebase(storing and auth) node js(for processing cloud messages and notification and for processing huge business logic ) ?

  • @kelvinpac
    @kelvinpac 8 лет назад +1

    a very nice tutorial, but i have a question about it ';; what if i want to send notification to all my app users, maybe 100 or even more, does each app have to send the reg token to the server? I want to creat a html form just like yours but it should send the notification to all my app users, and is it possiple to add a dropdown menu to the form where i can select which activity am targeting for each notification sent.
    i will appreciate your reply

  • @piyushmehndiratta7542
    @piyushmehndiratta7542 8 лет назад +1

    im not receiving the notification . with no errors !

  • @software_rumahan
    @software_rumahan 5 лет назад

    Hi Sir ,Its Great Tutosial, But I have question,
    Is possible to get notification when application was closed ?

  • @vinoget6289
    @vinoget6289 6 лет назад

    sir, I want to send a real time push notification for my android application whenever data changes apper in the firebase real time database. plz give some details to create this feature in my android application

  • @BradMcHelm
    @BradMcHelm 7 лет назад +2

    Is your code on github?

  • @robertoamarillas
    @robertoamarillas 7 лет назад

    Hi Mr. Prabeesh, i need to add this to an existing app, already built on android studio

  • @tahashaikh1733
    @tahashaikh1733 6 лет назад

    i'm unable to received any notification from server without php errors. but it works perfect if i send notification for firebase consol. can any one help ?

  • @jeromespianos7291
    @jeromespianos7291 7 лет назад

    Sir,
    How to send push notification with out creating token ? i mean if we have large no of users.

  • @orirMarIngolfsson1
    @orirMarIngolfsson1 8 лет назад

    Do you have the code somewhere on the web to look at? (GitHub)

  • @sameerpatil299
    @sameerpatil299 6 лет назад

    dear sir i am getting token at this line
    String token = sharedPreferences.getString(getString(R.string.FCM_TOKEN),"");
    but unable to get it here in params
    @Override
    protected Map getParams() throws AuthFailureError {
    Map params = new HashMap();
    params.put("token",token);
    return params;
    }
    sir i am trying this since last 2 days bt not working please tell me sollution please.....

  • @mailtojmk1371
    @mailtojmk1371 5 лет назад

    Dear Sir, Thank You for your valuable informative Video. I followed all the steps in this video until the ''SEND REG TOKEN" to local server. But When I press the token on app, local server fcm_token is not responding and does not showing any "Registration Token". Kindly help in this regard! You help is so appreciated. Thanks in advance!

  • @abhishekrijal516
    @abhishekrijal516 6 лет назад

    Notification is sending to only one device even if database consist several device token... how can i send notification to all devices whose token are in database ?

  • @antobeslie9252
    @antobeslie9252 7 лет назад

    I am getting error in send_notification.php. On printing the result of the curl_session it shows {"multicast_id":7034947084040637258,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"MissingRegistration"}]}.
    I tried using both legacy server_key and updated server_key but both not working.

  • @kratipandey1011
    @kratipandey1011 6 лет назад

    Sir,at a time only one device is getting a notification,i want multiple device get this notification at same time...plz reply

  • @mohamedkarkouri7217
    @mohamedkarkouri7217 6 лет назад

    hello sir,
    thanks for this video its very nice
    my question is : when the application is open, notification has not arrived
    can you help me please !

  • @mahkhaikeat1726
    @mahkhaikeat1726 2 года назад

    It this able to use javascript to complete similar function?

  • @amulyagm4855
    @amulyagm4855 7 лет назад

    Hi Sir, How do i send notification automatically without using a textbox? Also how do i send an notification to a single device? Example there are multiple food orders in my website.After the food is ready, i will click on the button to send notification to the employee android phone to collect their food.

  • @blackballization
    @blackballization 8 лет назад

    please whn i put this line in the app gradle complile 'com.google.firebase:firebase-messaging:9.4.0'
    error show and i cant sync please help

  • @devappsworld2256
    @devappsworld2256 6 лет назад

    Is there any example " Send notification from android app " not using firebase console. I hope, you understand me

  • @micheledonnarumma9560
    @micheledonnarumma9560 7 лет назад

    Hi, the video tutorial is very interesting. is possible to have tutorial on sending notifications from inside the mobile app using firebase cloud messaging for androd

  • @user-wc3fy9bu8z
    @user-wc3fy9bu8z 7 лет назад

    hello sir, I like your course so much, can you share the code to me so I can find out where is going wrong in my code. Thank you very much!

  • @benakin9172
    @benakin9172 8 лет назад

    how would you send a push notification programatically? As in how would
    one device send a push notification to another device, like when a
    facebook messgage is sent? thank you

  • @gagangoyal5835
    @gagangoyal5835 7 лет назад

    Hi,
    I tried the code without the PHP part, but unfortunately token returns blank in main activity.

  • @maanzuhir1069
    @maanzuhir1069 7 лет назад

    thank sir but a have problem when push button on mobile
    will save token in database but can not send message to mobile