确定UNNotificationResponse是否来自手表扩展程序或iOS应用

问题描述 投票:1回答:1

[使用UNUserNotificationCenterDelegatefunc userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void)中处理位置通知时,可以确定用户是否通过手表应用程序或在iOS设备上与通知进行了交互?

ios swift apple-push-notifications
1个回答
0
投票

默认情况下,如果通知通知带有随播广告的iOS应用WatchKit应用,系统将首先决定是否显示在iPhone或Apple Watch上发出警报。如果通知以“短视”形式发送到Apple Watch通知场景将首先显示。这由应用程序组成图标,通知标题和WatchKit应用名称]

签出此tutorial

您还必须为iPhone和Watchkit都实现UNUserNotificationCenterDelegate,并采取相应的措施。

© www.soinside.com 2019 - 2024. All rights reserved.