web-push-libs / web-push-php

Web Push library for PHP
MIT License
1.69k stars 295 forks source link

Is there a way to "get the UserAgent" for a specific subscription? #351

Closed ghnp5 closed 11 months ago

ghnp5 commented 2 years ago

When the user subscribes, I log the current UserAgent for that subscription.

However, as browsers update, the UserAgent eventually becomes outdated.

Is there a way to request the latest UserAgent for a specific subscription, to keep this info updated? (server-side)

hanifzekri commented 11 months ago

Hi there As you may know, each subscription has specific auth, so each time user back to your site, you can check auth key with database and if the recorded agent is different, you can update it.

ghnp5 commented 11 months ago

Thank you. Yeah, I've just looked at the code and I'm doing that.

This question is from over a year ago, so I can't remember why exactly I needed this, but I probably found a workaround.

The question was more for server-side, maybe for cases where the users haven't logged in for a while.

I appreciate your reply 👍🏼