Thank you for your answer. I made it work
In app delegate:
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
// Here return .newData after you checked if you have any new data, or .noData in case of nothing to update.
// A request to the server can be made to check if new data are available for the app
completionHandler(UIBackgroundFetchResult.newData)
}
For those who are using firebase push notification, I use this: ["to" : token, "priority": "normal", "content_available": true] for silent notification
Topic:
Programming Languages
SubTopic:
Swift
Tags: