iOS:在静态库中使用 UIApplicationDelegate 函数
我想构建一个静态库来捕获传入的推送通知并使用“aps”命名空间之外的 json 对象。有没有什么方法可以在不更改 AppDelegate 中的 application:didReceiveRemoteNotification: 方法的情况下完成此操作,而只需添加和使用静态库?
提前致谢!
I want to build a static library that catches incoming push notifications and uses the json objects outside the "aps" namespace. Is there any way to do this without changing the application:didReceiveRemoteNotification: method in the AppDelegate but by simply adding and using the static library?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,没有办法做到你所要求的(据我所知)。首先,您可以执行类扩展或类别,但这两者都需要用户将它们导入应用程序委托中。此外,您可以“覆盖”该方法,但它不允许用户在其应用程序委托中“使用”该方法(如果他们还想在 didReceiveRemoteNotification 方法中执行某些逻辑)。
No, there isn't a way to do what you are asking (that I know of). First, you could do a class extension or category, but both would require the user to import them in the app delegate. Also, with that you could 'override' the method, but it wouldn't allow the user to 'use' that method in their app delegate (if they also wanted to perform some logic in the didReceiveRemoteNotification method).