[config] Return null/nil values on success

This commit is contained in:
Elliot Hesp 2018-07-18 21:35:57 +01:00
parent c4b43a5184
commit 0a1ab7b8dd
2 changed files with 3 additions and 4 deletions

View File

@ -120,7 +120,7 @@ class RNFirebaseRemoteConfig extends ReactContextBaseJavaModule {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
promise.resolve("config/success");
promise.resolve(null);
} else {
if (task.getException() instanceof FirebaseRemoteConfigFetchThrottledException) {
promise.reject("config/throttled", "fetch() operation cannot be completed successfully, due to throttling.", task.getException());
@ -159,7 +159,6 @@ class RNFirebaseRemoteConfig extends ReactContextBaseJavaModule {
map.putNull(NUMBER_VALUE);
}
// TODO check with ios
switch (value.getSource()) {
case FirebaseRemoteConfig.VALUE_SOURCE_DEFAULT:
map.putString(SOURCE, "default");

View File

@ -61,7 +61,7 @@ RCT_EXPORT_METHOD(fetch:
if (error) {
reject(convertFIRRemoteConfigFetchStatusToNSString(status), convertFIRRemoteConfigFetchStatusToNSStringDescription(status), error);
} else {
resolve(convertFIRRemoteConfigFetchStatusToNSString(status));
resolve(nil);
}
}];
}
@ -75,7 +75,7 @@ RCT_EXPORT_METHOD(fetchWithExpirationDuration:
if (error) {
reject(convertFIRRemoteConfigFetchStatusToNSString(status), convertFIRRemoteConfigFetchStatusToNSStringDescription(status), error);
} else {
resolve(convertFIRRemoteConfigFetchStatusToNSString(status));
resolve(nil);
}
}];
}