Sending Push Notifications with Laravel

  Рет қаралды 9,486

benixal

benixal

Жыл бұрын

Source : github.com/benixal/LaravelPus...
00:00:55 create service worker
00:05:07 register service worker
00:05:48 request permission
00:06:46 test the service worker
00:07:47 send push from php
00:08:01 get subscription data
00:09:10 get VAPID keys
00:23:52 check on Chrome
00:24:13 check on Firefox
00:25:49 check on real mobile device

Пікірлер: 24
@hichamalaoui34
@hichamalaoui34 8 ай бұрын
Excellent Tutorial. Thanks
@benixal
@benixal 8 ай бұрын
You are welcome! Glad it was helpful!
@user-yq5tw7iv2x
@user-yq5tw7iv2x 6 ай бұрын
Hidden gem! Thank you
@benixal
@benixal 6 ай бұрын
You're welcome!
@devnull1484
@devnull1484 4 ай бұрын
Nice, Thank you.😍😍
@benixal
@benixal 4 ай бұрын
Thank you! I'm glad you found the video helpful! 😊
@adejulvian
@adejulvian 4 ай бұрын
this is great, thank you. but when i try from other computer it show error "cannot read properties of undefined (reading 'register')" in console tab browser developer tools. could you help me?
@phdcmd
@phdcmd 3 ай бұрын
JSON data type for mysql column seems to be the proper way to go.
@mybestclips1118
@mybestclips1118 Жыл бұрын
Very very good. This is the best push notification teaching
@benixal
@benixal Жыл бұрын
Thank you! I'm glad you found the video helpful.
@faridmacadato4356
@faridmacadato4356 6 ай бұрын
when i use php artisan tinker to generate a public and private key it return runtimeException unable to create the key. Why is that?
@benixal
@benixal 6 ай бұрын
This issue usually occurs when the OpenSSL extension is not enabled (or not installed) in your PHP Solution #1: Enable OpenSSL Extension 1. Open the php.ini file. 2. Look for ;extension=openssl. 3. Take out the semicolon before it and save it Solution #2: Generate VAPID Keys Online If you don't have OpenSSL, you can use a website to make VAPID keys. Just search "generate VAPID keys." But remember, this Solution (#2) is mainly for practice, not real projects
@faridmacadato4356
@faridmacadato4356 6 ай бұрын
@@benixal i tried the solution #1 and it still doesnt work. By the way i am using wamp64 as a virtual machine server. Acutally i do have an actual server at cloudways and when I use the php artisan tinker there it generates the keys. Is it okay to use that keys on my local development?
@benixal
@benixal 6 ай бұрын
Yes, it's okay to use the keys generated on your Cloudways server
@salvatorecervone6352
@salvatorecervone6352 6 ай бұрын
Thanks. Very well but i not understand server push you use. Use google? Where configurations? notification permission is not saved? should it always be requested? Thanks
@benixal
@benixal 6 ай бұрын
Thank you for your comment! In the video, I didn't use a specific push server explicitly because it depends on the user's browser. For instance, if a user is using Chrome, the endpoint is automatically generated as fcm.googleapis.com/fcm/send/... , or, if someone is using Firefox, the endpoint becomes updates.push.services.mozilla.com/wpush/v2/... , The browser takes care of this in the background. (In fact, this is one of the features of the browser and is provided by the browser) Regarding notification permission, it only needs to be requested once. Once the user grants permission, it's typically saved, and subsequent requests won't prompt the user again. You can check whether the user has a token, and if so, you don't need to request permission again. Also, if the user accepts the request once, the browser automatically knows this and will not ask the user questions and returns the same token as before.
@salvatorecervone6352
@salvatorecervone6352 6 ай бұрын
@@benixal thanks for your answer. Is your code ready for testing? there is no need to add anything else in practice.
@benixal
@benixal 6 ай бұрын
Yes, I think the code is ready for testing. Additionally, if you're interested, I have another video where I explain the process using pure JavaScript and PHP: kzbin.info/www/bejne/ip-Zp3h6p7-dd7c
@salvatorecervone6352
@salvatorecervone6352 6 ай бұрын
@@benixal i would integrate with vue. You test? I change anything?
@benixal
@benixal 6 ай бұрын
I haven't tested with vue, but it should integrate smoothly.
@tandoku9133
@tandoku9133 4 ай бұрын
Is this free when I deploy my project??
@benixal
@benixal 4 ай бұрын
Yes it's %100 free
Vue send push notification with Firebase
12:52
benixal
Рет қаралды 14 М.
Laravel: Avoid Try-Catch In Every Method (What To Do Instead)
4:45
Laravel Daily
Рет қаралды 29 М.
Каха и суп
00:39
К-Media
Рет қаралды 6 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 9 МЛН
Firebase Send Push Notification JavaScript + PHP
27:22
benixal
Рет қаралды 9 М.
08 - Mail and Notifications
12:31
Laravel
Рет қаралды 52 М.
Top 5 Free Mapping Tools
14:05
Swyvl
Рет қаралды 23 М.
Get started with Laravel events and listeners
15:37
Andrew Schmelyun
Рет қаралды 18 М.
Push Notifications with Service worker
14:15
Akilesh Rao
Рет қаралды 28 М.
Laravel Push Notifications End to End Implementation (Web and Mobile)
27:09
I built a CHAT application in 5 MINUTES using Laravel and Pusher!
5:21
Laravel: The BEST way to handle exceptions
9:29
Przemysław Przyłucki
Рет қаралды 15 М.
How To Send Push Notifications With JavaScript?
18:51
Piyush Garg
Рет қаралды 36 М.