info.plist
我还需要一些额外的工作吗?
按目标,我的应用程序的目标 - >
NotificationService: UNNotificationServiceExtension
->@UIApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate: AppDelegate
->>未选中,此处也列出了通知服务。
不需要点2和3。我已经更改了生成的
NotificationService: UNNotificationServiceExtension
文件的
Build Phases
Embed Foundation Extension
,现在有两个复选框,用于通知本身(默认情况下),我在此处签到了主应用程序。断点不再点缀蓝色。
我将生成
Copy only when installing
的内容复制到我的应用中
Target Membership
.。
突破点问题:请参见下面的Gruntcakes评论
不幸的是,仍未达到断点。我猜该问题可能与以下事实有关。NotificationService
但是我该怎么办才能让
Info.plist
Info.plist
写下此代码,运行并在NotificationService类上运行并放置断点,然后通知降落在该类别上,它将降落在此类中,只需用以下代码和运行代码替换您的通知服务类,希望它可以解决您的问题。
为了参考,您也可以看到此链接
@main
struct MyApp: App {