I'm researching how to add notifications to our app when an event is about to start. Other just-calendar apps provide this functionality but my research has me baffled about how they accomplish this.
According to the Apple docs: For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background:
Ok, well, a calendar app is none of these. If I schedule local notifications for my app to periodically wake up and check the calendar, that will not suffice, afaict from the reading I've done. Using the location monitoring option will not suffice - what if my user sits in his/her office all day long?
Calendar events can be added/deleted from other sources beside the phone, obviously, so setting up a bunch of notifications when my app starts is not a solution.
How do the calendar apps accomplish pre-event notifications? I have several calendar apps from the App Store and they do this so I know it can be done. My app will need to be acceptable by the App Store as well, so I can't fake VoIP as a solution.
Additional info: after more research, the apps I see doing this do not update when they've been shut down (duh), but they do some background updates. I'm still unclear as to how to keep my background process going for a long time (e.g. overnight).
Check this answer. You can subscribe to EKEventStoreChangedNotification to get notification for any change in calendar. https://stackoverflow.com/a/12324363/1187485
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With