@react-native-firebase/remote-config 25.1.0 → 26.1.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 +38 -0
- package/RNFBRemoteConfig.podspec +9 -7
- package/android/build.gradle +19 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/{ReactNativeFirebaseConfigModule.java → NativeRNFBTurboConfig.java} +53 -40
- package/android/src/reactnative/java/io/invertase/firebase/config/ReactNativeFirebaseConfigPackage.java +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboConfigSpec.java +115 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/CMakeLists.txt +36 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules-generated.cpp +98 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/RNFBRemoteConfigTurboModules.h +31 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
- package/android/src/reactnative/java/io/invertase/firebase/config/generated/jni/react/renderer/components/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModulesJSI.h +471 -0
- package/dist/module/index.js +499 -5
- package/dist/module/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/index.d.ts +83 -5
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +25 -24
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/types/remote-config.d.ts +24 -3
- package/dist/typescript/lib/types/remote-config.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBConfig/RNFBConfigHelper.h +89 -0
- package/ios/RNFBConfig/{RNFBConfigModule.m → RNFBConfigHelper.m} +176 -165
- package/ios/RNFBConfig/RNFBConfigModule.h +3 -2
- package/ios/RNFBConfig/RNFBConfigModule.mm +134 -0
- package/ios/RNFBConfig.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules-generated.mm +121 -0
- package/ios/generated/RNFBRemoteConfigTurboModules/RNFBRemoteConfigTurboModules.h +172 -0
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI-generated.cpp +110 -0
- package/ios/generated/RNFBRemoteConfigTurboModulesJSI.h +471 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/index.ts +683 -8
- package/lib/types/internal.ts +25 -44
- package/lib/types/remote-config.ts +28 -3
- package/lib/version.ts +1 -1
- package/package.json +23 -5
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboConfig.ts +60 -0
- package/typedoc.json +1 -1
- package/dist/module/modular.js +0 -155
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -400
- package/dist/module/namespaced.js.map +0 -1
- package/dist/module/types/namespaced.js +0 -24
- package/dist/module/types/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -76
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -11
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/dist/typescript/lib/types/namespaced.d.ts +0 -124
- package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
- package/lib/modular.ts +0 -197
- package/lib/namespaced.ts +0 -552
- package/lib/types/namespaced.ts +0 -163
|
@@ -0,0 +1,471 @@
|
|
|
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: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
#pragma mark - NativeRNFBTurboConfigBooleanRemoteConfigResult
|
|
20
|
+
|
|
21
|
+
template <typename P0, typename P1>
|
|
22
|
+
struct NativeRNFBTurboConfigBooleanRemoteConfigResult {
|
|
23
|
+
P0 result;
|
|
24
|
+
P1 constants;
|
|
25
|
+
bool operator==(const NativeRNFBTurboConfigBooleanRemoteConfigResult &other) const {
|
|
26
|
+
return result == other.result && constants == other.constants;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
template <typename T>
|
|
31
|
+
struct NativeRNFBTurboConfigBooleanRemoteConfigResultBridging {
|
|
32
|
+
static T types;
|
|
33
|
+
|
|
34
|
+
static T fromJs(
|
|
35
|
+
jsi::Runtime &rt,
|
|
36
|
+
const jsi::Object &value,
|
|
37
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
38
|
+
T result{
|
|
39
|
+
bridging::fromJs<decltype(types.result)>(rt, value.getProperty(rt, "result"), jsInvoker),
|
|
40
|
+
bridging::fromJs<decltype(types.constants)>(rt, value.getProperty(rt, "constants"), jsInvoker)};
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#ifdef DEBUG
|
|
45
|
+
static bool resultToJs(jsi::Runtime &rt, decltype(types.result) value) {
|
|
46
|
+
return bridging::toJs(rt, value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static jsi::Object constantsToJs(jsi::Runtime &rt, decltype(types.constants) value) {
|
|
50
|
+
return bridging::toJs(rt, value);
|
|
51
|
+
}
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
static jsi::Object toJs(
|
|
55
|
+
jsi::Runtime &rt,
|
|
56
|
+
const T &value,
|
|
57
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
58
|
+
auto result = facebook::jsi::Object(rt);
|
|
59
|
+
result.setProperty(rt, "result", bridging::toJs(rt, value.result, jsInvoker));
|
|
60
|
+
result.setProperty(rt, "constants", bridging::toJs(rt, value.constants, jsInvoker));
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
#pragma mark - NativeRNFBTurboConfigConfigSettings
|
|
68
|
+
|
|
69
|
+
template <typename P0, typename P1>
|
|
70
|
+
struct NativeRNFBTurboConfigConfigSettings {
|
|
71
|
+
P0 fetchTimeout;
|
|
72
|
+
P1 minimumFetchInterval;
|
|
73
|
+
bool operator==(const NativeRNFBTurboConfigConfigSettings &other) const {
|
|
74
|
+
return fetchTimeout == other.fetchTimeout && minimumFetchInterval == other.minimumFetchInterval;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
template <typename T>
|
|
79
|
+
struct NativeRNFBTurboConfigConfigSettingsBridging {
|
|
80
|
+
static T types;
|
|
81
|
+
|
|
82
|
+
static T fromJs(
|
|
83
|
+
jsi::Runtime &rt,
|
|
84
|
+
const jsi::Object &value,
|
|
85
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
86
|
+
T result{
|
|
87
|
+
bridging::fromJs<decltype(types.fetchTimeout)>(rt, value.getProperty(rt, "fetchTimeout"), jsInvoker),
|
|
88
|
+
bridging::fromJs<decltype(types.minimumFetchInterval)>(rt, value.getProperty(rt, "minimumFetchInterval"), jsInvoker)};
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
#ifdef DEBUG
|
|
93
|
+
static double fetchTimeoutToJs(jsi::Runtime &rt, decltype(types.fetchTimeout) value) {
|
|
94
|
+
return bridging::toJs(rt, value);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static double minimumFetchIntervalToJs(jsi::Runtime &rt, decltype(types.minimumFetchInterval) value) {
|
|
98
|
+
return bridging::toJs(rt, value);
|
|
99
|
+
}
|
|
100
|
+
#endif
|
|
101
|
+
|
|
102
|
+
static jsi::Object toJs(
|
|
103
|
+
jsi::Runtime &rt,
|
|
104
|
+
const T &value,
|
|
105
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
106
|
+
auto result = facebook::jsi::Object(rt);
|
|
107
|
+
result.setProperty(rt, "fetchTimeout", bridging::toJs(rt, value.fetchTimeout, jsInvoker));
|
|
108
|
+
result.setProperty(rt, "minimumFetchInterval", bridging::toJs(rt, value.minimumFetchInterval, jsInvoker));
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
#pragma mark - NativeRNFBTurboConfigNullRemoteConfigResult
|
|
116
|
+
|
|
117
|
+
template <typename P0, typename P1>
|
|
118
|
+
struct NativeRNFBTurboConfigNullRemoteConfigResult {
|
|
119
|
+
P0 result;
|
|
120
|
+
P1 constants;
|
|
121
|
+
bool operator==(const NativeRNFBTurboConfigNullRemoteConfigResult &other) const {
|
|
122
|
+
return result == other.result && constants == other.constants;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
template <typename T>
|
|
127
|
+
struct NativeRNFBTurboConfigNullRemoteConfigResultBridging {
|
|
128
|
+
static T types;
|
|
129
|
+
|
|
130
|
+
static T fromJs(
|
|
131
|
+
jsi::Runtime &rt,
|
|
132
|
+
const jsi::Object &value,
|
|
133
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
134
|
+
T result{
|
|
135
|
+
bridging::fromJs<decltype(types.result)>(rt, value.getProperty(rt, "result"), jsInvoker),
|
|
136
|
+
bridging::fromJs<decltype(types.constants)>(rt, value.getProperty(rt, "constants"), jsInvoker)};
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#ifdef DEBUG
|
|
141
|
+
static std::optional<jsi::String> resultToJs(jsi::Runtime &rt, decltype(types.result) value) {
|
|
142
|
+
return bridging::toJs(rt, value);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static jsi::Object constantsToJs(jsi::Runtime &rt, decltype(types.constants) value) {
|
|
146
|
+
return bridging::toJs(rt, value);
|
|
147
|
+
}
|
|
148
|
+
#endif
|
|
149
|
+
|
|
150
|
+
static jsi::Object toJs(
|
|
151
|
+
jsi::Runtime &rt,
|
|
152
|
+
const T &value,
|
|
153
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
154
|
+
auto result = facebook::jsi::Object(rt);
|
|
155
|
+
result.setProperty(rt, "result", bridging::toJs(rt, value.result, jsInvoker));
|
|
156
|
+
result.setProperty(rt, "constants", bridging::toJs(rt, value.constants, jsInvoker));
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
#pragma mark - NativeRNFBTurboConfigRemoteConfigConstants
|
|
164
|
+
|
|
165
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
166
|
+
struct NativeRNFBTurboConfigRemoteConfigConstants {
|
|
167
|
+
P0 fetchTimeout;
|
|
168
|
+
P1 minimumFetchInterval;
|
|
169
|
+
P2 lastFetchTime;
|
|
170
|
+
P3 lastFetchStatus;
|
|
171
|
+
P4 values;
|
|
172
|
+
bool operator==(const NativeRNFBTurboConfigRemoteConfigConstants &other) const {
|
|
173
|
+
return fetchTimeout == other.fetchTimeout && minimumFetchInterval == other.minimumFetchInterval && lastFetchTime == other.lastFetchTime && lastFetchStatus == other.lastFetchStatus && values == other.values;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
template <typename T>
|
|
178
|
+
struct NativeRNFBTurboConfigRemoteConfigConstantsBridging {
|
|
179
|
+
static T types;
|
|
180
|
+
|
|
181
|
+
static T fromJs(
|
|
182
|
+
jsi::Runtime &rt,
|
|
183
|
+
const jsi::Object &value,
|
|
184
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
185
|
+
T result{
|
|
186
|
+
bridging::fromJs<decltype(types.fetchTimeout)>(rt, value.getProperty(rt, "fetchTimeout"), jsInvoker),
|
|
187
|
+
bridging::fromJs<decltype(types.minimumFetchInterval)>(rt, value.getProperty(rt, "minimumFetchInterval"), jsInvoker),
|
|
188
|
+
bridging::fromJs<decltype(types.lastFetchTime)>(rt, value.getProperty(rt, "lastFetchTime"), jsInvoker),
|
|
189
|
+
bridging::fromJs<decltype(types.lastFetchStatus)>(rt, value.getProperty(rt, "lastFetchStatus"), jsInvoker),
|
|
190
|
+
bridging::fromJs<decltype(types.values)>(rt, value.getProperty(rt, "values"), jsInvoker)};
|
|
191
|
+
return result;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
#ifdef DEBUG
|
|
195
|
+
static double fetchTimeoutToJs(jsi::Runtime &rt, decltype(types.fetchTimeout) value) {
|
|
196
|
+
return bridging::toJs(rt, value);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static double minimumFetchIntervalToJs(jsi::Runtime &rt, decltype(types.minimumFetchInterval) value) {
|
|
200
|
+
return bridging::toJs(rt, value);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static double lastFetchTimeToJs(jsi::Runtime &rt, decltype(types.lastFetchTime) value) {
|
|
204
|
+
return bridging::toJs(rt, value);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
static jsi::String lastFetchStatusToJs(jsi::Runtime &rt, decltype(types.lastFetchStatus) value) {
|
|
208
|
+
return bridging::toJs(rt, value);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
static jsi::Object valuesToJs(jsi::Runtime &rt, decltype(types.values) value) {
|
|
212
|
+
return bridging::toJs(rt, value);
|
|
213
|
+
}
|
|
214
|
+
#endif
|
|
215
|
+
|
|
216
|
+
static jsi::Object toJs(
|
|
217
|
+
jsi::Runtime &rt,
|
|
218
|
+
const T &value,
|
|
219
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
220
|
+
auto result = facebook::jsi::Object(rt);
|
|
221
|
+
result.setProperty(rt, "fetchTimeout", bridging::toJs(rt, value.fetchTimeout, jsInvoker));
|
|
222
|
+
result.setProperty(rt, "minimumFetchInterval", bridging::toJs(rt, value.minimumFetchInterval, jsInvoker));
|
|
223
|
+
result.setProperty(rt, "lastFetchTime", bridging::toJs(rt, value.lastFetchTime, jsInvoker));
|
|
224
|
+
result.setProperty(rt, "lastFetchStatus", bridging::toJs(rt, value.lastFetchStatus, jsInvoker));
|
|
225
|
+
result.setProperty(rt, "values", bridging::toJs(rt, value.values, jsInvoker));
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
#pragma mark - NativeRNFBTurboConfigStoredConfigValue
|
|
233
|
+
|
|
234
|
+
template <typename P0, typename P1>
|
|
235
|
+
struct NativeRNFBTurboConfigStoredConfigValue {
|
|
236
|
+
P0 value;
|
|
237
|
+
P1 source;
|
|
238
|
+
bool operator==(const NativeRNFBTurboConfigStoredConfigValue &other) const {
|
|
239
|
+
return value == other.value && source == other.source;
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
template <typename T>
|
|
244
|
+
struct NativeRNFBTurboConfigStoredConfigValueBridging {
|
|
245
|
+
static T types;
|
|
246
|
+
|
|
247
|
+
static T fromJs(
|
|
248
|
+
jsi::Runtime &rt,
|
|
249
|
+
const jsi::Object &value,
|
|
250
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
251
|
+
T result{
|
|
252
|
+
bridging::fromJs<decltype(types.value)>(rt, value.getProperty(rt, "value"), jsInvoker),
|
|
253
|
+
bridging::fromJs<decltype(types.source)>(rt, value.getProperty(rt, "source"), jsInvoker)};
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
#ifdef DEBUG
|
|
258
|
+
static jsi::Object valueToJs(jsi::Runtime &rt, decltype(types.value) value) {
|
|
259
|
+
return bridging::toJs(rt, value);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
static jsi::String sourceToJs(jsi::Runtime &rt, decltype(types.source) value) {
|
|
263
|
+
return bridging::toJs(rt, value);
|
|
264
|
+
}
|
|
265
|
+
#endif
|
|
266
|
+
|
|
267
|
+
static jsi::Object toJs(
|
|
268
|
+
jsi::Runtime &rt,
|
|
269
|
+
const T &value,
|
|
270
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
271
|
+
auto result = facebook::jsi::Object(rt);
|
|
272
|
+
result.setProperty(rt, "value", bridging::toJs(rt, value.value, jsInvoker));
|
|
273
|
+
result.setProperty(rt, "source", bridging::toJs(rt, value.source, jsInvoker));
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
#pragma mark - NativeRNFBTurboConfigVoidRemoteConfigResult
|
|
281
|
+
|
|
282
|
+
template <typename P0>
|
|
283
|
+
struct NativeRNFBTurboConfigVoidRemoteConfigResult {
|
|
284
|
+
P0 constants;
|
|
285
|
+
bool operator==(const NativeRNFBTurboConfigVoidRemoteConfigResult &other) const {
|
|
286
|
+
return constants == other.constants;
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
template <typename T>
|
|
291
|
+
struct NativeRNFBTurboConfigVoidRemoteConfigResultBridging {
|
|
292
|
+
static T types;
|
|
293
|
+
|
|
294
|
+
static T fromJs(
|
|
295
|
+
jsi::Runtime &rt,
|
|
296
|
+
const jsi::Object &value,
|
|
297
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
298
|
+
T result{
|
|
299
|
+
bridging::fromJs<decltype(types.constants)>(rt, value.getProperty(rt, "constants"), jsInvoker)};
|
|
300
|
+
return result;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
#ifdef DEBUG
|
|
304
|
+
static jsi::Object constantsToJs(jsi::Runtime &rt, decltype(types.constants) value) {
|
|
305
|
+
return bridging::toJs(rt, value);
|
|
306
|
+
}
|
|
307
|
+
#endif
|
|
308
|
+
|
|
309
|
+
static jsi::Object toJs(
|
|
310
|
+
jsi::Runtime &rt,
|
|
311
|
+
const T &value,
|
|
312
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
313
|
+
auto result = facebook::jsi::Object(rt);
|
|
314
|
+
result.setProperty(rt, "constants", bridging::toJs(rt, value.constants, jsInvoker));
|
|
315
|
+
return result;
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
|
|
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
|
+
|
|
339
|
+
template <typename T>
|
|
340
|
+
class JSI_EXPORT NativeRNFBTurboConfigCxxSpec : public TurboModule {
|
|
341
|
+
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
|
+
static constexpr std::string_view kModuleName = "NativeRNFBTurboConfig";
|
|
351
|
+
|
|
352
|
+
protected:
|
|
353
|
+
NativeRNFBTurboConfigCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
354
|
+
: TurboModule(std::string{NativeRNFBTurboConfigCxxSpec::kModuleName}, jsInvoker),
|
|
355
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
private:
|
|
359
|
+
class Delegate : public NativeRNFBTurboConfigCxxSpecJSI {
|
|
360
|
+
public:
|
|
361
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
362
|
+
NativeRNFBTurboConfigCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
363
|
+
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
jsi::Object getConstants(jsi::Runtime &rt) override {
|
|
367
|
+
static_assert(
|
|
368
|
+
bridging::getParameterCount(&T::getConstants) == 1,
|
|
369
|
+
"Expected getConstants(...) to have 1 parameters");
|
|
370
|
+
|
|
371
|
+
return bridging::callFromJs<jsi::Object>(
|
|
372
|
+
rt, &T::getConstants, jsInvoker_, instance_);
|
|
373
|
+
}
|
|
374
|
+
jsi::Value activate(jsi::Runtime &rt, jsi::String appName) override {
|
|
375
|
+
static_assert(
|
|
376
|
+
bridging::getParameterCount(&T::activate) == 2,
|
|
377
|
+
"Expected activate(...) to have 2 parameters");
|
|
378
|
+
|
|
379
|
+
return bridging::callFromJs<jsi::Value>(
|
|
380
|
+
rt, &T::activate, jsInvoker_, instance_, std::move(appName));
|
|
381
|
+
}
|
|
382
|
+
jsi::Value setConfigSettings(jsi::Runtime &rt, jsi::String appName, jsi::Object settings) override {
|
|
383
|
+
static_assert(
|
|
384
|
+
bridging::getParameterCount(&T::setConfigSettings) == 3,
|
|
385
|
+
"Expected setConfigSettings(...) to have 3 parameters");
|
|
386
|
+
|
|
387
|
+
return bridging::callFromJs<jsi::Value>(
|
|
388
|
+
rt, &T::setConfigSettings, jsInvoker_, instance_, std::move(appName), std::move(settings));
|
|
389
|
+
}
|
|
390
|
+
jsi::Value fetch(jsi::Runtime &rt, jsi::String appName, double expirationDurationSeconds) override {
|
|
391
|
+
static_assert(
|
|
392
|
+
bridging::getParameterCount(&T::fetch) == 3,
|
|
393
|
+
"Expected fetch(...) to have 3 parameters");
|
|
394
|
+
|
|
395
|
+
return bridging::callFromJs<jsi::Value>(
|
|
396
|
+
rt, &T::fetch, jsInvoker_, instance_, std::move(appName), std::move(expirationDurationSeconds));
|
|
397
|
+
}
|
|
398
|
+
jsi::Value fetchAndActivate(jsi::Runtime &rt, jsi::String appName) override {
|
|
399
|
+
static_assert(
|
|
400
|
+
bridging::getParameterCount(&T::fetchAndActivate) == 2,
|
|
401
|
+
"Expected fetchAndActivate(...) to have 2 parameters");
|
|
402
|
+
|
|
403
|
+
return bridging::callFromJs<jsi::Value>(
|
|
404
|
+
rt, &T::fetchAndActivate, jsInvoker_, instance_, std::move(appName));
|
|
405
|
+
}
|
|
406
|
+
jsi::Value ensureInitialized(jsi::Runtime &rt, jsi::String appName) override {
|
|
407
|
+
static_assert(
|
|
408
|
+
bridging::getParameterCount(&T::ensureInitialized) == 2,
|
|
409
|
+
"Expected ensureInitialized(...) to have 2 parameters");
|
|
410
|
+
|
|
411
|
+
return bridging::callFromJs<jsi::Value>(
|
|
412
|
+
rt, &T::ensureInitialized, jsInvoker_, instance_, std::move(appName));
|
|
413
|
+
}
|
|
414
|
+
jsi::Value setDefaults(jsi::Runtime &rt, jsi::String appName, jsi::Object defaults) override {
|
|
415
|
+
static_assert(
|
|
416
|
+
bridging::getParameterCount(&T::setDefaults) == 3,
|
|
417
|
+
"Expected setDefaults(...) to have 3 parameters");
|
|
418
|
+
|
|
419
|
+
return bridging::callFromJs<jsi::Value>(
|
|
420
|
+
rt, &T::setDefaults, jsInvoker_, instance_, std::move(appName), std::move(defaults));
|
|
421
|
+
}
|
|
422
|
+
jsi::Value setDefaultsFromResource(jsi::Runtime &rt, jsi::String appName, jsi::String resourceName) override {
|
|
423
|
+
static_assert(
|
|
424
|
+
bridging::getParameterCount(&T::setDefaultsFromResource) == 3,
|
|
425
|
+
"Expected setDefaultsFromResource(...) to have 3 parameters");
|
|
426
|
+
|
|
427
|
+
return bridging::callFromJs<jsi::Value>(
|
|
428
|
+
rt, &T::setDefaultsFromResource, jsInvoker_, instance_, std::move(appName), std::move(resourceName));
|
|
429
|
+
}
|
|
430
|
+
jsi::Value reset(jsi::Runtime &rt, jsi::String appName) override {
|
|
431
|
+
static_assert(
|
|
432
|
+
bridging::getParameterCount(&T::reset) == 2,
|
|
433
|
+
"Expected reset(...) to have 2 parameters");
|
|
434
|
+
|
|
435
|
+
return bridging::callFromJs<jsi::Value>(
|
|
436
|
+
rt, &T::reset, jsInvoker_, instance_, std::move(appName));
|
|
437
|
+
}
|
|
438
|
+
void onConfigUpdated(jsi::Runtime &rt, jsi::String appName) override {
|
|
439
|
+
static_assert(
|
|
440
|
+
bridging::getParameterCount(&T::onConfigUpdated) == 2,
|
|
441
|
+
"Expected onConfigUpdated(...) to have 2 parameters");
|
|
442
|
+
|
|
443
|
+
return bridging::callFromJs<void>(
|
|
444
|
+
rt, &T::onConfigUpdated, jsInvoker_, instance_, std::move(appName));
|
|
445
|
+
}
|
|
446
|
+
void removeConfigUpdateRegistration(jsi::Runtime &rt, jsi::String appName) override {
|
|
447
|
+
static_assert(
|
|
448
|
+
bridging::getParameterCount(&T::removeConfigUpdateRegistration) == 2,
|
|
449
|
+
"Expected removeConfigUpdateRegistration(...) to have 2 parameters");
|
|
450
|
+
|
|
451
|
+
return bridging::callFromJs<void>(
|
|
452
|
+
rt, &T::removeConfigUpdateRegistration, jsInvoker_, instance_, std::move(appName));
|
|
453
|
+
}
|
|
454
|
+
jsi::Value setCustomSignals(jsi::Runtime &rt, jsi::String appName, jsi::Object customSignals) override {
|
|
455
|
+
static_assert(
|
|
456
|
+
bridging::getParameterCount(&T::setCustomSignals) == 3,
|
|
457
|
+
"Expected setCustomSignals(...) to have 3 parameters");
|
|
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_;
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
version = "0.78.3"
|
|
7
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
+
if version == '1000.0.0'
|
|
9
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
+
else
|
|
12
|
+
source[:tag] = "v#{version}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|