[config] Return null/nil values on success
This commit is contained in:
parent
c4b43a5184
commit
0a1ab7b8dd
|
@ -120,7 +120,7 @@ class RNFirebaseRemoteConfig extends ReactContextBaseJavaModule {
|
||||||
@Override
|
@Override
|
||||||
public void onComplete(@NonNull Task<Void> task) {
|
public void onComplete(@NonNull Task<Void> task) {
|
||||||
if (task.isSuccessful()) {
|
if (task.isSuccessful()) {
|
||||||
promise.resolve("config/success");
|
promise.resolve(null);
|
||||||
} else {
|
} else {
|
||||||
if (task.getException() instanceof FirebaseRemoteConfigFetchThrottledException) {
|
if (task.getException() instanceof FirebaseRemoteConfigFetchThrottledException) {
|
||||||
promise.reject("config/throttled", "fetch() operation cannot be completed successfully, due to throttling.", task.getException());
|
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);
|
map.putNull(NUMBER_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO check with ios
|
|
||||||
switch (value.getSource()) {
|
switch (value.getSource()) {
|
||||||
case FirebaseRemoteConfig.VALUE_SOURCE_DEFAULT:
|
case FirebaseRemoteConfig.VALUE_SOURCE_DEFAULT:
|
||||||
map.putString(SOURCE, "default");
|
map.putString(SOURCE, "default");
|
||||||
|
|
|
@ -61,7 +61,7 @@ RCT_EXPORT_METHOD(fetch:
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(convertFIRRemoteConfigFetchStatusToNSString(status), convertFIRRemoteConfigFetchStatusToNSStringDescription(status), error);
|
reject(convertFIRRemoteConfigFetchStatusToNSString(status), convertFIRRemoteConfigFetchStatusToNSStringDescription(status), error);
|
||||||
} else {
|
} else {
|
||||||
resolve(convertFIRRemoteConfigFetchStatusToNSString(status));
|
resolve(nil);
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ RCT_EXPORT_METHOD(fetchWithExpirationDuration:
|
||||||
if (error) {
|
if (error) {
|
||||||
reject(convertFIRRemoteConfigFetchStatusToNSString(status), convertFIRRemoteConfigFetchStatusToNSStringDescription(status), error);
|
reject(convertFIRRemoteConfigFetchStatusToNSString(status), convertFIRRemoteConfigFetchStatusToNSStringDescription(status), error);
|
||||||
} else {
|
} else {
|
||||||
resolve(convertFIRRemoteConfigFetchStatusToNSString(status));
|
resolve(nil);
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue