【问题标题】:Get Action of Push Notification Allow Button获取推送通知允许按钮的操作
【发布时间】:2019-08-16 11:21:02
【问题描述】:

我正在开发一个 ios 应用程序, 现在我想获得推送通知的允许按钮的操作, 一旦用户选择推送通知选项之一(不允许,允许),用户将被推送到第二个视图控制器。

【问题讨论】:

标签: ios swift iphone push-notification


【解决方案1】:

您需要在 AppDelegate 类中调用这些方法。

//Ios 10 delegates for Push Notifications
        func userNotificationCenter( _ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler   completionHandler: @escaping ( _ options:   UNNotificationPresentationOptions) -> Void){
            print("Handle push from foreground")
        }
        func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void){
            print("Handle push from background or closed")
        }

【讨论】:

  • 感谢您的帮助!,对不起,我无法为您的答案投票,我没有足够的重复。
  • 没有问题,您以后可以解决。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-06-16
  • 2023-03-10
  • 1970-01-01
  • 1970-01-01
  • 2013-10-16
  • 2016-08-18
  • 1970-01-01
相关资源
最近更新 更多