[3.3][RC] Browser Push Notifications

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
rxu
Extensions Development Team
Posts: 3804
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: [3.3][RC] Browser Push Notifications

Post by rxu »

halil16 wrote: Fri May 17, 2024 9:24 am.jpg
Avatar type: Gravatar, remote avatar, uploaded avatar, avatar gallery.
User avatar
halil16
Registered User
Posts: 1364
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: [3.3][RC] Browser Push Notifications

Post by halil16 »

Oh sorry. Uploaded avatar.
Buy me a coffee
Hire me for your phpBB board.
Introducing Mobile Upgrade! Make your phpBB board like an app!
O BeldeThatTowns*for sale*
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
rxu
Extensions Development Team
Posts: 3804
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: [3.3][RC] Browser Push Notifications

Post by rxu »

Can you check the content of the push_data column of the phpbb_wpn_notification_push table? Any record where "avatar":"http..." part is there.
User avatar
halil16
Registered User
Posts: 1364
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: [3.3][RC] Browser Push Notifications

Post by halil16 »

push-data.jpg
Is it a problem that I added avatars later?

A couple of times I got a pre-notification like “Edge updated in the background”, clicked on it and got the normal notification.

Also, in version 3.3.12-RC1, when I click submit for PM, it does not send, it previews. if I click again, it sends.
You do not have the required permissions to view the files attached to this post.
Buy me a coffee
Hire me for your phpBB board.
Introducing Mobile Upgrade! Make your phpBB board like an app!
O BeldeThatTowns*for sale*
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
rxu
Extensions Development Team
Posts: 3804
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: [3.3][RC] Browser Push Notifications

Post by rxu »

halil16 wrote: Fri May 17, 2024 5:01 pm Is it a problem that I added avatars later?
Sure. It uses current avatar (if any), not the one added later.
halil16 wrote: Fri May 17, 2024 5:01 pm when I click submit for PM, it does not send, it previews. if I click again, it sends.
Not sure it's related to this extension in some way.
User avatar
halil16
Registered User
Posts: 1364
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: [3.3][RC] Browser Push Notifications

Post by halil16 »

rxu wrote: Fri May 17, 2024 5:14 pm Sure. It uses current avatar (if any), not the one added later.
I may have misrepresented it. Sorry. There was an avatar when the notification was sent.
Buy me a coffee
Hire me for your phpBB board.
Introducing Mobile Upgrade! Make your phpBB board like an app!
O BeldeThatTowns*for sale*
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5933
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: [3.3][RC] Browser Push Notifications

Post by MattF »

halil16 wrote: Fri May 17, 2024 5:36 pm
rxu wrote: Fri May 17, 2024 5:14 pm Sure. It uses current avatar (if any), not the one added later.
I may have misrepresented it. Sorry. There was an avatar when the notification was sent.
That notification's avatar would have been for whoever created the post, so "tester" would have needed to have an avatar at the time their post was made.

For example, this is on my test forum, from it's database:

Code: Select all

{
  "heading":"Testing Board",
  "title":"Post approval request by tester1:",
  "text":"\"Welcome to phpBB3\"",
  "url":".\/mcp.php?i=queue&mode=approve_details&p=4",
  "avatar":"https:\/\/testforum:8890\/download\/file.php?avatar=58_1716004251.jpg"
}
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
halil16
Registered User
Posts: 1364
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: [3.3][RC] Browser Push Notifications

Post by halil16 »

I've been misunderstood before, but what I really meant was this:

I created a new test account and uploaded its avatar before subscribing to push notifications and taking any action that would generate a notification. This is what it looks like in the database:

Code: Select all

{"heading":"yourdomain.com","title":"Post approval request by tester2:","text":"\"Welcome to phpBB3\"","url":".\/mcp.php?i=queue&mode=approve_details&p=16","avatar":"https:\/\/x.com\/bb3312\/download\/file.php?avatar=59_1716007102.jpg"}
But again I can't see the avatar:

pushfromtester21.jpg

