共用方式為


CPApplicationDelegate.DidReceiveRemoteNotification 方法

定義

遠端背景通知支援:當您的應用程式收到遠端通知時,由作業系統叫用。

[Foundation.Export("application:didReceiveRemoteNotification:fetchCompletionHandler:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 10, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 7, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual void DidReceiveRemoteNotification (UIKit.UIApplication application, Foundation.NSDictionary userInfo, Action<UIKit.UIBackgroundFetchResult> completionHandler);
abstract member DidReceiveRemoteNotification : UIKit.UIApplication * Foundation.NSDictionary * Action<UIKit.UIBackgroundFetchResult> -> unit
override this.DidReceiveRemoteNotification : UIKit.UIApplication * Foundation.NSDictionary * Action<UIKit.UIBackgroundFetchResult> -> unit

參數

application
UIApplication

UIApplication 的控制碼。

userInfo
NSDictionary
completionHandler
Action<UIBackgroundFetchResult>

要叫用的回呼,以通知作業系統背景擷取作業的結果。

屬性

備註

此方法是 iOS 7.0 新遠端通知支援的一部分。 如果您的權利列出已設定「遠端通知」背景作業,而且您會收到遠端通知,就會叫用這個方法。

完成時,您必須叫用提供的回呼,通知作業系統方法的結果。

重要事項:在此方法完成之前,無法使用結果碼呼叫提供的回呼方法,會導致您的應用程式終止。

適用於