Notifications support
arafatamim opened this issue · comments
Tamim Arafat commented
Description
Send a push notification 5 mins before, or at the time of, upcoming prayer.
Mohamed Daahir commented
I have been playing with the notification trigger API which is only supported in chrome behind a feature flag
async function scheduleNotification() {
const registration = await navigator.serviceWorker.getRegistration();
registration.showNotification('Salah Duhr', {
body: 'Salah Duhr has arrived',
showTrigger: new TimestampTrigger(Date.now() + 10_000) // notification will be triggered after 10 seconds
})
}
I haven't checked yet but it might be possible to use this with the periodic background sync API to schedule a batch of notifications every 7 days.
An alternative approach that doesn't require any bleeding edge API would be to notify users if waqt
app hasn't been closed yet.
Tamim Arafat commented
Haven't heard of that API before. Could be useful.