我正在查看有关如何实现此目标的Firebase文档(see here)。这是指令:
If the builds are part of a single target, the best option is to give both configuration files unique names (e.g. GoogleService-Info-Free.plist and GoogleService-Info-Paid.plist). Then choose at runtime which plist to load.
然而,在页面的最后,有一个警告"这个实现:
On iOS, do not add GoogleService-Info.plist to your project if you are supplying different configuration at run time, as this can result in an apparent change of GOOGLE_APP_ID and result in lost Analytics.
由于我试图将多个环境添加到已在其项目中添加GoogleService-Info.plist
的现有应用(在App Store中存在),这是否意味着我无法做到这一点,因为它会导致丢失分析?或者,我可以简单地删除GoogleService-Info.plist
并添加特定于环境的那些,没有任何问题吗?
答案 0 :(得分:0)
建议使用GoogleService-Info.plist,因为它允许Google Analytics报告早期事件。如果您在运行时配置它,说从Google App ID A切换到B,那么在配置B之前您将丢失A记录的事件。这更像是一个警告,让您知道使用运行时API的风险。 / p>