web-push-php
web-push-php copied to clipboard
/fcm/send vs /wp is confusing
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.