Others are the same. Maybe I didn't quite get it. Is there anything I might have done wrong?
You do not have the required permissions to view the files attached to this post.
Last edited by halil16 on Sat May 18, 2024 5:54 am, edited 1 time in total.
Buy me a coffee
Hire me for your phpBB board.
Introducing Mobile Upgrade! Make your phpBB board like an app!
O BeldeThatTowns*for sale*
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
rxu
Extensions Development Team
Posts: 3804
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: [3.3][RC] Browser Push Notifications

Post by rxu »

Database data looks correct now. Could you check if \ext\phpbb\webpushnotifications\styles\all\template\push_worker.js.twig code is correct on your server, it should contain the line

Code: Select all

icon: response.avatar,
User avatar
halil16
Registered User
Posts: 1364
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: [3.3][RC] Browser Push Notifications

Post by halil16 »

Yes. to line 39.

When I send a PM to the test account, the link to my avatar seems to be added to the push. But the avatar does not appear in push not...
Buy me a coffee
Hire me for your phpBB board.
Introducing Mobile Upgrade! Make your phpBB board like an app!
O BeldeThatTowns*for sale*
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
rxu
Extensions Development Team
Posts: 3804
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: [3.3][RC] Browser Push Notifications

Post by rxu »

Then it's hard to tell what happens, are there any related errors in server's error log?
We've tested RC3 code before release on localhost as well as on production and avatars worked.
Probably purging the board cache (via ACP or directly from the server) and clearing browser's cache would be an option to try in this case.
User avatar
halil16
Registered User
Posts: 1364
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: [3.3][RC] Browser Push Notifications

Post by halil16 »

I deactivated the extension, cleaned it, reactivated it and set it up. Now the avatar shows up in notifications from test accounts but not mine. It's strange. I've also cleared the cache several times. No record in the error logs.

One of my clicks on the notifications opened this page: /app.php/user/push/worker

It would be nice if we could make an arrangement to put a default site icon for notifications such as approval. I will try it on my main board in 3.3.12 output, but I think it will show the site icon by default when in PWA/web app, right?
Buy me a coffee
Hire me for your phpBB board.
Introducing Mobile Upgrade! Make your phpBB board like an app!
O BeldeThatTowns*for sale*
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
rxu
Extensions Development Team
Posts: 3804
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation

Re: [3.3][RC] Browser Push Notifications

Post by rxu »

No avatar - no icon (empty). Displaying site icon (favicon) is not provided currently.
User avatar
halil16
Registered User
Posts: 1364
Joined: Fri Jul 24, 2020 11:30 pm
Location: Turkiye
Name: Halil

Re: [3.3][RC] Browser Push Notifications

Post by halil16 »

I'm not sure, maybe Android or iOS can use the automatic app icon when there is no avatar.?
On the other hand, if the user does not have an avatar, it may make sense to add the no_avatar image. I looked at the codes a little bit, can I do it with if else?

When I double click on <label for="subscribe_webpush"></label>, it gives the following error in the console:

POST https://x.com/bb3312/app.php/user/push/subscribe 400 (Bad Request)
subscribeButtonHandler @ webpush.js?assets_version=8:173

It doesn't seem like a problem, but I wanted to say it.

If I can't put a button to subscribe to notifications on other pages, can I use PHP conditional statements for a info panel where I can show notifications according to whether they are on or off?

Thank you.
Buy me a coffee
Hire me for your phpBB board.
Introducing Mobile Upgrade! Make your phpBB board like an app!
O BeldeThatTowns*for sale*
"The day we will need ideas more than possessions, we will find the secret to true wealth." - Peyami Safa
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 5933
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: [3.3][RC] Browser Push Notifications

Post by MattF »

halil16 wrote: Sat May 18, 2024 6:00 am Yes. to line 39.

When I send a PM to the test account, the link to my avatar seems to be added to the push. But the avatar does not appear in push not...
Try using a completely different browser that you have not used yet with this.

The issue is probably a stale file in your browser that can't be updated by clearing browser or forum caches, which is something we are looking into.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.

Return to “Extensions in Development”