【问题标题】:firebase notification cordova ios integrationfirebase 通知 cordova ios 集成
【发布时间】:2017-08-01 19:40:47
【问题描述】:

我正在尝试在 cordova app ios 上添加 firebase 通知,但我不能。 这是我已经完成的步骤:

1-创建了 firebase 项目
2-复制配置文件 Googleservice-info.plist
3-安装cordova插件fcm
4-将此代码添加到文件 index.js

window.FirebasePlugin.grantPermission();


    FCMPlugin.onNotification(function(data){
        if(data.wasTapped){
          //Notification was received on device tray and tapped by the user.
          console.log( JSON.stringify(data) );
        }else{
          //Notification was received in foreground. Maybe the user needs to be notified.
          console.log( JSON.stringify(data) );
        }
    });

    FCMPlugin.subscribeToTopic(topicSub);

5 安装 cocoapods 6-执行了这个命令:

pod init

7-in 文件 PodFile 我已插入此代码:

pod ’Firebase/Core’

pod 'Firebase/Messaging'

使用此命令安装 8 个 pod:

pod install

10-用.xcworkspace文件打开项目
现在 xcode 向我返回此错误:

diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

怎么了?

【问题讨论】:

    标签: ios cordova firebase push-notification firebase-notifications


    【解决方案1】:

    你需要安装这个:

    cordova plugin add cordova-plugin-cocoapod-support --save
    

    这对我有用。

    【讨论】:

      【解决方案2】:

      运行以下代码进行更新:

      第一步:pod repo 更新

      第 2 步:pod 安装

      这可能有效。

      【讨论】:

        猜你喜欢
        • 2018-07-06
        • 1970-01-01
        • 2017-05-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-05-26
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多