@react-native-firebase/remote-config 20.2.1 → 20.4.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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
+ ## [20.4.0](https://github.com/invertase/react-native-firebase/compare/v20.3.0...v20.4.0) (2024-08-13)
7
+
8
+ **Note:** Version bump only for package @react-native-firebase/remote-config
9
+
10
+ ## [20.3.0](https://github.com/invertase/react-native-firebase/compare/v20.2.1...v20.3.0) (2024-07-19)
11
+
12
+ **Note:** Version bump only for package @react-native-firebase/remote-config
13
+
6
14
  ## [20.2.1](https://github.com/invertase/react-native-firebase/compare/v20.2.0...v20.2.1) (2024-07-17)
7
15
 
8
16
  **Note:** Version bump only for package @react-native-firebase/remote-config
@@ -16,7 +16,30 @@
16
16
  */
17
17
  import { describe, expect, it } from '@jest/globals';
18
18
 
19
- import { firebase } from '../lib';
19
+ import {
20
+ firebase,
21
+ getRemoteConfig,
22
+ activate,
23
+ ensureInitialized,
24
+ fetchAndActivate,
25
+ fetchConfig,
26
+ getAll,
27
+ getBoolean,
28
+ getNumber,
29
+ getString,
30
+ getValue,
31
+ setLogLevel,
32
+ isSupported,
33
+ fetchTimeMillis,
34
+ settings,
35
+ lastFetchStatus,
36
+ reset,
37
+ setConfigSettings,
38
+ fetch,
39
+ setDefaults,
40
+ setDefaultsFromResource,
41
+ onConfigUpdated,
42
+ } from '../lib';
20
43
 
21
44
  describe('remoteConfig()', function () {
22
45
  describe('namespace', function () {
@@ -108,4 +131,90 @@ describe('remoteConfig()', function () {
108
131
  expect(config).toEqual({});
109
132
  });
110
133
  });
134
+
135
+ describe('modular', function () {
136
+ it('`getRemoteConfig` function is properly exposed to end user', function () {
137
+ expect(getRemoteConfig).toBeDefined();
138
+ });
139
+
140
+ it('`activate` function is properly exposed to end user', function () {
141
+ expect(activate).toBeDefined();
142
+ });
143
+
144
+ it('`ensureInitialized` function is properly exposed to end user', function () {
145
+ expect(ensureInitialized).toBeDefined();
146
+ });
147
+
148
+ it('`fetchAndActivate` function is properly exposed to end user', function () {
149
+ expect(fetchAndActivate).toBeDefined();
150
+ });
151
+
152
+ it('`fetchConfig` function is properly exposed to end user', function () {
153
+ expect(fetchConfig).toBeDefined();
154
+ });
155
+
156
+ it('`getAll` function is properly exposed to end user', function () {
157
+ expect(getAll).toBeDefined();
158
+ });
159
+
160
+ it('`getBoolean` function is properly exposed to end user', function () {
161
+ expect(getBoolean).toBeDefined();
162
+ });
163
+
164
+ it('`getNumber` function is properly exposed to end user', function () {
165
+ expect(getNumber).toBeDefined();
166
+ });
167
+
168
+ it('`getString` function is properly exposed to end user', function () {
169
+ expect(getString).toBeDefined();
170
+ });
171
+
172
+ it('`getValue` function is properly exposed to end user', function () {
173
+ expect(getValue).toBeDefined();
174
+ });
175
+
176
+ it('`setLogLevel` function is properly exposed to end user', function () {
177
+ expect(setLogLevel).toBeDefined();
178
+ });
179
+
180
+ it('`isSupported` function is properly exposed to end user', function () {
181
+ expect(isSupported).toBeDefined();
182
+ });
183
+
184
+ it('`fetchTimeMillis` function is properly exposed to end user', function () {
185
+ expect(fetchTimeMillis).toBeDefined();
186
+ });
187
+
188
+ it('`settings` function is properly exposed to end user', function () {
189
+ expect(settings).toBeDefined();
190
+ });
191
+
192
+ it('`lastFetchStatus` function is properly exposed to end user', function () {
193
+ expect(lastFetchStatus).toBeDefined();
194
+ });
195
+
196
+ it('`reset` function is properly exposed to end user', function () {
197
+ expect(reset).toBeDefined();
198
+ });
199
+
200
+ it('`setConfigSettings` function is properly exposed to end user', function () {
201
+ expect(setConfigSettings).toBeDefined();
202
+ });
203
+
204
+ it('`fetch` function is properly exposed to end user', function () {
205
+ expect(fetch).toBeDefined();
206
+ });
207
+
208
+ it('`setDefaults` function is properly exposed to end user', function () {
209
+ expect(setDefaults).toBeDefined();
210
+ });
211
+
212
+ it('`setDefaultsFromResource` function is properly exposed to end user', function () {
213
+ expect(setDefaultsFromResource).toBeDefined();
214
+ });
215
+
216
+ it('`onConfigUpdated` function is properly exposed to end user', function () {
217
+ expect(onConfigUpdated).toBeDefined();
218
+ });
219
+ });
111
220
  });
