多个GoogleService-Info支持 [英] multiple GoogleService-Info support

查看:202
本文介绍了多个GoogleService-Info支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注册了我的Dev和Prod计划作为Firebase中的不同应用程序。我希望他们是分开的,每个都有唯一的包ID。我正在使用#if dev来确定它是否是dev或prod方案。如何使用一个专门的plist来初始化firebase的方案?

解决方案

只要使用[FIRApp configureWithOptions:]



pre $ N $ C $ N $ strBase =

#if STAGING
firebasePlist = [[NSBundle mainBundle] pathForResource:@GoogleService-Info-DEVofType:@plist];
#endif

FIROptions * options = [[FIROptions alloc] initWithContentsOfFile:firebasePlist];
[FIRApp configureWithOptions:options];


I registered my Dev and Prod schemes as different apps in Firebase. I want them to be separate, Each has unique bundle ID. I am using #if dev to identify if it is dev or prod scheme. How can I initialize firebase with a dedicated plist for for that scheme?

解决方案

Just use [FIRApp configureWithOptions:]

NSString *firebasePlist = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info" ofType:@"plist"];

#if STAGING
    firebasePlist = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info-DEV" ofType:@"plist"];
#endif

FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:firebasePlist];
[FIRApp configureWithOptions:options];

这篇关于多个GoogleService-Info支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