Helen Araya
Helen Araya

Reputation: 1946

Daily Notification

I am looking on some way to notify users with a custom message every 8 AM every day. I need to do some data processing before I display the notification(Get the number of patients for the past 24 hours) and notify the user about the data I got using some sort of notification.

I tried to create a local notification that fires every 8 am in the morning and that is working except It is requiring me to specify it's alert message and alert body at the time of it's creation instead of on before alert show.

I am considering push notifications but I am not sure how complex this may be.

How can I accomplish that?

Upvotes: 0

Views: 208

Answers (2)

Kris Gellci
Kris Gellci

Reputation: 9687

A hack around can be to request background fetch time from the OS. You can reschedule the notification every time the background time is allotted to you with the current number of patients in the last 24 hrs. Just compute it every time the system gives you background time.

See this article for scheduling background fetch time

Upvotes: 1

Dima
Dima

Reputation: 23634

You can't do what you're asking with local notifications. They 100% require static content up front. You'll need to use push notifications to do this dynamically.

Upvotes: 0

Related Questions