I have a certain feature in my app called "Reminders", which is just a MySQL table using the Prisma ORM. Here is the table schema:
model Tasks {
id Int @id @default(autoincrement())
name String
note String?
frequency String
on String
lastDone DateTime
property Property? @relation(fields: [propertyId], references: [id])
propertyId String?
}
/api/property/tasks
(POST) which returns the current task list
sessionToken
(which never expires)nextDue
is already calculated based on the frequency
and on
values. (This returns a new Date()
)nextDate
, even if the browser tab is closed?Thank you!
EDIT: I'm OK with a solution without using the OneSignal API preferably.
I guess you are looking for two capabilities of service workers (learn about all available capabilities here):
You can follow these two reference guides by Microsoft:
Do not confuse yourself between Push API & Notifications API. You are only looking for notification functionality not push.