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

$report->isSuccess() always returns true with web.push.apple.com

Open JoJoAction opened this issue 1 year ago • 3 comments

Hello there, thank you @Minishlink for this code. Generally, it works very well.

Just one problem with notifications sent to web.push.apple.com:

In general, sending notifications to web.push.apple.com works fine. But:

$report->isSuccess() always returns true, even if the subscription has gone (because the user unsubscribed).

Is there a way to fix this? Best regards!

JoJoAction avatar Jan 24 '24 19:01 JoJoAction

$report->isSuccess() always returns true, even if the subscription has gone (because the user unsubscribed).

isSuccess() is true if it was successful submitted and confirmed by the server. Is may not represent the current subscription status because of caching, lack of unsubscribe or privacy protection.

Rotzbua avatar Jan 29 '24 16:01 Rotzbua

Thank you for your feedback.

I just explicitly unsubscribed from three different subscriptions, to endpoints at wns2-am3p.notify.windows.com, fcm.googleapis.com and web.push.apple.com. Aferwards, I used this code to send a notification to all three.

Whilst isSuccess() returned false for am3p.notify.windows.com and fcm.googleapis.com (as it should), it returned true for web.push.apple.com (which is not correct).

So this seems to be an issue only for endpoints at web.push.apple.com.

JoJoAction avatar Jan 30 '24 14:01 JoJoAction

If web.push.apple.com does still return a 201 and not a 410 status code then there is nothing what this library can do. If you unsubscribe correctly then it seems a bug on apples side. Their documentation do not mention different behavior: https://developer.apple.com/documentation/usernotifications/sending_web_push_notifications_in_web_apps_and_browsers

Rotzbua avatar Jan 30 '24 15:01 Rotzbua

If web.push.apple.com does still return a 201 and not a 410 status code then there is nothing what this library can do. If you unsubscribe correctly then it seems a bug on apples side. Their documentation do not mention different behavior: https://developer.apple.com/documentation/usernotifications/sending_web_push_notifications_in_web_apps_and_browsers

Thank you! I just wanted to be sure if this is a bug on Apple's side, not on this library's side. If it is indeed Apple's fault, then of course there is nothing this library can do about it.

Thank you for your quick response anyway.

JoJoAction avatar Mar 06 '24 15:03 JoJoAction