无法在Notification Service扩展中使用pod [英] Unable to use pod in Notification service extension

查看:228
本文介绍了无法在Notification Service扩展中使用pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个通知扩展,按照规范添加了目标并在其中添加了广告连播,如下所示:



第1步:

 目标'MyProject'做

#集成-框架
pod'Fabric'
pod'Crashlytics'
pod'MORichNotification'
结束


目标'NotificationServices'执行
pod'MORichNotification'
结束

步骤:2
将 MORichNotification.h导入到我的项目桥头文件。



现在我想在我的 NotificationService <中使用 MORichNotification 类/ code>类,它显示以下错误。



我尝试了Clean项目,重新启动,擦除了DerivedData,但没有任何改变。

解决方案

首先,MorichNotification仅用于Notification Service扩展,我从您的podfile中可以看到,您也将其包含在应用程序的目标中。



也可以使用MORichNotifications,仅当您使用

  • 在桥接头中导入MORichNotification,如下图所示:


    1. 在Notification Services Extension中使用MORichNotification,如下所示:

      让我知道您是否仍然遇到任何问题。


    I am creating a Notification extension, added target as per norm and added a pod in it as follows:

    Step 1 :

    target 'MyProject' do
    
       # Integration - Frameworks
       pod 'Fabric'
            pod 'Crashlytics'
            pod 'MORichNotification'
       end
    
    
    target 'NotificationServices' do
        pod 'MORichNotification'
    end
    

    Step : 2 Import "MORichNotification.h" into my Project bridge header file.

    Now I want to use MORichNotification class in my NotificationService class, and it shows below error.

    I tried with Clean project, Restarted, Wiped DerivedData, but nothing changed.

    解决方案

    First of all MORichNotification is meant only for the Notification Service Extension, I can see from your podfile that you are including it in your app's target too.

    And also you can use MORichNotifications, only if you are using MoEngage-iOS-SDK in your app, as it will process only the notifications sent via MoEngage.

    Now, follow the below steps to use MORichNotifications :

    1. Install the MORichNotification pod in your Notification Service Extension. And please make sure that you are using version 1.1.1.
    2. Add Bridging Header to your Notification Service Extension
    3. Import MORichNotification in Bridging Header as shown in the image below:

    1. Use MORichNotification in your Notification Service Extension as shown below : Let me know if still you are facing any issue.

    这篇关于无法在Notification Service扩展中使用pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