UIKit.UIApplicationDelegate.PerformFetch Method
Background support: Invoked by the operating system to allow an application to download data.

Syntax

[Foundation.Export("application:performFetchWithCompletionHandler:")]
[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_7_0)]
public virtual void PerformFetch (UIApplication application, [ObjCRuntime.BlockProxy(typeof(ObjCRuntime.Trampolines/NIDActionArity1V4))] Action<UIBackgroundFetchResult> completionHandler)

Parameters

application
Handle to the UIApplication.
completionHandler
Callback to invoke to notify the operating system of the result of the background fetch operation.

Remarks

This method is part of iOS 7.0 new background fetch support. This method is invoked if your Entitlements list the "fetch" background operation and after you have enabled fetching by calling the UIApplication.SetMinimumBackgroundFetchInterval method.

Once that happens the operating system will determine the appropriate time to wake up your application to allow it to download data. When it does that, it will first call the UIApplicationDelegate.FinishedLaunching method and then will invoke this method.

This method should download the data from the network and before it completes, it must invoke the provided callback with the appropriate status code to notify the operating system of the background fetch operation (new data was downloaded, there was a network connection problem or no new data was found).

Upon completion, you must notify the operating system of the result of the data transfer by invoking the provided callback.

Important: failure to call the provided callback method with the result code before this method completes will cause your application to be terminated.

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0