Firebase의 RemoteConfig
프레임 워크를 사용하고 있습니다. Firebase 서버에서 데이터를 가져 오는 것이 좋습니다 (이미 프로덕션 환경에서 작동 중). 기본값 설정은 작동하지 않습니다. 나는 문서에 충실하려고했지만 어쩌면 내가 뭔가 잘못하고있는 것 같아. Firebase가 RemoteConfig 기본값을 설정할 수 없습니다
[self.remoteConfig setDefaults:@{@"key1": @"value1"}];
는 다음, Firebase Console
에서 나는 클라이언트에 제로 데이터를 전송 기본 No Value
을 가지고 매개 변수 key1
을 설정합니다. 나는 다른 조건을 정의하지 않았으므로 이것이 보낼 유일한 가치입니다. documentation에 따르면 RemoteConfig
개체는이 경우 기본값을 선택해야합니다.
가져 오기 코드 :
[self.remoteConfig fetchWithExpirationDuration:self.configurationExpirationDuration
completionHandler:^(FIRRemoteConfigFetchStatus status,
NSError * _Nullable error) {
if (status == FIRRemoteConfigFetchStatusSuccess) {
[self.remoteConfig activateFetched];
FIRRemoteConfigValue *remoteValue1 = [self.remoteConfig configValueForKey:@"key1"];
NSString *value1 = remoteValue1.stringValue;
// Logic comes here
} else {
LogError(@"Error fetching remote configuration from Firebase: %@", error);
}
remoteValue1
은 nil
없습니다.
value1
은 nil
입니다.
remoteValue1.dataValue
은 _NSZeroData
입니다. 또한
, 나는 (과 namespace
매개 변수에 nil
을 보내는 것은 나에게 기본 네임 스페이스 기본값을 줄 것이다 가정)을 nil
가치를 얻을
[self.remoteConfig defaultValueForKey:@"key1" namespace:nil]
를 사용하려고합니다.
여기 뭔가 잘못 되었나요?
감사합니다. 어떻게 든 헤더 파일의'FIRNamespaceGoogleMobilePlatform' const가 누락되었습니다. –