File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -345,6 +345,9 @@ export class ServiceWorker {
345345 if ( ! notification )
346346 return null ;
347347
348+ if ( ! ServiceWorker . browserSupportsConfirmedDelivery ( ) )
349+ return null ;
350+
348351 // Received receipts enabled?
349352 if ( notification . rr !== "y" )
350353 return null ;
@@ -375,6 +378,19 @@ export class ServiceWorker {
375378 return await OneSignalApiBase . put ( `notifications/${ notification . id } /report_received` , postData ) ;
376379 }
377380
381+ /**
382+ * Confirmed Delivery isn't supported on Safari since they are very strict about the amount
383+ * of time you have to finish the onpush event. Spending to much time in the onpush event
384+ * will cause the push endpoint to become revoked!, causing the device to stop receiving pushes!
385+ *
386+ * iPadOS 16.4 it was observed to be only about 10 secounds.
387+ * macOS 13.3 didn't seem to have this restriction when testing up to a 25 secound delay, however
388+ * to be safe we are disabling it for all Safari browsers.
389+ */
390+ static browserSupportsConfirmedDelivery ( ) : boolean {
391+ return ! bowser . safari
392+ }
393+
378394 /**
379395 * Gets an array of active window clients along with whether each window client is the HTTP site's iFrame or an
380396 * HTTPS site page.
You can’t perform that action at this time.
0 commit comments