ios - 在 XCode 的一个目标中有两个 GoogleService-Info.plist

标签 ios xcode firebase target environment

我在目标中设置了两个不同的环境(一个用于开发,另一个用于生产),因此我想使用两个不同的 GoogleService-Info.plist 但仍然没有成功。有办法吗?

最佳答案

我使用以下解决方案:

为每个 XCode 配置创建一个 GoogleService-CONFIGURATION-Info.plist 文件。不要将文件链接到目标。

添加运行脚本构建阶段:

cp ${SRCROOT}/Resources/Firebase/GoogleService-${CONFIGURATION}-Info.plist ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleService-Info.plist

关于ios - 在 XCode 的一个目标中有两个 GoogleService-Info.plist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37884011/

相关文章:

ios - 我们应该如何显示以下 ViewController?

ios - UIFont:字体大小不同

ios - -[__NSCFDictionary objectAtIndexedSubscript :]: unrecognized selector sent to instance

objective-c - 如何在IOS中写入文件

swift - 如何在 UIPickerView 中加载从 Firestore 检索的数据?

javascript - Firebase 身份验证 - 链接其他身份验证提供商

ios - 点击 UIButton 以编程方式创建另一个 UIButton

ios - iPad Pro 的平台字符串

xcode - Swift - 无法显式专门化泛型函数

objective-c - 如何修复 : "No visible @interface for ' FIRInstanceID' declares the selector 'token' "in iOS build in Flutter