1

Hi I'm new to Swift programming. So I have the following function:

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
        ...some tasks...
        // want to call completionHandler here!
    }

This function runs when the phone receives a silent push notification. I was wondering if it was possible to run a custom completion handler upon didReceiveRemoteNotification method finishing?

If this is not possible, and completionHandler is some Swift specific function that is not up for change, what is its purpose? I've done some research and all I see is people simply calling completionHandler(UIBackgroundFetchResultNewData) towards the end of didReceiveRemoteNotification.

Thanks

M Rahman
  • 31
  • 5

0 Answers0