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
PRABEESH.....you are the best !
I had a graduation project on an android app
and your tutorials were really helpful...so thank you !
Thank you Kindly, I've watched a lot of your tutorials, love the simplicity :)
It works perfectly.Thank you so much, Sir! that was an awesome tutorial.
hi mr. prabessh
you are my teacher now,
thank you from Indonesia
Hi PRABEESH SIR,
Thankyou, I have learnt android from your tutorials.
I love your channel!! Thanks for the amazing Android Tutorials!! Keep them coming!!
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
Thank you! This helped me so much. Instead PHP I used NodeJS.
Ooh man u great .. was searching for this tutorial .. will definitely try it .. thanks man
Amazing. The only one that works!
So helpful! Thank you so much!
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.
It's working perfectly , thank you sir! kudos to you sir.
empty token is stored in database
really gud and fast teaching
Easy. Working perfectly sir. Thank you
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.
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.
send source code
can you send source code please
thank you very much, very nice tutorial, works great!
Hi, Thank you for a great video. very helpful. It's simple and clean :-)
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?
Thank you very much for such great video
thank you so much for this video tutorial
Good tutorial! Thank you
Thank you sir, good tutorial
salam / salut it is good
جزاك الله خيرا
very good tutorial, explained.
Thanks for the video.
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.....
thank you man , you saved me really
hi sir do you know how can i send the notification for multiple users??
good explanation.......
Thanks for video....!!!!!!!!
thank you , it works
Can you please help here...Token is inserted in database..but send_notification.php do not send the notification...
Please help
very nice. thanks
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.
Sil MaSur do you have solution for this issue?
Hi PRABEESH,
Thank you for your great tutorial,
please can u make a tutorial how to send automatic notification message to the app ?
hi, can you help me, I use my previous gcm want to move to the FCM whether you can memb natu me on this ...?
thax alot sir
Thanks sir For this outstanding tuts. Please make some tuts on firebase Dynamic linking
thanks u so much
i wanted to implement push notifications for my current and furure websites what would you suggest
thanks
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.
how can send notification to specific user if i have user registered
THAAAAAAAANK YOUUUUUUUUUUUUUUUU!
Hello, many thanks for this tutorial. It would be possible to create an application, that send the notification an "User segment"?
u r awsome sir (Y)
Good video
THANKS GOD. IT IS WORKING PERFECTLY
Please can you send me your php scripts...I am not able to send notifications to my phone...thanks in advance
plz send me your php for send_notification.php
I've resolved the issue and receive notifications now
How did you do that? care to send the script? I am unable to send the notification although fcm_info table is filled correctly.
kindly send your email so that I send it there
Tanks a lot..
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?
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?
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
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...
Into the NotificationComapt.Builder, there is a method called: setSubText() that I want to use. So, how do I get the "remoteMessage.getNotification().getSubText()"?
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 ???
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.
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.
what if i want to send a data message? what changes will i have to make in the sendNotification.php file?
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
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
is it work with Android Studio 1.4.1?
Because a blank token key storing in my database...
Can you help please?
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.
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.
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.
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?
Thx for youre awesome TuT,
but how we can show the received message on a textview ?
pls help, thx
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
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?
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.
nice tutorial
Nice Video sir.I want to send token when Token Refresh with primary key .
com.android.volley:volley:1.0.0 , how to get this code?
from where to get the token??
Can i use firebase push notifications with mysql database for creating android app??
is it working with just local server? without internet access to ISP.
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.
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
Hi sir, FCM_TOKEN not generated and not stored in database table only blank record add.
Please share the solution.
i have this problem in first time so :
you can unsinslall app from mobile
and run again for new install its working for me ;)
To get token you have to use your phone u will not get tokens while using Emulator
use FirebaseInstanceId.getInstance().getToken();
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 ) ?
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
yes its mandatory
you can use topic instead of token
im not receiving the notification . with no errors !
Hi Sir ,Its Great Tutosial, But I have question,
Is possible to get notification when application was closed ?
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
Is your code on github?
Hi Mr. Prabeesh, i need to add this to an existing app, already built on android studio
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 ?
Sir,
How to send push notification with out creating token ? i mean if we have large no of users.
Do you have the code somewhere on the web to look at? (GitHub)
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.....
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!
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 ?
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.
Sir,at a time only one device is getting a notification,i want multiple device get this notification at same time...plz reply
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 !
It this able to use javascript to complete similar function?
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.
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
Is there any example " Send notification from android app " not using firebase console. I hope, you understand me
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
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!
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
Hi,
I tried the code without the PHP part, but unfortunately token returns blank in main activity.
thank sir but a have problem when push button on mobile
will save token in database but can not send message to mobile