Open
Description
Description
- We would like to get rid of storing GoogleService-Info.plist in the bundle that is required for Firebase configuration.
- There is no way to init
FIROptions
using a content of the GoogleService-Info.plist.
2.1.-initWithGoogleAppID:GCMSenderID:
is not valid due to this.
2.2.-initWithContentsOfFile:
requires to store GoogleService-Info.plist in the bundle. - Better to have an initializer of
FIROptions
withNSData
from GoogleService-Info.plist.
This feature should be useful for those who would like to keep the GoogleService-Info.plist data in a more secure way than storing files in the bundle.
API Proposal
Here are snippets to show how it should work.
FIROptions.h
- (nullable instancetype)initWithData:(NSData *)data NS_DESIGNATED_INITIALIZER;
FIROptions.m
- (instancetype)initWithData:(NSData *)data {
self = [super init];
if (self) {
if (data == nil) {
FIRLogError(kFIRLoggerCore, @"I-COR000013", @"The plist file data is nil.");
return nil;
}
id optionsDictionary = [NSPropertyListSerialization propertyListWithData:data
options:NSPropertyListImmutable
format:NULL
error:NULL];
if (optionsDictionary == nil || ![optionsDictionary isKindOfClass:[NSDictionary class]]) {
FIRLogError(kFIRLoggerCore, @"I-COR000014", @"The configuration data is corrupted.");
return nil;
}
_optionsDictionary = [optionsDictionary mutableCopy];
}
return self;
}