I'm trying to get a background fetch up and running in an iPhone app.
I'd like the app to notify the user with a notification that a new item has been fetched from a server.
And added the following code in appDelegate & I have the background mode checked in Capabilities:
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UIApplication.shared.setMinimumBackgroundFetchInterval(30)
.
.
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> ())
{
debugPrint("**** Fetch complete")
}
When I minimise the app how can I get it to send a notification to the user that a new item is available? What am I missing above?
Thanks