alexalok / dotAPNS

dotAPNS is a library used to send push notifications to Apple devices using Apple Push Notification service via HTTP/2 API.
Apache License 2.0
114 stars 34 forks source link

Question | Offtopic - Delay in notification delivery #115

Closed raghav18gupta closed 1 year ago

raghav18gupta commented 1 year ago

Web service sending notifications to Apple Wallet Passes to update its balance, but around 30% of the times, balance update happens after a delay. Is there any way to ensure that it happens instantaneously? I am using ApplePushType.Background and pass certificate for Auth. Also tried with Alert push type, setting expiration header to UtcNow + 5 mins, but the results are same.

alexalok commented 1 year ago

ApplePushType.Background is unreliable, i.e. its delivery can be postponed arbitrarily by APNs. It is also subject to rate limit on a per-day basis.

Alert however should be received without a noticeable delay. Do you see an alert message on your phone after sending an Alert push? If so, does this also happen after some delay?

raghav18gupta commented 1 year ago

@alexalok As I send to notification to inbuilt Apple Wallet application, there is no notification as such even if send using Alert type. Apple Wallet to update its balance, which in turn calls below to APIs of our service:

  1. webServiceURL/version/devices/deviceLibraryIdentifier/registrations/passTypeIdentifier?passesUpdatedSince=tag
  2. webServiceURLversion/passes/passTypeIdentifier/serialNumber

Service sends a push notification to api.push.apple.com:443 using HTTP/2 protocol and uses Pass Type ID with NFC Certificate for auth, with success every time and the wallet invokes the above two APIs hence balance gets updated.

alexalok commented 1 year ago

Ah, I see. Sorry, I don't have any experience with Apple Wallet so can't really be of much help there. Perhaps the delay is by design.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.