iOS 8推送通知操作无法在后台激活模式下工作

时间:2014-09-18 10:34:46

标签: ios push-notification ios8

我遇到以下代码行的问题:

    UIMutableUserNotificationAction *cancelAction = [[UIMutableUserNotificationAction alloc] init];
    cancelAction.identifier = kCancelIdentifier;
    cancelAction.title = @"Cancel";
    cancelAction.activationMode = UIUserNotificationActivationModeBackground;
    cancelAction.destructive = YES;
    cancelAction.authenticationRequired = YES;

在响应推送通知的此操作时,它将始终打开应用程序,而不是在后台执行任务。

1 个答案:

答案 0 :(得分:0)

您为activationMode而不是acceptAction设置了cancelAction