我正在创建一个通知扩展,按照规范添加目标并在其中添加一个 pod,如下所示:
Step 1 :
target 'MyProject' do
# Integration - Frameworks
pod 'Fabric'
pod 'Crashlytics'
pod 'MORichNotification'
end
target 'NotificationServices' do
pod 'MORichNotification'
end
Step : 2将“MORichNotification.h”导入到我的项目桥头文件中。
Now I want to use MORichNotification
class in my NotificationService
class, and it shows below error.
我尝试使用“清理项目”、“重新启动”、“擦除 DerivedData”,但没有任何变化。
首先,MORichNotification 仅适用于通知服务扩展,我可以从您的 podfile 中看到您也将其包含在应用程序的目标中。
而且您也可以使用 MORichNotifications,前提是您正在使用MoEngage-iOS-SDK https://cocoapods.org/pods/MoEngage-iOS-SDK在您的应用程序中,因为它只会处理通过 MoEngage 发送的通知。
现在,请按照以下步骤使用 MORichNotifications :
- 在通知服务扩展中安装 MORichNotification pod。请确保您使用的是 1.1.1 版本。
- Add Bridging Header to your Notification Service Extension
- 在 Bridging Header 中导入 MORichNotification 如下图所示:
- Use MORichNotification in your Notification Service Extension as shown below :
Let me know if still you are facing any issue.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)