@react-native-firebase/remote-config 21.10.0 → 21.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [21.10.1](https://github.com/invertase/react-native-firebase/compare/v21.10.0...v21.10.1) (2025-02-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **remote-config:** ensure static objects are exposed for modular API ([#8321](https://github.com/invertase/react-native-firebase/issues/8321)) ([ee033c0](https://github.com/invertase/react-native-firebase/commit/ee033c0f78a8b2d2aa530641931504fe2c10403a))
11
+
6
12
  ## [21.10.0](https://github.com/invertase/react-native-firebase/compare/v21.9.0...v21.10.0) (2025-02-11)
7
13
 
8
14
  **Note:** Version bump only for package @react-native-firebase/remote-config
@@ -206,31 +206,34 @@ public class UniversalFirebaseConfigModule extends UniversalFirebaseModule {
206
206
 
207
207
  FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
208
208
 
209
- getExecutor().execute(
210
- () -> {
211
- try {
212
- CustomSignals.Builder customSignals = new CustomSignals.Builder();
213
- for (Map.Entry<String, Object> entry : customSignalsMap.entrySet()) {
214
- Object value = entry.getValue();
215
- if (value instanceof String) {
216
- customSignals.put(entry.getKey(), (String) value);
217
- } else if (value instanceof Long) {
218
- customSignals.put(entry.getKey(), (Long) value);
219
- } else if (value instanceof Integer) {
220
- customSignals.put(entry.getKey(), ((Integer) value).longValue());
221
- } else if (value instanceof Double) {
222
- customSignals.put(entry.getKey(), (Double) value);
223
- } else if (value == null) {
224
- customSignals.put(entry.getKey(), null);
225
- }
226
- }
227
-
228
- Tasks.await(FirebaseRemoteConfig.getInstance(firebaseApp).setCustomSignals(customSignals.build()));
229
- taskCompletionSource.setResult(null);
230
- } catch (Exception e) {
231
- taskCompletionSource.setException(e);
232
- }
233
- });
209
+ getExecutor()
210
+ .execute(
211
+ () -> {
212
+ try {
213
+ CustomSignals.Builder customSignals = new CustomSignals.Builder();
214
+ for (Map.Entry<String, Object> entry : customSignalsMap.entrySet()) {
215
+ Object value = entry.getValue();
216
+ if (value instanceof String) {
217
+ customSignals.put(entry.getKey(), (String) value);
218
+ } else if (value instanceof Long) {
219
+ customSignals.put(entry.getKey(), (Long) value);
220
+ } else if (value instanceof Integer) {
221
+ customSignals.put(entry.getKey(), ((Integer) value).longValue());
222
+ } else if (value instanceof Double) {
223
+ customSignals.put(entry.getKey(), (Double) value);
224
+ } else if (value == null) {
225
+ customSignals.put(entry.getKey(), null);
226
+ }
227
+ }
228
+
229
+ Tasks.await(
230
+ FirebaseRemoteConfig.getInstance(firebaseApp)
231
+ .setCustomSignals(customSignals.build()));
232
+ taskCompletionSource.setResult(null);
233
+ } catch (Exception e) {
234
+ taskCompletionSource.setException(e);
235
+ }
236
+ });
234
237
 
235
238
  return taskCompletionSource.getTask();
236
239
  }
@@ -258,15 +258,15 @@ public class ReactNativeFirebaseConfigModule extends ReactNativeFirebaseModule {
258
258
  @ReactMethod
259
259
  public void setCustomSignals(String appName, ReadableMap customSignals, Promise promise) {
260
260
  module
261
- .setCustomSignals(appName, customSignals.toHashMap())
262
- .addOnCompleteListener(
263
- task -> {
264
- if (task.isSuccessful()) {
265
- promise.resolve(resultWithConstants(task.getResult()));
266
- } else {
267
- rejectPromiseWithExceptionMap(promise, task.getException());
268
- }
269
- });
261
+ .setCustomSignals(appName, customSignals.toHashMap())
262
+ .addOnCompleteListener(
263
+ task -> {
264
+ if (task.isSuccessful()) {
265
+ promise.resolve(resultWithConstants(task.getResult()));
266
+ } else {
267
+ rejectPromiseWithExceptionMap(promise, task.getException());
268
+ }
269
+ });
270
270
  }
271
271
 
272
272
  private WritableMap resultWithConstants(Object result) {
package/lib/index.js CHANGED
@@ -32,19 +32,11 @@ import {
32
32
  import { setReactNativeModule } from '@react-native-firebase/app/lib/internal/nativeModule';
33
33
  import fallBackModule from './web/RNFBConfigModule';
34
34
  import version from './version';
35
+ import { LastFetchStatus, ValueSource } from './statics';
35
36
 
36
37
  const statics = {
37
- LastFetchStatus: {
38
- SUCCESS: 'success',
39
- FAILURE: 'failure',
40
- THROTTLED: 'throttled',
41
- NO_FETCH_YET: 'no_fetch_yet',
42
- },
43
- ValueSource: {
44
- REMOTE: 'remote',
45
- DEFAULT: 'default',
46
- STATIC: 'static',
47
- },
38
+ LastFetchStatus,
39
+ ValueSource,
48
40
  };
49
41
 
50
42
  const namespace = 'remoteConfig';
@@ -25,6 +25,11 @@ import ConfigSettings = FirebaseRemoteConfigTypes.ConfigSettings;
25
25
  import LastFetchStatusType = FirebaseRemoteConfigTypes.LastFetchStatusType;
26
26
  import RemoteConfigLogLevel = FirebaseRemoteConfigTypes.RemoteConfigLogLevel;
27
27
  import FirebaseApp = ReactNativeFirebase.FirebaseApp;
28
+ import LastFetchStatusInterface = FirebaseRemoteConfigTypes.LastFetchStatus;
29
+ import ValueSourceInterface = FirebaseRemoteConfigTypes.ValueSource;
30
+
31
+ export const LastFetchStatus: LastFetchStatusInterface;
32
+ export const ValueSource: ValueSourceInterface;
28
33
 
29
34
  /**
30
35
  * Returns a RemoteConfig instance for the given app.
@@ -261,3 +261,5 @@ export async function setCustomSignals(remoteConfig, customSignals) {
261
261
  }
262
262
  return remoteConfig._promiseWithConstants(remoteConfig.native.setCustomSignals(customSignals));
263
263
  }
264
+
265
+ export { LastFetchStatus, ValueSource } from '../statics';
package/lib/statics.js ADDED
@@ -0,0 +1,12 @@
1
+ export const LastFetchStatus = {
2
+ SUCCESS: 'success',
3
+ FAILURE: 'failure',
4
+ THROTTLED: 'throttled',
5
+ NO_FETCH_YET: 'no_fetch_yet',
6
+ };
7
+
8
+ export const ValueSource = {
9
+ REMOTE: 'remote',
10
+ DEFAULT: 'default',
11
+ STATIC: 'static',
12
+ };
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '21.10.0';
2
+ module.exports = '21.10.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/remote-config",
3
- "version": "21.10.0",
3
+ "version": "21.10.1",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - React Native Firebase provides native integration with Remote Config, allowing you to change the appearance and/or functionality of your app without requiring an app update.",
6
6
  "main": "lib/index.js",
@@ -24,11 +24,11 @@
24
24
  "remote-config"
25
25
  ],
26
26
  "peerDependencies": {
27
- "@react-native-firebase/analytics": "21.10.0",
28
- "@react-native-firebase/app": "21.10.0"
27
+ "@react-native-firebase/analytics": "21.10.1",
28
+ "@react-native-firebase/app": "21.10.1"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "3fd30c09b2eb7d60a6ac7f6f906673a12b7bc1a7"
33
+ "gitHead": "153637d27bb98b1f44a4b27fe1f8ec133bdbfb6d"
34
34
  }