gpt4 book ai didi

ios - firebase 通知 cordova ios 集成

转载 作者:塔克拉玛干 更新时间:2023-11-02 10:25:14 24 4
gpt4 key购买 nike

我正在尝试在 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-安装的cocoapods6-执行这条命令:

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com