Closed arretnet closed 6 months ago
This is a Javascript issue with the browser (if it is). Not a PHP issue. This repository contains only the php-script to allow notifications over your webserver.
Your error has to do with the browser or with the W3C-API*. Not with this library.
What is applicationServerKey
?
Hi,
thanks for this answer
I'm not sure I really understand what you mean by "What is |applicationServerKey|?" but if you mean the value it's 'BER7JSVXnZY2jDWAmuK9OT719QNjRzwE2XCKSp74stJxbTmueVKGUeOPrgiOuTTZs-rDCJBEjVpkozhsBXXNH4M';
I saw that Firefox Android needs bridge with Google Cloud Messaging, maybe it's the reason of the issue.
Best regards
Cordialement. Patrice Coacolo
l' @rrêt du NET https://arret-net.fr
1 rue du Repos 38450 Vif
06 19 96 36 86 Le 30/11/2020 à 12:05, Adriano a écrit :
This is a Javascript issue with the browser (if it is). Not a PHP issue. This repository contains only the php-script to allow notifications over your webserver.
Your error has to do with the browser or with the W3C-API*. Not with this library.
What is |applicationServerKey|?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/web-push-libs/web-push-php/issues/308#issuecomment-735717681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH6FMUJELH5BRHDPZBTGFNDSSN367ANCNFSM4UGSUOCQ.
Before you can use the push notification, you have to setup the webpage and browser.
Your subscription is null, before you are using this library or any push notification functionality.
You can check my webpage (test script) if you want to test your browser for notifications: https://projects.petrucci.ch/webpush/
And no, you don't need Google Cloud Messaging, if you have your own php-server.
You have to: 1- enable "normal" notifications (browser) 2- register a service worker (javascript) 3- register push notification (javascript-browser) 4- send push notification from your server 5- get data from the browser
Your error occurs in step 3. This library is for step 4, so it can't be the cause.
thanks,
step 1 one and step 2 are ok and it works well on Firefox Desktop, Chrome Desktop and Chrome Android( mobile)
I get the notifications with this three "browser" all is right.
The issue is only with Firefox android.
Thanks for the url, I'll try with it
Cordialement. Patrice Coacolo
l' @rrêt du NET https://arret-net.fr
1 rue du Repos 38450 Vif
06 19 96 36 86 Le 30/11/2020 à 13:25, Adriano a écrit :
Before you can use the push notification, you have to setup the webpage and browser.
Your subscription is null, before you are using this library or any push notification functionality.
You can check my webpage (test script) if you want to test your browser for notifications: https://projects.petrucci.ch/webpush/ https://projects.petrucci.ch/webpush/
And no, you don't need Google Cloud Messaging, if you have your own php-server.
You have to: 1- enable "normal" notifications (browser) 2- register a service worker (javascript) 3- register push notification (javascript-browser) 4- send push notification from your server 5- get data from the browser
Your error occurs in step 3. This library is for step 4, so it can't be the cause.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/web-push-libs/web-push-php/issues/308#issuecomment-735755627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH6FMUPZ3G6OD2CZMFTI7I3SSOFMFANCNFSM4UGSUOCQ.
With your url https://projects.petrucci.ch/webpush/ https://projects.petrucci.ch/webpush/ I get the same error on Firefox android : "Subscription null"
I've my answer, the browser is the issue
It's Firefox Daylight version 83.1.0
Cordialement. Patrice Coacolo
l' @rrêt du NET https://arret-net.fr
1 rue du Repos 38450 Vif
06 19 96 36 86 Le 30/11/2020 à 13:25, Adriano a écrit :
Before you can use the push notification, you have to setup the webpage and browser.
Your subscription is null, before you are using this library or any push notification functionality.
You can check my webpage (test script) if you want to test your browser for notifications: https://projects.petrucci.ch/webpush/ https://projects.petrucci.ch/webpush/
And no, you don't need Google Cloud Messaging, if you have your own php-server.
You have to: 1- enable "normal" notifications (browser) 2- register a service worker (javascript) 3- register push notification (javascript-browser) 4- send push notification from your server 5- get data from the browser
Your error occurs in step 3. This library is for step 4, so it can't be the cause.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/web-push-libs/web-push-php/issues/308#issuecomment-735755627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH6FMUPZ3G6OD2CZMFTI7I3SSOFMFANCNFSM4UGSUOCQ.
Hello @arretnet are you aware if it's possible that when one clicks on a notification if it's possible that it can open up the browser and go to a specific website and or section on that website?
Setup
Problem
Hi, I use this library with Firefox desktop , Chrome desktop and Chrome androïd and all is right, it's work fine. But with Firefox androïd I get a subscription with value=null
Expected
I want to get subscription
Features Used
Example / Reproduce Case
Here is the code I use
function checkNotificationPermission() { return new Promise((resolve, reject) => { if (Notification.permission === 'denied') {
// Here I get granted value it's ok //
} function push_subscribe() { changePushButtonState('computing');
/// here I get subscription =null console.log("subscription", subscription); ///
}
Other