确定UNNotificationResponse是否来自手表扩展或iOS应用程序
使用确定UNNotificationResponse是否来自手表扩展或iOS应用程序,ios,swift,apple-push-notifications,Ios,Swift,Apple Push Notifications,使用func userNotificationCenter(center:UNUserNotificationCenter,didReceive response:UNNotificationResponse,withCompletionHandler completionHandler:@escaping()->Void)处理UNUserNotificationCenter委托中的位置通知时是否可以确定用户是使用watch应用程序还是在iOS设备上与通知交互 默认情况下,如果iOS应用程序的通
func userNotificationCenter(center:UNUserNotificationCenter,didReceive response:UNNotificationResponse,withCompletionHandler completionHandler:@escaping()->Void)处理UNUserNotificationCenter委托中的位置通知时
是否可以确定用户是使用watch应用程序还是在iOS设备上与通知交互
默认情况下,如果iOS应用程序的通知到达,则
WatchKit应用程序,系统将首先决定是否显示
在iPhone或Apple Watch上发出警报。如果
通知以“简短的外观”的形式发送给Apple Watch
首先显示通知场景。这包括应用程序
图标、通知中的标题和WatchKit应用程序的名称
看看这个
您还必须为iPhone和Watchkit实施UnuseNotificationCenterDelegate,并采取相应的措施。您必须为iPhone和Watchkit实施两次UnuseNotificationCenterDelegate。iPhone和手表将分别收到通知。我建议你读这篇文章: