我一直在尝试将我的(本地和推送)通知更新为通信通知。
\n当用户收到来自其朋友之一的通信事件时,我希望显示的通知包含该朋友的个人资料图片。就像新的 iMessage 应用程序一样。
\n观看专门的 WWDC2021 会议后,我向我的 SwiftUI 应用程序添加了 Siri Intent:
\n// I correctly added the StartCallIntent to both my app\'s Info.plist and the Siri Intent extension.\n<array>\n <string>INStartCallIntent</string>\n</array>\nRun Code Online (Sandbox Code Playgroud)\n并尝试使用以下内容更新我的通知流程:
\n// I correctly added the StartCallIntent to both my app\'s Info.plist and the Siri Intent extension.\n<array>\n <string>INStartCallIntent</string>\n</array>\nRun Code Online (Sandbox Code Playgroud)\n然后,返回的信息UNNotificationContent将被处理为显示为推送通知或本地通知。
虽然上面的代码不会崩溃并且似乎/工作/,但通知看起来没有任何不同。\n使用调试器查看,已_UNNotificationCommunicationContext初始化,但是:
_displayName为零_recipients为空(如预期)_contentURL为零_attachments是空的sender被设置为UNNotificationContact一个\nhandle& …apple-push-notifications wwdc uilocalnotification swift ios15