How to send firebase web push notification to multiple devices using wordpress and PHP Codeigniter

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi myself you aspartel and you are watching sender web youtube channel in this video we will learn how to send web push notification dynamically so you will get so many errors or you have a difficulty to send multiple waypoose notification dynamically so in this video we will learn how to send web post notification let's see how it's work suppose someone open my website signerweb.com right suppose someone open my website at that time one popup will display so this type of popup will display and user will allow that notifications right now how notification will send to every user for that i also created one simple form there is you need to enter title suppose i and which method you have to send to everyone for that i take one message now you need to pass icons part so for that i copy image address and blog link so whenever i send this notification to everyone at that time [Music] this blog link blog link will open now when i click on send notification this all details will send to everyone who allow for notifications i also explain this all all thing later on just see the output how it's work right when i click on send notification see here this type of notification will send to everyone right we are allow for the notification that's why this notification will come to you okay and here i also print some logs like uh 88 person have got this notification and 78 will failure so this is how it's working right now i explaining everything step by step for uh send we push notification by using wordpress or php right we followed this blog also first you need to install this plugin if you and also remember i also created one simple block for send away push notification this is not a dynamic but simple waypoint notification so you if you want to see then click on this my first block now for dynamic sand web push notification we need to install one plugin if you are using a simple php or core php website then you don't need to install this plugin right but here we are using a wordpress website that's why i'm going to wordpress admin panel and there is a you need to add plugin inside the plugin add new search that plugin here and once that plugin appear you need to install that plugin i already installed that plugin that's why i'm not reinstalling that plugin i just go to that plugin here you need to enter or click on add js code so you need to click on add js code and here you need to add below code you just simply copy paste this code this whole code you need to copy right once you copy this code paste it inside this you need to enter one title like a file base and paste your code here right inside this code you just need to remember you need to change your api key and your api id and everything that is that all api key and everything will get from your firebase account so you need to refer your firebase account and set your api in everything right and also here we have a right one ajax block why we are writing this block because of what we need to store all the tokens inside my one table so i simply whenever anyone will go to our website at that time my a just call will run and store that token right so also you just i already added this code inside my so i am not saving this but you have first time you need to publish that code right i already save or publish this code that's why i'm not publishing because of here you have to see my i already published that code right if you are using a simple php then you also need to copy paste this code into your simple php file right like index.php or maybe home.php and which is your first page whenever your website will call at that time you have to create a one file like index.php or index.html there is you need to copy paste this code because whenever our website will run this code will be run mandatory then and then your pop-up will be display so you need to copy paste this code in your simple php file or simple index.php file right here we are using a wordpress that's why we are installing this uh custom one css and js plugin now once you copy paste above code after that you need to create one table why we are creating the table because someone login uh someone visiting our website at that time they are allowing from the pop-up we need to store that tokens then and then we will send all waypoose notification otherwise we cannot send a web push notification dynamically so that's why we simply created this table you just simply copy paste this code and go to your website phpmyadmin and create simple this table notification tokens table and there you have to see here there is so many tokens will store this is a are so many tokens will store inside this table so you we need to create this table also to store our all the tokens now once you create your table you need to save your token inside that table by using a simple php or coding network framework what you have to prefer here you need to remember suppose you are using a simple php then you need to write your php file name suppose save dot php so simply you need to write your save dot php file now here we are using coding data framework to save my token data so i simply write my controller name and after that that controller will call my model function to store or save my token if you are using simple php you don't need to write this type of code you need to simply insert your token inside this table this is your logic here we are using a coordinator framework that's why we are following this above format like mvc framework if you are using simple php then you need to simple goal is what you need to save your token inside this table right once you save your token inside your table whenever you are opening your website and clicking on allow button at that time above code will run and save your token inside this table you can check your data by using above code okay once you save your token inside this table now now step 5 is what once you save your token inside the table now how to send your messages to every that token which already we have saved inside the tables right so i have created one simple form right you need to create one simple form like this there is a title message icon part and blog link and send notification you need to copy paste this code into your simple php file or inside the codeigniter file you need to write this simple code and you need to write action right here you need to php or here we are using a codeigniter framework that's why i passing my controller name and then function name now what happening whenever i submit this form at that time i calling my one function send and after that send function will do is what we are getting all the tokens from my tables if you are using a simple php then you have to write code on your own way like you need to get all the token from your table name with distinct function because why we are using distinct function because we are we need to get all unique token right that's why i using listing function to get all unique tokens name once i get all two currents now what i have to do here i write the forage function to get all the token and store inside one array right now we are creating a forage function to store all the my tokens cons inside one array right now we need to create a one variable like url and then we get all the title body icons and everything in one variable if you are using a simple php then you need to simply write a dollar underscore post but here we are following gi framework that's why i am writing this type of this input and post then my field name right now we are creating a array like resistant ids which already create above here right and in this array we are getting all the tokens this all the tokens we are taking in this array and this array will pass inside this recession id and inside the notification we pass the body title icon and clicking action clicking at action it means what whenever someone clicking our notification then our blog link will open that link right so you need to pass this already thing and after that simply your authorization key and content type application slash json so here you need to simply get the data from the table after that getting already token and storing inside the array and passing this array to this recession id this is a predefined attributes name which is provided by firebase you just confirm or you just check from firebase documentation right now simply call will be call or executed once executed then print this result so i already before i am running this website or running this demo here you need to see all the lock here success is activate and failure is 78 so in this print we will print the all the log now how you will get server key you need to go to your firebase account inside the for firebase account you need to go to cloud messaging and you will get your server key so you need to copy paste this server key here right i also said this code by clicking on this link so you will get all this code from this link so you can download it from there also so you have to follow this step one by one right here nothing is any hard now everything is done right if you have any query any question please write it down your comments in comment section right or if you are implemented this firebase web push notification for your website please write it down your website name inside the comment section then and then i will check your website also so i feel proud you also implemented this firebase we put post notification on your website and i hope you will connecting with me how you can connecting with me if you are not subscribed our channel then how we will connecting with you so i hope you will subscribe our channel i am not forcing you but i hope you will subscribe our channel because you are developer via developer we are connecting to each other then we'll discuss everything so i hope you will subscribe our channel and also we are we will make so many video in future so you will get that or all that type of video also so i hope you will connecting with us and yes if you have any query any any if you want to discuss with me then write it down your comments inside the comment section so let so that's final so i hope we will meet very soon and cheers thanks for watching and we will come back very soon thank you thank you thank you so much
Info
Channel: Shinerweb
Views: 2,972
Rating: undefined out of 5
Keywords: shinerweb, firebase web push notification, firebase web push notification javascript, firebase web push notification php, firebase web push notification click_action not working, send web push notifications firebase, firebase web app push notification, firebase web push notification browser, firebase web push notification demo, firebase web push notification device, firebase web push notification example, firebase push notification for website
Id: 7NPjGKI4Q90
Channel Id: undefined
Length: 18min 9sec (1089 seconds)
Published: Fri Jul 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.