Ios 推送通知操作未在Swift中显示?

Ios 推送通知操作未在Swift中显示?,ios,swift,push-notification,Ios,Swift,Push Notification,我目前有一个iOS项目,但推送通知操作没有显示。这是我正在测试的有效载荷体: $body['aps'] = array( 'alert' => $message, 'sound' => 'default', 'link_url' => $url, 'category' => 'NEWS_CATEGORY', ); 以下是应用程序委托中的registerForPushNotifications: func registerForPushNotific

我目前有一个iOS项目,但推送通知操作没有显示。这是我正在测试的有效载荷体:

$body['aps'] = array(
  'alert' => $message,
  'sound' => 'default',
  'link_url' => $url,
  'category' => 'NEWS_CATEGORY',
  );
以下是应用程序委托中的registerForPushNotifications:

 func registerForPushNotifications(application: UIApplication) {

    //allows notification actions by setting catagories
    let viewAction = UIMutableUserNotificationAction()
    viewAction.identifier = "VIEW_IDENTIFIER"
    viewAction.title = "View"
    viewAction.activationMode = .Foreground

    let newsCategory = UIMutableUserNotificationCategory()
    newsCategory.identifier = "NEWS_CATEGORY"
    newsCategory.setActions([viewAction], forContext: .Default)

    let notificationSettings = UIUserNotificationSettings(forTypes: [.Badge, .Sound, .Alert], categories: [newsCategory])
  }

非常感谢您提供有关通知操作未显示原因的任何帮助

似乎忘记了将实际寄存器设置添加到应用程序中。加

application.registerUserNotificationSettings(notificationSettings)

let notificationSettings=ui用户notificationSettings(forTypes:[.Badge、.Sound、.Alert],categories:[newscope])之后

您能帮我回答这个问题吗请: