行动按钮在前景显示app

时间:2016-06-16 10:31:51

标签: ios swift apple-push-notifications

如果点击通知,它将打开应用程序,但是当我向通知添加按钮,并且用户按下按钮时应用程序停留在后台,我想要点击通知进行相同的操作(打开应用程序在前端)

它可能吗?

解决!谢谢你的回答:

    let actionButton = UIMutableUserNotificationAction()
    actionButton.identifier = identifier
    actionButton.title = title
    actionButton.activationMode = UIUserNotificationActivationMode.Foreground
    actionButton.authenticationRequired = true
    actionButton.destructive = false

1 个答案:

答案 0 :(得分:1)

如果您希望通过该操作打开该应用,请将您的操作bindingContext.Result = ModelBindingResult.Success(bindingContext.ModelName, model); 设置为return Task.FromResult(...)