In new Firebase, how to use multiple config file in xcode?

后端 未结 9 1460
被撕碎了的回忆
被撕碎了的回忆 2021-01-30 09:14

Hey I am playing with the new firebase iOS SDK, in my project, I have only one target, I created two configurations, Debug and Release, with different bundler identifier, but se

9条回答
  •  清酒与你
    2021-01-30 09:43

    Using Objective-C, in your AppDeletage.m:

    NSString *filePath;
    #ifdef DEBUG
      filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info-Debug" ofType:@"plist"];
    #else
      filePath = [[NSBundle mainBundle] pathForResource:@"GoogleService-Info-Production" ofType:@"plist"];
    #endif
    
      FIROptions *options = [[FIROptions alloc] initWithContentsOfFile:filePath];
      [FIRApp configureWithOptions:options];
    

提交回复
热议问题