javascript - 如何将 Fabric API 密钥和秘密传递给 cordova-plugin-firebase?
问题描述
我已经使用了cordova-fabric-plugin
多年。作为 Fabric 项目的链接,您可以向该插件传递两个参数:一个 API 密钥和一个 API 秘密,如下所示:
cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx
这会导致config.xml
像这样的更新文件:
<plugin name="cordova-fabric-plugin" spec="^1.1.10">
<variable name="FABRIC_API_KEY" value="XXX" />
<variable name="FABRIC_API_SECRET" value="xxx" />
</plugin>
现在,我需要通过cordova-plugin-firebase
包含自己的 Fabric 框架的 将 Firebase 安装到我的项目中。但我找不到动态传递这些相同参数的方法。我一直在对两个插件代码进行一些研究:
cordova-fabric-plugin
来自的样本ios-helper.js file
:
// Read and parse the XCode project (.pxbproj) from disk.
// File format information: http://www.monobjc.net/xcode-project-file-format.html
var xcodeProject = xcode.project(xcodeProjectPath);
xcodeProject.parseSync();
// Build the body of the script to be executed during the build phase.
var script = '"' + '${SRCROOT}' + "/\\\"" + utilities.getAppName(context) + "\\\"/Plugins/cordova-fabric-plugin/Fabric.framework/run "
+ pluginConfig.apiKey + " " + pluginConfig.apiSecret + '"';
现在从cordova-plugin-firebase
'shelper.js
文件:
// Read and parse the XCode project (.pxbproj) from disk.
// File format information: http://www.monobjc.net/xcode-project-file-format.html
var xcodeProject = xcode.project(xcodeProjectPath);
xcodeProject.parseSync();
// Build the body of the script to be executed during the build phase.
var script = '"' + '\\"${SRCROOT}\\"' + "/\\\"" + utilities.getAppName(context) + "\\\"/Plugins/" + utilities.getPluginId() + "/Fabric.framework/run" + '"';
==>参数不用了!尝试将新版本推送到 Fabric 时出现以下错误:
Fabric API 密钥无效。您的 Fabric 运行脚本构建阶段应包含您的 API 密钥:./Fabric.framework/run INSERT_YOUR_API_KEY INSERT_YOUR_BUILD_SECRET
我可以手动向 XCode 键入密钥和秘密,但我需要一个动态的解决方法来工业化这个过程。
有解决方案的人吗?
提前致谢
解决方案
推荐阅读
- python - R 与 Python 在浮点分辨率方面的差异:是否可以将 Python 设置为像 R 一样?
- java - 如何比较列表中的某些字段并将其值插入另一个列表中?
- android - 如何等待 Firestore 完成然后返回布尔结果?
- r - R中的组合或合并变量
- python - 如何使用 Pygame.mixer.music 一次播放两首歌曲?
- android - 使用 NewsApi 时,android 中出现意外的响应代码 403
- c - SSH在Linux上如何提示输入用户名和密码
- android - 如何以只有我的应用程序可以打开该文件的方式保存文件?
- kubernetes - 具有子域静态 IP 的 AKS 入口控制器
- algorithm - 在团队之间进行比赛并总结比赛结果