Skip to content

Commit 8e70e10

Browse files
committed
Fix: Firefox on Android
Workaround for this issue: web-push-libs/web-push-php#108
1 parent d4cde45 commit 8e70e10

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

application/Model/Email.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,13 @@ private function execPushNotifications() {
499499
if ($stmt->rowCount() > 0) {
500500
error_log('Datenbankeinträge Push-Subscriptions: ' . $stmt->rowCount());
501501

502+
$webPush = new WebPush($push_auth);
502503
$notifications = array();
503504
foreach ($stmt->fetchAll() as $row) {
504505
error_log('Push-Sub: ' . $row['endpoint']);
506+
if (strpos($row['endpoint'], 'mozilla') > 0) {
507+
$webPush->setAutomaticPadding(0);
508+
}
505509
$notifications[] = [
506510
'subscription' => Subscription::create([
507511
'endpoint' => $row['endpoint'],
@@ -514,7 +518,6 @@ private function execPushNotifications() {
514518
error_log('payload: ' . $notifications[sizeof($notifications)-1]['payload']);
515519
}
516520

517-
$webPush = new WebPush($push_auth);
518521
foreach ($notifications as $notification) {
519522
$webPush->sendNotification($notification['subscription'], $notification['payload']);
520523
}

0 commit comments

Comments
 (0)