@react-native-firebase/remote-config 26.1.0 → 26.3.0
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 +13 -0
- package/RNFBRemoteConfig.podspec +9 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/CMakeLists.txt +1 -9
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI.h +122 -159
- package/dist/module/index.js +6 -4
- package/dist/module/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/index.d.ts +1 -1
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBConfig/RNFBConfigHelper.m +8 -7
- package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules.h +2 -2
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI.h +122 -159
- package/lib/index.ts +13 -5
- package/lib/version.ts +1 -1
- package/package.json +7 -7
- package/specs/NativeRNFBTurboConfig.ts +7 -6
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI-generated.cpp +0 -110
- package/ios/generated/RCTAppDependencyProvider.h +0 -25
- package/ios/generated/RCTAppDependencyProvider.mm +0 -55
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +0 -18
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +0 -33
- package/ios/generated/RCTThirdPartyComponentsProvider.h +0 -16
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +0 -23
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI-generated.cpp +0 -110
- package/ios/generated/ReactAppDependencyProvider.podspec +0 -34
|
@@ -118,8 +118,8 @@ expirationDurationSeconds:(double)expirationDurationSeconds
|
|
|
118
118
|
customSignals:(NSDictionary *)customSignals
|
|
119
119
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
120
120
|
reject:(RCTPromiseRejectBlock)reject;
|
|
121
|
-
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboConfig::Constants
|
|
122
|
-
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboConfig::Constants
|
|
121
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboConfig::Constants>)constantsToExport;
|
|
122
|
+
- (facebook::react::ModuleConstants<JS::NativeRNFBTurboConfig::Constants>)getConstants;
|
|
123
123
|
|
|
124
124
|
@end
|
|
125
125
|
|
|
@@ -15,12 +15,11 @@
|
|
|
15
15
|
namespace facebook::react {
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
#pragma mark - NativeRNFBTurboConfigBooleanRemoteConfigResult
|
|
20
19
|
|
|
21
20
|
template <typename P0, typename P1>
|
|
22
21
|
struct NativeRNFBTurboConfigBooleanRemoteConfigResult {
|
|
23
|
-
P0 result;
|
|
22
|
+
P0 result{};
|
|
24
23
|
P1 constants;
|
|
25
24
|
bool operator==(const NativeRNFBTurboConfigBooleanRemoteConfigResult &other) const {
|
|
26
25
|
return result == other.result && constants == other.constants;
|
|
@@ -45,7 +44,6 @@ struct NativeRNFBTurboConfigBooleanRemoteConfigResultBridging {
|
|
|
45
44
|
static bool resultToJs(jsi::Runtime &rt, decltype(types.result) value) {
|
|
46
45
|
return bridging::toJs(rt, value);
|
|
47
46
|
}
|
|
48
|
-
|
|
49
47
|
static jsi::Object constantsToJs(jsi::Runtime &rt, decltype(types.constants) value) {
|
|
50
48
|
return bridging::toJs(rt, value);
|
|
51
49
|
}
|
|
@@ -68,7 +66,7 @@ struct NativeRNFBTurboConfigBooleanRemoteConfigResultBridging {
|
|
|
68
66
|
|
|
69
67
|
template <typename P0, typename P1>
|
|
70
68
|
struct NativeRNFBTurboConfigConfigSettings {
|
|
71
|
-
P0 fetchTimeout;
|
|
69
|
+
P0 fetchTimeout{};
|
|
72
70
|
P1 minimumFetchInterval;
|
|
73
71
|
bool operator==(const NativeRNFBTurboConfigConfigSettings &other) const {
|
|
74
72
|
return fetchTimeout == other.fetchTimeout && minimumFetchInterval == other.minimumFetchInterval;
|
|
@@ -93,7 +91,6 @@ struct NativeRNFBTurboConfigConfigSettingsBridging {
|
|
|
93
91
|
static double fetchTimeoutToJs(jsi::Runtime &rt, decltype(types.fetchTimeout) value) {
|
|
94
92
|
return bridging::toJs(rt, value);
|
|
95
93
|
}
|
|
96
|
-
|
|
97
94
|
static double minimumFetchIntervalToJs(jsi::Runtime &rt, decltype(types.minimumFetchInterval) value) {
|
|
98
95
|
return bridging::toJs(rt, value);
|
|
99
96
|
}
|
|
@@ -116,7 +113,7 @@ struct NativeRNFBTurboConfigConfigSettingsBridging {
|
|
|
116
113
|
|
|
117
114
|
template <typename P0, typename P1>
|
|
118
115
|
struct NativeRNFBTurboConfigNullRemoteConfigResult {
|
|
119
|
-
P0 result;
|
|
116
|
+
P0 result{};
|
|
120
117
|
P1 constants;
|
|
121
118
|
bool operator==(const NativeRNFBTurboConfigNullRemoteConfigResult &other) const {
|
|
122
119
|
return result == other.result && constants == other.constants;
|
|
@@ -141,7 +138,6 @@ struct NativeRNFBTurboConfigNullRemoteConfigResultBridging {
|
|
|
141
138
|
static std::optional<jsi::String> resultToJs(jsi::Runtime &rt, decltype(types.result) value) {
|
|
142
139
|
return bridging::toJs(rt, value);
|
|
143
140
|
}
|
|
144
|
-
|
|
145
141
|
static jsi::Object constantsToJs(jsi::Runtime &rt, decltype(types.constants) value) {
|
|
146
142
|
return bridging::toJs(rt, value);
|
|
147
143
|
}
|
|
@@ -164,10 +160,10 @@ struct NativeRNFBTurboConfigNullRemoteConfigResultBridging {
|
|
|
164
160
|
|
|
165
161
|
template <typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
166
162
|
struct NativeRNFBTurboConfigRemoteConfigConstants {
|
|
167
|
-
P0 fetchTimeout;
|
|
168
|
-
P1 minimumFetchInterval;
|
|
169
|
-
P2 lastFetchTime;
|
|
170
|
-
P3 lastFetchStatus;
|
|
163
|
+
P0 fetchTimeout{};
|
|
164
|
+
P1 minimumFetchInterval{};
|
|
165
|
+
P2 lastFetchTime{};
|
|
166
|
+
P3 lastFetchStatus{};
|
|
171
167
|
P4 values;
|
|
172
168
|
bool operator==(const NativeRNFBTurboConfigRemoteConfigConstants &other) const {
|
|
173
169
|
return fetchTimeout == other.fetchTimeout && minimumFetchInterval == other.minimumFetchInterval && lastFetchTime == other.lastFetchTime && lastFetchStatus == other.lastFetchStatus && values == other.values;
|
|
@@ -195,19 +191,15 @@ struct NativeRNFBTurboConfigRemoteConfigConstantsBridging {
|
|
|
195
191
|
static double fetchTimeoutToJs(jsi::Runtime &rt, decltype(types.fetchTimeout) value) {
|
|
196
192
|
return bridging::toJs(rt, value);
|
|
197
193
|
}
|
|
198
|
-
|
|
199
194
|
static double minimumFetchIntervalToJs(jsi::Runtime &rt, decltype(types.minimumFetchInterval) value) {
|
|
200
195
|
return bridging::toJs(rt, value);
|
|
201
196
|
}
|
|
202
|
-
|
|
203
197
|
static double lastFetchTimeToJs(jsi::Runtime &rt, decltype(types.lastFetchTime) value) {
|
|
204
198
|
return bridging::toJs(rt, value);
|
|
205
199
|
}
|
|
206
|
-
|
|
207
200
|
static jsi::String lastFetchStatusToJs(jsi::Runtime &rt, decltype(types.lastFetchStatus) value) {
|
|
208
201
|
return bridging::toJs(rt, value);
|
|
209
202
|
}
|
|
210
|
-
|
|
211
203
|
static jsi::Object valuesToJs(jsi::Runtime &rt, decltype(types.values) value) {
|
|
212
204
|
return bridging::toJs(rt, value);
|
|
213
205
|
}
|
|
@@ -233,7 +225,7 @@ struct NativeRNFBTurboConfigRemoteConfigConstantsBridging {
|
|
|
233
225
|
|
|
234
226
|
template <typename P0, typename P1>
|
|
235
227
|
struct NativeRNFBTurboConfigStoredConfigValue {
|
|
236
|
-
P0 value;
|
|
228
|
+
P0 value{};
|
|
237
229
|
P1 source;
|
|
238
230
|
bool operator==(const NativeRNFBTurboConfigStoredConfigValue &other) const {
|
|
239
231
|
return value == other.value && source == other.source;
|
|
@@ -258,7 +250,6 @@ struct NativeRNFBTurboConfigStoredConfigValueBridging {
|
|
|
258
250
|
static jsi::Object valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
259
251
|
return bridging::toJs(rt, value);
|
|
260
252
|
}
|
|
261
|
-
|
|
262
253
|
static jsi::String sourceToJs(jsi::Runtime &rt, decltype(types.source) value) {
|
|
263
254
|
return bridging::toJs(rt, value);
|
|
264
255
|
}
|
|
@@ -316,156 +307,128 @@ struct NativeRNFBTurboConfigVoidRemoteConfigResultBridging {
|
|
|
316
307
|
}
|
|
317
308
|
};
|
|
318
309
|
|
|
319
|
-
class JSI_EXPORT NativeRNFBTurboConfigCxxSpecJSI : public TurboModule {
|
|
320
|
-
protected:
|
|
321
|
-
NativeRNFBTurboConfigCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
322
|
-
|
|
323
|
-
public:
|
|
324
|
-
virtual jsi::Object getConstants(jsi::Runtime &rt) = 0;
|
|
325
|
-
virtual jsi::Value activate(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
326
|
-
virtual jsi::Value setConfigSettings(jsi::Runtime &rt, jsi::String appName, jsi::Object settings) = 0;
|
|
327
|
-
virtual jsi::Value fetch(jsi::Runtime &rt, jsi::String appName, double expirationDurationSeconds) = 0;
|
|
328
|
-
virtual jsi::Value fetchAndActivate(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
329
|
-
virtual jsi::Value ensureInitialized(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
330
|
-
virtual jsi::Value setDefaults(jsi::Runtime &rt, jsi::String appName, jsi::Object defaults) = 0;
|
|
331
|
-
virtual jsi::Value setDefaultsFromResource(jsi::Runtime &rt, jsi::String appName, jsi::String resourceName) = 0;
|
|
332
|
-
virtual jsi::Value reset(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
333
|
-
virtual void onConfigUpdated(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
334
|
-
virtual void removeConfigUpdateRegistration(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
335
|
-
virtual jsi::Value setCustomSignals(jsi::Runtime &rt, jsi::String appName, jsi::Object customSignals) = 0;
|
|
336
|
-
|
|
337
|
-
};
|
|
338
310
|
|
|
339
311
|
template <typename T>
|
|
340
312
|
class JSI_EXPORT NativeRNFBTurboConfigCxxSpec : public TurboModule {
|
|
341
313
|
public:
|
|
342
|
-
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
343
|
-
return delegate_.create(rt, propName);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
347
|
-
return delegate_.getPropertyNames(runtime);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
314
|
static constexpr std::string_view kModuleName = "NativeRNFBTurboConfig";
|
|
351
315
|
|
|
352
316
|
protected:
|
|
353
|
-
NativeRNFBTurboConfigCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
317
|
+
NativeRNFBTurboConfigCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeRNFBTurboConfigCxxSpec::kModuleName}, jsInvoker) {
|
|
318
|
+
methodMap_["getConstants"] = MethodMetadata {.argCount = 0, .invoker = __getConstants};
|
|
319
|
+
methodMap_["activate"] = MethodMetadata {.argCount = 1, .invoker = __activate};
|
|
320
|
+
methodMap_["setConfigSettings"] = MethodMetadata {.argCount = 2, .invoker = __setConfigSettings};
|
|
321
|
+
methodMap_["fetch"] = MethodMetadata {.argCount = 2, .invoker = __fetch};
|
|
322
|
+
methodMap_["fetchAndActivate"] = MethodMetadata {.argCount = 1, .invoker = __fetchAndActivate};
|
|
323
|
+
methodMap_["ensureInitialized"] = MethodMetadata {.argCount = 1, .invoker = __ensureInitialized};
|
|
324
|
+
methodMap_["setDefaults"] = MethodMetadata {.argCount = 2, .invoker = __setDefaults};
|
|
325
|
+
methodMap_["setDefaultsFromResource"] = MethodMetadata {.argCount = 2, .invoker = __setDefaultsFromResource};
|
|
326
|
+
methodMap_["reset"] = MethodMetadata {.argCount = 1, .invoker = __reset};
|
|
327
|
+
methodMap_["onConfigUpdated"] = MethodMetadata {.argCount = 1, .invoker = __onConfigUpdated};
|
|
328
|
+
methodMap_["removeConfigUpdateRegistration"] = MethodMetadata {.argCount = 1, .invoker = __removeConfigUpdateRegistration};
|
|
329
|
+
methodMap_["setCustomSignals"] = MethodMetadata {.argCount = 2, .invoker = __setCustomSignals};
|
|
330
|
+
}
|
|
331
|
+
|
|
358
332
|
private:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
jsi::Value reset(
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
void onConfigUpdated(
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
void removeConfigUpdateRegistration(
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
jsi::Value
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
return bridging::callFromJs<jsi::Value>(
|
|
460
|
-
rt, &T::setCustomSignals, jsInvoker_, instance_, std::move(appName), std::move(customSignals));
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
private:
|
|
464
|
-
friend class NativeRNFBTurboConfigCxxSpec;
|
|
465
|
-
T *instance_;
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
Delegate delegate_;
|
|
333
|
+
static jsi::Value __getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
334
|
+
static_assert(
|
|
335
|
+
bridging::getParameterCount(&T::getConstants) == 1,
|
|
336
|
+
"Expected getConstants(...) to have 1 parameters");
|
|
337
|
+
return bridging::callFromJs<jsi::Object>(rt, &T::getConstants, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
static jsi::Value __activate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
341
|
+
static_assert(
|
|
342
|
+
bridging::getParameterCount(&T::activate) == 2,
|
|
343
|
+
"Expected activate(...) to have 2 parameters");
|
|
344
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::activate, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
345
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
static jsi::Value __setConfigSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
349
|
+
static_assert(
|
|
350
|
+
bridging::getParameterCount(&T::setConfigSettings) == 3,
|
|
351
|
+
"Expected setConfigSettings(...) to have 3 parameters");
|
|
352
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::setConfigSettings, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
353
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
354
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
static jsi::Value __fetch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
358
|
+
static_assert(
|
|
359
|
+
bridging::getParameterCount(&T::fetch) == 3,
|
|
360
|
+
"Expected fetch(...) to have 3 parameters");
|
|
361
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::fetch, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
362
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
363
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber());
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
static jsi::Value __fetchAndActivate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
367
|
+
static_assert(
|
|
368
|
+
bridging::getParameterCount(&T::fetchAndActivate) == 2,
|
|
369
|
+
"Expected fetchAndActivate(...) to have 2 parameters");
|
|
370
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::fetchAndActivate, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
371
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
static jsi::Value __ensureInitialized(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
375
|
+
static_assert(
|
|
376
|
+
bridging::getParameterCount(&T::ensureInitialized) == 2,
|
|
377
|
+
"Expected ensureInitialized(...) to have 2 parameters");
|
|
378
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::ensureInitialized, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
379
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
static jsi::Value __setDefaults(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
383
|
+
static_assert(
|
|
384
|
+
bridging::getParameterCount(&T::setDefaults) == 3,
|
|
385
|
+
"Expected setDefaults(...) to have 3 parameters");
|
|
386
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::setDefaults, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
387
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
388
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt));
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
static jsi::Value __setDefaultsFromResource(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
392
|
+
static_assert(
|
|
393
|
+
bridging::getParameterCount(&T::setDefaultsFromResource) == 3,
|
|
394
|
+
"Expected setDefaultsFromResource(...) to have 3 parameters");
|
|
395
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::setDefaultsFromResource, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
396
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
397
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt));
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
static jsi::Value __reset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
401
|
+
static_assert(
|
|
402
|
+
bridging::getParameterCount(&T::reset) == 2,
|
|
403
|
+
"Expected reset(...) to have 2 parameters");
|
|
404
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::reset, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
405
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
static jsi::Value __onConfigUpdated(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
409
|
+
static_assert(
|
|
410
|
+
bridging::getParameterCount(&T::onConfigUpdated) == 2,
|
|
411
|
+
"Expected onConfigUpdated(...) to have 2 parameters");
|
|
412
|
+
bridging::callFromJs<void>(rt, &T::onConfigUpdated, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
413
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));return jsi::Value::undefined();
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
static jsi::Value __removeConfigUpdateRegistration(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
417
|
+
static_assert(
|
|
418
|
+
bridging::getParameterCount(&T::removeConfigUpdateRegistration) == 2,
|
|
419
|
+
"Expected removeConfigUpdateRegistration(...) to have 2 parameters");
|
|
420
|
+
bridging::callFromJs<void>(rt, &T::removeConfigUpdateRegistration, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
421
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));return jsi::Value::undefined();
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
static jsi::Value __setCustomSignals(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
425
|
+
static_assert(
|
|
426
|
+
bridging::getParameterCount(&T::setCustomSignals) == 3,
|
|
427
|
+
"Expected setCustomSignals(...) to have 3 parameters");
|
|
428
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::setCustomSignals, static_cast<NativeRNFBTurboConfigCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
429
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
430
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt));
|
|
431
|
+
}
|
|
469
432
|
};
|
|
470
433
|
|
|
471
434
|
} // namespace facebook::react
|
package/lib/index.ts
CHANGED
|
@@ -317,7 +317,9 @@ class FirebaseConfigModule extends FirebaseModule<typeof nativeModuleName> {
|
|
|
317
317
|
* @returns {Promise<boolean>}
|
|
318
318
|
*/
|
|
319
319
|
activate(): Promise<boolean> {
|
|
320
|
-
|
|
320
|
+
// Wait for queued setters (settings / defaults) but do not serialize fetch-length
|
|
321
|
+
// work onto `_nativeMutationQueue`. A fetch can run up to fetchTimeoutMillis.
|
|
322
|
+
return this._nativeMutationQueue.then(() => this._promiseWithConstants(this.native.activate()));
|
|
321
323
|
}
|
|
322
324
|
|
|
323
325
|
/**
|
|
@@ -333,17 +335,23 @@ class FirebaseConfigModule extends FirebaseModule<typeof nativeModuleName> {
|
|
|
333
335
|
);
|
|
334
336
|
}
|
|
335
337
|
|
|
336
|
-
return this.
|
|
337
|
-
this.
|
|
338
|
+
return this._nativeMutationQueue.then(() =>
|
|
339
|
+
this._promiseWithConstants(
|
|
340
|
+
this.native.fetch(expirationDurationSeconds !== undefined ? expirationDurationSeconds : -1),
|
|
341
|
+
),
|
|
338
342
|
);
|
|
339
343
|
}
|
|
340
344
|
|
|
341
345
|
fetchAndActivate(): Promise<boolean> {
|
|
342
|
-
return this.
|
|
346
|
+
return this._nativeMutationQueue.then(() =>
|
|
347
|
+
this._promiseWithConstants(this.native.fetchAndActivate()),
|
|
348
|
+
);
|
|
343
349
|
}
|
|
344
350
|
|
|
345
351
|
ensureInitialized(): Promise<void> {
|
|
346
|
-
return this.
|
|
352
|
+
return this._nativeMutationQueue.then(() =>
|
|
353
|
+
this._promiseWithConstants(this.native.ensureInitialized()),
|
|
354
|
+
);
|
|
347
355
|
}
|
|
348
356
|
|
|
349
357
|
/**
|
package/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '26.
|
|
2
|
+
export const version = '26.3.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/remote-config",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.3.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": "./dist/module/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"compile": "bob build",
|
|
26
26
|
"prepare": "yarn run build && yarn compile",
|
|
27
27
|
"codegen": "yarn android:codegen && yarn ios:codegen",
|
|
28
|
-
"android:codegen": "
|
|
29
|
-
"ios:codegen": "
|
|
28
|
+
"android:codegen": "node ../../scripts/codegen-package.mjs remote-config android",
|
|
29
|
+
"ios:codegen": "node ../../scripts/codegen-package.mjs remote-config ios"
|
|
30
30
|
},
|
|
31
31
|
"repository": {
|
|
32
32
|
"type": "git",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"remote-config"
|
|
43
43
|
],
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@react-native-firebase/analytics": "26.
|
|
46
|
-
"@react-native-firebase/app": "26.
|
|
45
|
+
"@react-native-firebase/analytics": "26.3.0",
|
|
46
|
+
"@react-native-firebase/app": "26.3.0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"web-streams-polyfill": "^4.2.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@react-native-firebase/app": "26.
|
|
58
|
+
"@react-native-firebase/app": "26.3.0",
|
|
59
59
|
"@types/text-encoding": "^0.0.40",
|
|
60
60
|
"react-native-builder-bob": "^0.41.0",
|
|
61
61
|
"typescript": "^6.0.3"
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"node_modules/",
|
|
91
91
|
"dist/"
|
|
92
92
|
],
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "12a52d40c0d156d05a16f4b49eb0e507c0f5d8c5"
|
|
94
94
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-wrapper-object-types */
|
|
1
2
|
import type { TurboModule } from 'react-native';
|
|
2
3
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
4
|
|
|
4
5
|
export type LastFetchStatus = 'success' | 'failure' | 'no_fetch_yet' | 'throttled' | 'unknown';
|
|
5
6
|
|
|
6
7
|
export interface StoredConfigValue {
|
|
7
|
-
|
|
8
|
+
// Codegen (RN 0.86+) rejects heterogeneous unions (string|number|boolean).
|
|
9
|
+
// Native already treats this as Object / id; JS narrows via RemoteConfigValue helpers.
|
|
10
|
+
value: Object;
|
|
8
11
|
source: 'default' | 'remote' | 'static' | 'unknown';
|
|
9
12
|
}
|
|
10
13
|
|
|
@@ -45,16 +48,14 @@ export interface Spec extends TurboModule {
|
|
|
45
48
|
ensureInitialized(appName: string): Promise<VoidRemoteConfigResult>;
|
|
46
49
|
setDefaults(
|
|
47
50
|
appName: string,
|
|
48
|
-
|
|
51
|
+
// Codegen rejects heterogeneous value unions; ReadableMap on native.
|
|
52
|
+
defaults: Object,
|
|
49
53
|
): Promise<NullRemoteConfigResult>;
|
|
50
54
|
setDefaultsFromResource(appName: string, resourceName: string): Promise<NullRemoteConfigResult>;
|
|
51
55
|
reset(appName: string): Promise<VoidRemoteConfigResult>;
|
|
52
56
|
onConfigUpdated(appName: string): void;
|
|
53
57
|
removeConfigUpdateRegistration(appName: string): void;
|
|
54
|
-
setCustomSignals(
|
|
55
|
-
appName: string,
|
|
56
|
-
customSignals: { [key: string]: string | number | null },
|
|
57
|
-
): Promise<VoidRemoteConfigResult>;
|
|
58
|
+
setCustomSignals(appName: string, customSignals: Object): Promise<VoidRemoteConfigResult>;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
export default TurboModuleRegistry.getEnforcing<Spec>('NativeRNFBTurboConfig');
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
-
*
|
|
4
|
-
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
-
* once the code is regenerated.
|
|
6
|
-
*
|
|
7
|
-
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#include "RNFBRemoteConfigTurboModulesJSI.h"
|
|
11
|
-
|
|
12
|
-
namespace facebook::react {
|
|
13
|
-
|
|
14
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->getConstants(
|
|
16
|
-
rt
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_activate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
20
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->activate(
|
|
21
|
-
rt,
|
|
22
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setConfigSettings(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
26
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->setConfigSettings(
|
|
27
|
-
rt,
|
|
28
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
29
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_fetch(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
33
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->fetch(
|
|
34
|
-
rt,
|
|
35
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
36
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber()
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_fetchAndActivate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
40
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->fetchAndActivate(
|
|
41
|
-
rt,
|
|
42
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_ensureInitialized(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
46
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->ensureInitialized(
|
|
47
|
-
rt,
|
|
48
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setDefaults(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
52
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->setDefaults(
|
|
53
|
-
rt,
|
|
54
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
55
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setDefaultsFromResource(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
59
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->setDefaultsFromResource(
|
|
60
|
-
rt,
|
|
61
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
62
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_reset(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
66
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->reset(
|
|
67
|
-
rt,
|
|
68
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_onConfigUpdated(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
72
|
-
static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->onConfigUpdated(
|
|
73
|
-
rt,
|
|
74
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
75
|
-
);
|
|
76
|
-
return jsi::Value::undefined();
|
|
77
|
-
}
|
|
78
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_removeConfigUpdateRegistration(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
79
|
-
static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->removeConfigUpdateRegistration(
|
|
80
|
-
rt,
|
|
81
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
82
|
-
);
|
|
83
|
-
return jsi::Value::undefined();
|
|
84
|
-
}
|
|
85
|
-
static jsi::Value __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setCustomSignals(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
86
|
-
return static_cast<NativeRNFBTurboConfigCxxSpecJSI *>(&turboModule)->setCustomSignals(
|
|
87
|
-
rt,
|
|
88
|
-
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
89
|
-
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt)
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
NativeRNFBTurboConfigCxxSpecJSI::NativeRNFBTurboConfigCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
94
|
-
: TurboModule("NativeRNFBTurboConfig", jsInvoker) {
|
|
95
|
-
methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_getConstants};
|
|
96
|
-
methodMap_["activate"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_activate};
|
|
97
|
-
methodMap_["setConfigSettings"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setConfigSettings};
|
|
98
|
-
methodMap_["fetch"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_fetch};
|
|
99
|
-
methodMap_["fetchAndActivate"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_fetchAndActivate};
|
|
100
|
-
methodMap_["ensureInitialized"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_ensureInitialized};
|
|
101
|
-
methodMap_["setDefaults"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setDefaults};
|
|
102
|
-
methodMap_["setDefaultsFromResource"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setDefaultsFromResource};
|
|
103
|
-
methodMap_["reset"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_reset};
|
|
104
|
-
methodMap_["onConfigUpdated"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_onConfigUpdated};
|
|
105
|
-
methodMap_["removeConfigUpdateRegistration"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_removeConfigUpdateRegistration};
|
|
106
|
-
methodMap_["setCustomSignals"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboConfigCxxSpecJSI_setCustomSignals};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
} // namespace facebook::react
|