ios - firebase通知cordova ios集成

标签 ios cordova firebase push-notification firebase-notifications

我正在尝试在 cordova 应用 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.

出了什么问题?

最佳答案

嘿,你需要安装这个:

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

这对我有用。

关于ios - firebase通知cordova ios集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42735694/

相关文章:

iOS Firebase 身份验证与不同的项目

python-3.x - 使用 Python37 运行时使用 Cloud Functions 生成缩略图

objective-c - 子浏览器终止

ios - 如何在iOS中将mp4文件存储为Data或NSData对象?

ios - swift2 AVAudioRecorder

ios - 不断收到无法分配的错误

javascript - Windows Phone 8 和 Phonegap : how to close app with back button

javascript - Cordova 闹钟

ios - "Invalid Token"尝试使用 firebase 验证电话号码时

iphone - 用于检测电话号码和超链接的 UITextView 设置