AMPUserNotificationCenterHandling 协议

用于手动处理 iOS 10 及更高版本前台推送通知的代理。

使用此代理,如果您用自定义逻辑实现了UNUserNotificationCenterDelegate协议。 您需要实现所有 UNUserNotificationCenterDelegate 的方法,并在 AMPUserNotificationCenterHandling 中调用相应的方法。

此委托的实现由 userNotificationCenterHandler 方法调用,位于 AMPAppMetricaPush 类.

Instance methods

-userNotificationCenterWillPresentNotification:

您应该在 userNotificationCenter:willPresentNotification:withCompletionHandler: 的实现中调用此方法。

userNotificationCenterDidReceiveNotificationResponse:

您应该在 userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: 的实现中调用此方法。

-用户通知中心打开通知设置:

您应该在 userNotificationCenter:openSettingsForNotification: 的实现中调用此方法。

Method descriptions

-userNotificationCenterWillPresentNotification:

- (void)userNotificationCenterWillPresentNotification:(UNNotification *)notification

您应该在 userNotificationCenter:willPresentNotification:withCompletionHandler: 的实现中调用此方法。

参数:

通知

UNNotification 的实例.

-userNotificationCenterDidReceiveNotificationResponse:

- (void)userNotificationCenterDidReceiveNotificationResponse:(UNNotificationResponse *)response;

您应该在 userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler: 的实现中调用此方法。

参数:

通知

UNNotificationResponse 的实例.

-userNotificationCenterOpenSettingsForNotification:

- (void)userNotificationCenterOpenSettingsForNotification:(nullable UNNotification *)notification API_AVAILABLE(ios(12.0));

您应该在 userNotificationCenter:openSettingsForNotification: 的实现中调用此方法。

参数:

通知

UNNotification的实例。