feat(push notification): menambahkan notification click di worker nya dan menambahan url nya di componentnya

This commit is contained in:
Yoga Pangestu 2025-11-16 16:15:53 +07:00
parent 55c0defdbe
commit 78661af615
4 changed files with 9 additions and 0 deletions

View File

@ -89,6 +89,7 @@ public function register()
[ [
'title' => 'Member Baru', 'title' => 'Member Baru',
'body' => 'Seorang member baru baru saja bergabung. Cek selengkapnya di aplikasi', 'body' => 'Seorang member baru baru saja bergabung. Cek selengkapnya di aplikasi',
'url' => route('studio.loyalty.customer.index'),
], ],
); );

View File

@ -78,6 +78,7 @@ public function create()
[ [
'title' => 'Order', 'title' => 'Order',
'body' => $result['message'], 'body' => $result['message'],
'url' => route('studio.finance.payroll.index'),
], ],
); );

View File

@ -97,6 +97,7 @@ public function save()
[ [
'title' => 'Order', 'title' => 'Order',
'body' => 'Ada order baru masuk dengan nominal '.$result->total, 'body' => 'Ada order baru masuk dengan nominal '.$result->total,
'url' => route('studio.manage.order.index'),
], ],
); );

View File

@ -12,3 +12,9 @@ self.addEventListener('push', (event) => {
}) })
); );
}) })
self.addEventListener('notificationclick', (event) => {
event.waitUntil(
clients.openWindow(event.notification.data.url)
);
})