UIApplicationDelegate.ReceivedRemoteNotification 方法

定义

指示应用程序收到了远程通知。

[Foundation.Export("application:didReceiveRemoteNotification:")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 10, 0, ObjCRuntime.PlatformArchitecture.None, "Use 'UNUserNotificationCenterDelegate.WillPresentNotification/DidReceiveNotificationResponse' for user visible notifications and 'ReceivedRemoteNotification' for silent remote notifications.")]
public virtual void ReceivedRemoteNotification (UIKit.UIApplication application, Foundation.NSDictionary userInfo);
abstract member ReceivedRemoteNotification : UIKit.UIApplication * Foundation.NSDictionary -> unit
override this.ReceivedRemoteNotification : UIKit.UIApplication * Foundation.NSDictionary -> unit

参数

application
UIApplication

对调用此委托方法的 UIApplication 的引用。

userInfo
NSDictionary

其“aps”键包含与通知相关的信息的字典

属性

注解

字典userInfo将具有一个将返回另一个 NSDictionary的键aps。 该字典可以包含以下键:

密钥类型说明
警报字符串 或 NSDictionary如果键的 alert 值为 , string则该字符串将是具有两个按钮的警报文本:“关闭”和“查看”。 如果应用程序用户选择“查看”,应用程序将启动。 如果值为 , NSDictionary它将包含一系列与本地化相关的键。
badgeInteger要显示在应用图标锁屏提醒上的数字。 如果为 0,则会删除锁屏提醒。 如果 null为 ,则不应更改锁屏提醒。
soundString应用捆绑包中声音文件的名称。 如果文件不存在或值为“default”,将播放默认警报声音。
content-availableInteger值为 1 表示新内容可用。 这适用于报刊应用和后台内容下载。

适用于