web-push-php icon indicating copy to clipboard operation
web-push-php copied to clipboard

/fcm/send vs /wp is confusing

Open armandn opened this issue 6 years ago • 0 comments

I just got bit by the issue #201. The problem is that the subscribed endpoint is 'https://fcm.googleapis.com/fcm/send/...' while the actual used endpoint is 'https://fcm.googleapis.com/wp/...'

After flushing each notification, I want to update the status in the db with the http status code or something like that and the only way I know of is by the endpoint.

At the very least, this replacement should be noted in the docs.

Even better would be a way to obtain the original endpoint.

For now I'll just use $endpoint = str_replace('googleapis.com/wp', 'googleapis.com/fcm/send', $report->getRequest()->getUri()->__toString()); to convert it back, but it's not elegant.

armandn avatar Jul 02 '19 08:07 armandn