【发布时间】:2018-02-14 07:24:12
【问题描述】:
我正在使用 Urban Airship 在我的 iOS 10 (Swift) 应用程序中接收推送通知。我遇到以下问题,请求您帮助解决。
应用在前台运行时无法隐藏通知
为了隐藏通知,我尝试了以下任务..
移除委托方法 func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent 通知:UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void)
我试图通过 completionHandler(UNNotificationPresentationOptionNone) 转义/隐藏通知 toast,但“UNNotificationPresentationOptionNone”不再可用。
completionHandler([]) -- 这不起作用。 我试图在
中传递“UNNotificationPresentationOptionNone”
清除通知
如何从列表中清除/删除传递的(一旦用户阅读或取消)通知并相应地更新徽章图标。
谢谢
【问题讨论】:
-
@rmaddy 你能告诉我,当应用程序处于后台并收到通知时会执行哪个方法?
标签: ios swift notifications ios10