rmvz3
rmvz3

Reputation: 1173

iOS, Can I schedule a local notification and notice it in AppDelegate with the app running in background?

I'm using local and silent remote notifications in the app I'm working at work. I need to launch some methods according to events received from our servers or from the app itself via silent remote and local notifications respectively. I have no problem with remote notifications with the app in foreground, background or with the notification touched but I can't get the scheduled local notifications to be noticed by AppDelegate if the app is running in background (I mean, without user tapping the banner).

Is this even possible? If yes, which parameter should I add to the notification or what method is supposed to be called when it arrives?

Upvotes: 0

Views: 392

Answers (1)

Lou Franco
Lou Franco

Reputation: 89222

I don't think it's possible to send a local notification that runs silently and starts your app. The normal way to do things like this is Background App Refresh:

https://developer.apple.com/documentation/uikit/app_and_environment/scenes/preparing_your_ui_to_run_in_the_background/updating_your_app_with_background_app_refresh

You have no control of the time. iOS will periodically give you short slices of time

Upvotes: 1

Related Questions