package/lib/index.d.ts CHANGED
@@ -567,6 +567,8 @@ type OnConfigUpdatedListenerCallback = (
567
567
 
568
568
  export default defaultExport;
569
569
 
570
+ export * from './modular';
571
+
570
572
  /**
571
573
  * Attach namespace to `firebase.` and `FirebaseApp.`.
572
574
  */
package/lib/index.js CHANGED
@@ -33,30 +33,6 @@ import { setReactNativeModule } from '@react-native-firebase/app/lib/internal/na
33
33
  import fallBackModule from './web/RNFBConfigModule';
34
34
  import version from './version';
35
35
 
36
- export {
37
- getRemoteConfig,
38
- activate,
39
- ensureInitialized,
40
- fetchAndActivate,
41
- fetchConfig,
42
- getAll,
43
- getBoolean,
44
- getNumber,
45
- getString,
46
- getValue,
47
- setLogLevel,
48
- isSupported,
49
- fetchTimeMillis,
50
- settings,
51
- lastFetchStatus,
52
- reset,
53
- setConfigSettings,
54
- fetch,
55
- setDefaults,
56
- setDefaultsFromResource,
57
- onConfigUpdated,
58
- } from './modular/index';
59
-
60
36
  const statics = {
61
37
  LastFetchStatus: {
62
38
  SUCCESS: 'success',
@@ -368,6 +344,8 @@ export default createModuleNamespace({
368
344
  ModuleClass: FirebaseConfigModule,
369
345
  });
370
346
 
347
+ export * from './modular';
348
+
371
349
  // import config, { firebase } from '@react-native-firebase/remote-config';
372
350
  // config().X(...);
373
351
  // firebase.remoteConfig().X(...);
@@ -0,0 +1,208 @@
1
+ /*
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ *
16
+ */
17
+ import { FirebaseApp } from '@firebase/app-types';
18
+ import { FirebaseRemoteConfigTypes } from '..';
19
+
20
+ import RemoteConfig = FirebaseRemoteConfigTypes.Module;
21
+ import ConfigValues = FirebaseRemoteConfigTypes.ConfigValues;
22
+ import ConfigValue = FirebaseRemoteConfigTypes.ConfigValue;
23
+ import ConfigDefaults = FirebaseRemoteConfigTypes.ConfigDefaults;
24
+ import ConfigSettings = FirebaseRemoteConfigTypes.ConfigSettings;
25
+ import LastFetchStatusType = FirebaseRemoteConfigTypes.LastFetchStatusType;
26
+ import RemoteConfigLogLevel = FirebaseRemoteConfigTypes.RemoteConfigLogLevel;
27
+
28
+ /**
29
+ * Returns a RemoteConfig instance for the given app.
30
+ * @param app - FirebaseApp. Optional.
31
+ * @returns {RemoteConfig}
32
+ */
33
+ export function getRemoteConfig(app?: FirebaseApp): RemoteConfig;
34
+
35
+ /**
36
+ * Returns a Boolean which resolves to true if the current call
37
+ * activated the fetched configs.
38
+ * @param remoteConfig - RemoteConfig instance
39
+ * @returns {Promise<boolean>}
40
+ */
41
+ export function activate(remoteConfig: RemoteConfig): Promise<boolean>;
42
+
43
+ /**
44
+ * Ensures the last activated config are available to the getters.
45
+ * @param remoteConfig - RemoteConfig instance
46
+ * @returns {Promise<void>}
47
+ */
48
+ export function ensureInitialized(remoteConfig: RemoteConfig): Promise<void>;
49
+
50
+ /**
51
+ * Performs a fetch and returns a Boolean which resolves to true
52
+ * if the current call activated the fetched configs.
53
+ * @param remoteConfig - RemoteConfig instance
54
+ * @returns {Promise<boolean>}
55
+ */
56
+ export function fetchAndActivate(remoteConfig: RemoteConfig): Promise<boolean>;
57
+
58
+ /**
59
+ * Fetches and caches configuration from the Remote Config service.
60
+ * @param remoteConfig - RemoteConfig instance
61
+ * @returns {Promise<void>}
62
+ */
63
+ export function fetchConfig(remoteConfig: RemoteConfig): Promise<void>;
64
+
65
+ /**
66
+ * Gets all config.
67
+ * @param remoteConfig - RemoteConfig instance
68
+ * @returns {ConfigValues}
69
+ */
70
+ export function getAll(remoteConfig: RemoteConfig): ConfigValues;
71
+
72
+ /**
73
+ * Gets the value for the given key as a boolean.
74
+ * @param remoteConfig - RemoteConfig instance
75
+ * @param key - key for boolean value
76
+ * @returns {boolean}
77
+ */
78
+ export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean;
79
+
80
+ /**
81
+ * Gets the value for the given key as a number.
82
+ * @param remoteConfig - RemoteConfig instance
83
+ * @param key - key for number value
84
+ * @returns {number}
85
+ */
86
+ export function getNumber(remoteConfig: RemoteConfig, key: string): number;
87
+
88
+ /**
89
+ * Gets the value for the given key as a string.
90
+ * @param remoteConfig - RemoteConfig instance
91
+ * @param key - key for string value
92
+ * @returns {string}
93
+ */
94
+ export function getString(remoteConfig: RemoteConfig, key: string): string;
95
+
96
+ /**
97
+ * Gets the value for the given key
98
+ * @param remoteConfig - RemoteConfig instance
99
+ * @param key - key for the given value
100
+ * @returns {ConfigValue}
101
+ */
102
+ export function getValue(remoteConfig: RemoteConfig, key: string): ConfigValue;
103
+
104
+ /**
105
+ * Defines the log level to use.
106
+ * @param remoteConfig - RemoteConfig instance
107
+ * @param logLevel - The log level to set
108
+ * @returns {RemoteConfigLogLevel}
109
+ */
110
+ export function setLogLevel(
111
+ remoteConfig: RemoteConfig,
112
+ logLevel: RemoteConfigLogLevel,
113
+ ): RemoteConfigLogLevel;
114
+
115
+ /**
116
+ * Checks two different things.
117
+ * 1. Check if IndexedDB exists in the browser environment.
118
+ * 2. Check if the current browser context allows IndexedDB open() calls.
119
+ * @returns {Promise<boolean>}
120
+ */
121
+ export function isSupported(): Promise<boolean>;
122
+
123
+ /**
124
+ * Indicates the default value in milliseconds to abandon a pending fetch
125
+ * request made to the Remote Config server. Defaults to 60000 (One minute).
126
+ * @param remoteConfig - RemoteConfig instance
127
+ * @returns {number}
128
+ */
129
+ export function fetchTimeMillis(remoteConfig: RemoteConfig): number;
130
+
131
+ /**
132
+ * Returns a ConfigSettings object which provides the properties `minimumFetchIntervalMillis` & `fetchTimeMillis` if they have been set
133
+ * using setConfigSettings({ fetchTimeMillis: number, minimumFetchIntervalMillis: number }).
134
+ * @param remoteConfig - RemoteConfig instance
135
+ * @returns {ConfigSettings}
136
+ */
137
+ export function settings(remoteConfig: RemoteConfig): ConfigSettings;
138
+
139
+ /**
140
+ * The status of the latest Remote RemoteConfig fetch action.
141
+ * @param remoteConfig - RemoteConfig instance
142
+ * @returns {LastFetchStatusType}
143
+ */
144
+ export function lastFetchStatus(remoteConfig: RemoteConfig): LastFetchStatusType;
145
+
146
+ /**
147
+ * Deletes all activated, fetched and defaults configs and
148
+ * resets all Firebase Remote Config settings.
149
+ * Android only. iOS does not reset anything.
150
+ * @param remoteConfig - RemoteConfig instance
151
+ * @returns {Promise<void>}
152
+ */
153
+ export function reset(remoteConfig: RemoteConfig): Promise<void>;
154
+
155
+ /**
156
+ * Set the Remote RemoteConfig settings, currently able to set
157
+ * `fetchTimeMillis` & `minimumFetchIntervalMillis`
158
+ * Android only. iOS does not reset anything.
159
+ * @param remoteConfig - RemoteConfig instance
160
+ * @param settings - ConfigSettings instance
161
+ * @returns {Promise<void>}
162
+ */
163
+ export function setConfigSettings(
164
+ remoteConfig: RemoteConfig,
165
+ settings: ConfigSettings,
166
+ ): Promise<void>;
167
+
168
+ /**
169
+ * Fetches parameter values for your app.
170
+ * @param remoteConfig - RemoteConfig instance
171
+ * @param expirationDurationSeconds - number
172
+ * @returns {Promise<void>}
173
+ */
174
+ export function fetch(
175
+ remoteConfig: RemoteConfig,
176
+ expirationDurationSeconds?: number,
177
+ ): Promise<void>;
178
+
179
+ /**
180
+ * Fetches parameter values for your app.
181
+ * @param remoteConfig - RemoteConfig instance
182
+ * @param defaults - ConfigDefaults
183
+ * @returns {Promise<void>}
184
+ */
185
+ export function setDefaults(remoteConfig: RemoteConfig, defaults: ConfigDefaults): Promise<void>;
186
+
187
+ /**
188
+ * Fetches parameter values for your app.
189
+ * @param remoteConfig - RemoteConfig instance
190
+ * @param resourceName - string
191
+ * @returns {Promise<null>}
192
+ */
193
+ export function setDefaultsFromResource(
194
+ remoteConfig: RemoteConfig,
195
+ resourceName: string,
196
+ ): Promise<null>;
197
+
198
+ /**
199
+ * Registers a listener to changes in the configuration.
200
+ *
201
+ * @param remoteConfig - RemoteConfig instance
202
+ * @param callback - function called on config change
203
+ * @returns {function} unsubscribe listener
204
+ */
205
+ export function onConfigUpdated(
206
+ remoteConfig: RemoteConfig,
207
+ callback: (config: ConfigValues) => void,
208
+ ): () => void;
@@ -17,9 +17,20 @@
17
17
 
18
18
  import { firebase } from '..';
19
19
 
20
+ /**
21
+ * @typedef {import('@firebase/app').FirebaseApp} FirebaseApp
22
+ * @typedef {import('..').FirebaseRemoteConfigTypes.Module} RemoteConfig
23
+ * @typedef {import('..').FirebaseRemoteConfigTypes.ConfigDefaults} ConfigDefaults
24
+ * @typedef {import('..').FirebaseRemoteConfigTypes.ConfigSettings} ConfigSettings
25
+ * @typedef {import('..').FirebaseRemoteConfigTypes.ConfigValue} ConfigValue
26
+ * @typedef {import('..').FirebaseRemoteConfigTypes.ConfigValues} ConfigValues
27
+ * @typedef {import('..').FirebaseRemoteConfigTypes.LastFetchStatusType} LastFetchStatusType
28
+ * @typedef {import('..').FirebaseRemoteConfigTypes.RemoteConfigLogLevel} RemoteConfigLogLevel
29
+ */
30
+
20
31
  /**
21
32
  * Returns a RemoteConfig instance for the given app.
22
- * @param app - FirebaseApp. Optional.
33
+ * @param {FirebaseApp} [app] - FirebaseApp. Optional.
23
34
  * @returns {RemoteConfig}
24
35
  */
25
36
  export function getRemoteConfig(app) {
@@ -33,7 +44,7 @@ export function getRemoteConfig(app) {
33
44
  /**
34
45
  * Returns a Boolean which resolves to true if the current call
35
46
  * activated the fetched configs.
36
- * @param remoteConfig - RemoteConfig instance
47
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
37
48
  * @returns {Promise<boolean>}
38
49
  */
39
50
  export function activate(remoteConfig) {
@@ -42,7 +53,7 @@ export function activate(remoteConfig) {
42
53
 
43
54
  /**
44
55
  * Ensures the last activated config are available to the getters.
45
- * @param remoteConfig - RemoteConfig instance
56
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
46
57
  * @returns {Promise<void>}
47
58
  */
48
59
  export function ensureInitialized(remoteConfig) {
@@ -52,7 +63,7 @@ export function ensureInitialized(remoteConfig) {
52
63
  /**
53
64
  * Performs a fetch and returns a Boolean which resolves to true
54
65
  * if the current call activated the fetched configs.
55
- * @param remoteConfig - RemoteConfig instance
66
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
56
67
  * @returns {Promise<boolean>}
57
68
  */
58
69
  export function fetchAndActivate(remoteConfig) {
@@ -61,7 +72,7 @@ export function fetchAndActivate(remoteConfig) {
61
72
 
62
73
  /**
63
74
  * Fetches and caches configuration from the Remote Config service.
64
- * @param remoteConfig - RemoteConfig instance
75
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
65
76
  * @returns {Promise<void>}
66
77
  */
67
78
  export function fetchConfig(remoteConfig) {
@@ -70,8 +81,8 @@ export function fetchConfig(remoteConfig) {
70
81
 
71
82
  /**
72
83
  * Gets all config.
73
- * @param remoteConfig - RemoteConfig instance
74
- * @returns {Promise<ConfigValues>}
84
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
85
+ * @returns {ConfigValues}
75
86
  */
76
87
  export function getAll(remoteConfig) {
77
88
  return remoteConfig.getAll();
@@ -79,8 +90,8 @@ export function getAll(remoteConfig) {
79
90
 
80
91
  /**
81
92
  * Gets the value for the given key as a boolean.
82
- * @param remoteConfig - RemoteConfig instance
83
- * @param key - key for boolean value
93
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
94
+ * @param {string} key - key for boolean value
84
95
  * @returns {boolean}
85
96
  */
86
97
  export function getBoolean(remoteConfig, key) {
@@ -89,8 +100,8 @@ export function getBoolean(remoteConfig, key) {
89
100
 
90
101
  /**
91
102
  * Gets the value for the given key as a number.
92
- * @param remoteConfig - RemoteConfig instance
93
- * @param key - key for number value
103
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
104
+ * @param {string} key - key for number value
94
105
  * @returns {number}
95
106
  */
96
107
  export function getNumber(remoteConfig, key) {
@@ -99,8 +110,8 @@ export function getNumber(remoteConfig, key) {
99
110
 
100
111
  /**
101
112
  * Gets the value for the given key as a string.
102
- * @param remoteConfig - RemoteConfig instance
103
- * @param key - key for string value
113
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
114
+ * @param {string} key - key for string value
104
115
  * @returns {string}
105
116
  */
106
117
  export function getString(remoteConfig, key) {
@@ -109,8 +120,8 @@ export function getString(remoteConfig, key) {
109
120
 
110
121
  /**
111
122
  * Gets the value for the given key
112
- * @param remoteConfig - RemoteConfig instance
113
- * @param key - key for the given value
123
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
124
+ * @param {string} key - key for the given value
114
125
  * @returns {ConfigValue}
115
126
  */
116
127
  export function getValue(remoteConfig, key) {
@@ -119,8 +130,8 @@ export function getValue(remoteConfig, key) {
119
130
 
120
131
  /**
121
132
  * Defines the log level to use.
122
- * @param remoteConfig - RemoteConfig instance
123
- * @param logLevel - The log level to set
133
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
134
+ * @param {RemoteConfigLogLevel} logLevel - The log level to set
124
135
  * @returns {RemoteConfigLogLevel}
125
136
  */
126
137
  // eslint-disable-next-line
@@ -143,7 +154,7 @@ export function isSupported() {
143
154
  /**
144
155
  * Indicates the default value in milliseconds to abandon a pending fetch
145
156
  * request made to the Remote Config server. Defaults to 60000 (One minute).
146
- * @param remoteConfig - RemoteConfig instance
157
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
147
158
  * @returns {number}
148
159
  */
149
160
  export function fetchTimeMillis(remoteConfig) {
@@ -153,7 +164,7 @@ export function fetchTimeMillis(remoteConfig) {
153
164
  /**
154
165
  * Returns a ConfigSettings object which provides the properties `minimumFetchIntervalMillis` & `fetchTimeMillis` if they have been set
155
166
  * using setConfigSettings({ fetchTimeMillis: number, minimumFetchIntervalMillis: number }).
156
- * @param remoteConfig - RemoteConfig instance
167
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
157
168
  * @returns {ConfigSettings}
158
169
  */
159
170
  export function settings(remoteConfig) {
@@ -162,7 +173,7 @@ export function settings(remoteConfig) {
162
173
 
163
174
  /**
164
175
  * The status of the latest Remote RemoteConfig fetch action.
165
- * @param remoteConfig - RemoteConfig instance
176
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
166
177
  * @returns {LastFetchStatusType}
167
178
  */
168
179
  export function lastFetchStatus(remoteConfig) {
@@ -173,7 +184,7 @@ export function lastFetchStatus(remoteConfig) {
173
184
  * Deletes all activated, fetched and defaults configs and
174
185
  * resets all Firebase Remote Config settings.
175
186
  * Android only. iOS does not reset anything.
176
- * @param remoteConfig - RemoteConfig instance
187
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
177
188
  * @returns {Promise<void>}
178
189
  */
179
190
  export function reset(remoteConfig) {
@@ -184,8 +195,8 @@ export function reset(remoteConfig) {
184
195
  * Set the Remote RemoteConfig settings, currently able to set
185
196
  * `fetchTimeMillis` & `minimumFetchIntervalMillis`
186
197
  * Android only. iOS does not reset anything.
187
- * @param remoteConfig - RemoteConfig instance
188
- * @param settings - ConfigSettings instance
198
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
199
+ * @param {ConfigSettings} settings - ConfigSettings instance
189
200
  * @returns {Promise<void>}
190
201
  */
191
202
  export function setConfigSettings(remoteConfig, settings) {
@@ -194,8 +205,8 @@ export function setConfigSettings(remoteConfig, settings) {
194
205
 
195
206
  /**
196
207
  * Fetches parameter values for your app.
197
- * @param remoteConfig - RemoteConfig instance
198
- * @param expirationDurationSeconds - number
208
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
209
+ * @param {number} expirationDurationSeconds - number
199
210
  * @returns {Promise<void>}
200
211
  */
201
212
  export function fetch(remoteConfig, expirationDurationSeconds) {
@@ -204,8 +215,8 @@ export function fetch(remoteConfig, expirationDurationSeconds) {
204
215
 
205
216
  /**
206
217
  * Fetches parameter values for your app.
207
- * @param remoteConfig - RemoteConfig instance
208
- * @param defaults - ConfigDefaults
218
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
219
+ * @param {ConfigDefaults} defaults - ConfigDefaults
209
220
  * @returns {Promise<void>}
210
221
  */
211
222
  export function setDefaults(remoteConfig, defaults) {
@@ -214,8 +225,8 @@ export function setDefaults(remoteConfig, defaults) {
214
225
 
215
226
  /**
216
227
  * Fetches parameter values for your app.
217
- * @param remoteConfig - RemoteConfig instance
218
- * @param resourceName - string
228
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
229
+ * @param {string} resourceName - string
219
230
  * @returns {Promise<null>}
220
231
  */
221
232
  export function setDefaultsFromResource(remoteConfig, resourceName) {
@@ -225,8 +236,8 @@ export function setDefaultsFromResource(remoteConfig, resourceName) {
225
236
  /**
226
237
  * Registers a listener to changes in the configuration.
227
238
  *
228
- * @param remoteConfig - RemoteConfig instance
229
- * @param callback - function called on config change
239
+ * @param {RemoteConfig} remoteConfig - RemoteConfig instance
240
+ * @param {function(ConfigValues): void} callback - function called on config change
230
241
  * @returns {function} unsubscribe listener
231
242
  */
232
243
  export function onConfigUpdated(remoteConfig, callback) {
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- module.exports = '20.2.1';
2
+ module.exports = '20.4.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/remote-config",
3
- "version": "20.2.1",
3
+ "version": "20.4.0",
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": "20.2.1",
28
- "@react-native-firebase/app": "20.2.1"
27
+ "@react-native-firebase/analytics": "20.4.0",
28
+ "@react-native-firebase/app": "20.4.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public"
32
32
  },
33
- "gitHead": "2c787c2dbefbefcc637018e1e5d74a73b39600ab"
33
+ "gitHead": "3ac3e9623674a8db52c111b4aa0a85a883260116"
34
34
  }