Send Notification From One Device to Other | FirebaseCloud Messaging Android to Android -2021

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello viewers welcome to my channel today i want to uh share how to send push notification from a single device to another device or some specific device at first i told me told you that i need some dependency and to java class and i provide this dependency and to java class from my video description box and you download this java class and text document from my video description box okay uh i shared this f and how to work and at first i write a subtitle then i then i share share how to send a notification from one device to all our app user device and title is hello and message fast notification and token is when i uh when i will send some specific device then uh this token is very necessary and now uh it uh i cannot uh show uh device token uh or a specific device when i uh work code and view my all specific user okay i i at first i write a hello and messages first notification and click send all device okay okay and you view that hello and fast notification and it is and it's add share okay okay let's start uh how uh how to work uh this uh this code okay at first i create new project and select empty activity and name is firebase notification notification okay firebase notification and click finish okay finally uh my project is created successfully and at first we need uh need two three and two button okay at first change my layout linear layout and okay for time saving i copy this whole code from my previous project okay okay i uh copy edit text to button okay copy and paste here okay i cannot see uh your whole all uh edit text and button for orientation okay sends orientation vertical okay i can see their uh title message token and two button and i uh send whole code from center and i give gravity okay gravity center and view that all uh code are sent for send center and create some padding then dp okay now we need we need two java class and one text document and i already shared two java class and one text document from video description box please you download this java class and text document from my video description box okay i open my download and copy to java code copy to java code ctrl c and copy firebase notification project and paste here ctrl v okay and we need some dependency or otherwise error okay okay i open uh open the text text command okay and i see the whole dependency and my dependency is here okay i uh copy copy discord and paste here and paste here okay okay paste here and ah we need we need uh connect connect my project uh to my firebase okay let's click tools and click firebase and i click messaging firebase message cloud messaging okay and setup at first click connect to firebase okay okay okay uh please at first remove this code or java class from my project and at first at first i connect this project to firebase okay please wait and click cloud messaging and setup connect to firebase okay at first click sync now okay now i connect this project fireways okay click cloud messaging okay connect to firebase and you go firebase console and click add project firebase notification part one okay continue continue and check mark i accept okay create project okay your uh your new project is ready and please continue and click connect okay click connect and i click firebase console okay okay our project is connect to firebase and i need some dependency or or copy this dependency but uh i connect manual okay and uh click add fcm to your app click and click accept change okay be yours uh now copy this uh now copy uh to class okay for fcm notification center and firebase message send server and ctrl c and paste here click and paste here okay okay i see first firebase messaging server and view some error and at first vibrator uh this mean is uh when we send some notification and uh phone vibrator is inable this permission is yes okay then click alter enter and add permission vibrator okay and see some error one more error uh this error is when user click fire uh firebase notification bar then this app open but uh but but who is activity then when uh when user are click this notification bar then we want to uh this project from main activity okay main activity okay and we need some correction go fcm notification center and need firebase server key and we have provide from my uh firebase project and insert server key okay go firebase console and firebase notification firebase notification and project our view and setting icon and click project setting and cloud messaging and copy server key a copy server key and paste here paste here okay and uh our need icon okay okay at first go xml file drawable and some icon and this is our icon and icon okay next next it's your app icon okay i can see your icon okay but icon is below value is r dot driver dot icon okay and our error is solved okay now we uh now we send notification to all device okay at first time saving to from copy my previous application and this is some code and this code is edit text and find my all edit text field and my button okay and go back my text document and at first we copy this code okay and this paste here uh here or all code top and click alt on enter and import class okay and at first we click when user click my send all button so so find r dot id dot all device dot set on click listener new on click listener okay and if if not equal to title dot get text dot to string dot is empty and dot get text dot to string dot is empty if a title is not equal to empty and message is not equal to empty then but but to method 2 field is empty then else toast dot make texts text okay now i firebase okay i copy from my previous code and this is okay here's all whole coding are paste here okay you can see clearly my code at first my testing purpose run my app and see that it is working or not working at first we work uh user clicks all device notification this method and a second way i see that how to send notification to some specific user or some specific user or targeted audience you must uh you must add to this dependency in your app otherwise this f is error okay finally our app is working successfully and test our app and title is my first notification how are you okay and i want to share this notification my all user and i click send all device okay i uh take some error uh because uh this uh f are not working okay i uh identify the error okay i uh i uh understand this i understand my uh error and this is this hero is i cannot uh insert this whole code from my manifest file okay i i copy this whole code and insert insert my manifest file okay insert manifest file and click main activity okay and paste here and you see your error and click alter enter okay and now i again run my f okay i i think that my erode is solved okay run again okay finally my app is running successful and test my first app okay first notification message hello and send all my user send and click send all device and i see your my first application my first application and message is hello okay it is working finally successful okay it is amazing okay okay friend now i share how to send push notification from my specific user okay and specific user button i find this button and this button title is single device id okay and this code is my all device and now i work i send notification from my specific user and find my second second button or this name is single device id dot chat on click listener new on click listener okay for time saving uh i copy uh my whole code from previous activity and this work okay and okay and you can see my code okay this uh this means if title and message and token are not empty nah then we are send notification from specific user and else yields else and i show at roaster message this is inter token and how can we find device token okay now copy some previous code from my text and you you share you share this code copy and this code are pasted here i mean okay okay now i uh now i test this f and some error then okay this code is a user token okay user token is user token and log d log d and a drive to add message token plus user token okay now uh my now my test my second step and i see that it is working or not working this token uh identify my device token id and this token id insert my token edit text box and i click single device then send notification the specific user okay my app are running successfully and title single device message and how can uh find my uh token its mode debug change debug and write to and you can see that is token okay sorry you copy this token okay you copy token ctrl c and below from token and click send single device and you uh view that my app is running successfully okay viewers uh thank you for watching my video and if you facing some problem or error please comment my comment box okay bye bye
Info
Channel: Learn with Arif khan
Views: 19,743
Rating: undefined out of 5
Keywords: notification, android tutorial, whatsapp, firebase send notification to specific device, device to device notification firebase android, send push notification to multiple devices android, firebase cloud messaging, push notification android studio
Id: fue1-y9pLCY
Channel Id: undefined
Length: 25min 11sec (1511 seconds)
Published: Tue Jun 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.