简体   繁体   English

iOS 8推送通知操作在后台激活模式下不起作用

[英]iOS 8 Push Notification Action not working in background activation mode

I am experiencing a problem with the following lines of code : 我在以下几行代码中遇到问题:

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

When responding to this action of the push notification, it will always open up the application rather than performing task in the background. 当响应推送通知的此操作时,它将始终打开应用程序,而不是在后台执行任务。

您可以设置activationModeacceptActioncancelAction

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM