'Callback in iOS application in offline mode

Is there any way to get a call back in the iOS application in offline mode, even if the app is in the background or not running state?

What I meant was - Is there a way to perform a particular task in the app (e.g. scheduling local notifications) at scheduled time, if the app is in background or not running state?



Solution 1:[1]

I would recommend using Firebase[1]

Once an app has connected to Firebase, the client will cache data locally and be able to access data where there is an outstanding "on" callback even after a network connection is lost.

You can enable disk persistence, your app writes the data locally to the device so your app can maintain state while offline, even if the user or operating system restarts the app.

You can enable disk persistence with just one line of code. Database.database().isPersistenceEnabled = true

[1]https://firebase.googleblog.com/2015/05/announcing-mobile-offline-support_93.html

Solution 2:[2]

Creating a Notification Request init(identifier: String, content: UNNotificationContent, trigger: UNNotificationTrigger?) Creates a notification request object that you use to schedule a notification. UNNotificationRequest

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ARANYA MUKHERJEE
Solution 2 hamit seyrek