gpt4 book ai didi

ios - 确定UNNotificationResponse是来自 watch 扩展还是iOS应用

转载 作者:行者123 更新时间:2023-12-01 16:13:15 26 4
gpt4 key购买 nike

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

最佳答案

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

看看这个tutorial

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

关于ios - 确定UNNotificationResponse是来自 watch 扩展还是iOS应用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59411559/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com