Local-only iOS Notifications

Hello! I'm currently trying to add local push notifications to my iOS app (React Native + Expo). Most of the guides and documentation I found online revolve around remote notification capabilities and APNS - I don't need this. The app will register a background task to periodically check if it should trigger a notification, fully local. I'm running into issues when adding the push notification capabilities, saying I need a new provisioning profile and to modify the App ID, which prompts me to set up certificates to communicate with APNS - which I don't need.

So I was wondering: Is it possible to build an app without the remote notification setup that can still trigger local notifications? Or is it kind of all-or-nothing, and I need to set up remote notifications as well even if I only need to trigger them locally?

Couldn't really find much online about this, and before I invalidate my current certificates and go through a bunch of redundant setup, I thought I'd ask here.

Help would be greatly appreciated! Thank you!

Answered by Engineer in 842019022

You can certainly trigger local notifications directly from your app as explained in Scheduling a notification locally from your app

The question is, how do you expect to use a background task to periodically check if it should trigger a notification.

Such background tasks are limited and throttled, and you may find it difficult to implement such a mechanism.

You may want to read about iOS Background Execution Limits before making decisions on how to implement your notifications. While it is not an all or nothing matter, you may find it more suitable to actually implement push notifications if the trigger for the notification is outside of your app of the device.


Argun Tekant /  DTS Engineer / Core Technologies

Accepted Answer

You can certainly trigger local notifications directly from your app as explained in Scheduling a notification locally from your app

The question is, how do you expect to use a background task to periodically check if it should trigger a notification.

Such background tasks are limited and throttled, and you may find it difficult to implement such a mechanism.

You may want to read about iOS Background Execution Limits before making decisions on how to implement your notifications. While it is not an all or nothing matter, you may find it more suitable to actually implement push notifications if the trigger for the notification is outside of your app of the device.


Argun Tekant /  DTS Engineer / Core Technologies

@Engineer thank you! That is important information. I was indeed of the impression that running a fetch and check every few minutes was possible. Looks like I will use actual remote push notifications. Much appreciated!

Local-only iOS Notifications
 
 
Q