multiple GoogleService-Info support

前端 未结 2 2025
别跟我提以往
别跟我提以往 2020-12-11 21:31

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 pro

2条回答
  •  独厮守ぢ
    2020-12-11 21:58

    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];
    

提交回复
热议问题