@react-native-firebase/app-check 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.
Files changed (33) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/RNFBAppCheck.podspec +1 -0
  3. package/android/src/main/java/io/invertase/firebase/appcheck/generated/jni/CMakeLists.txt +1 -9
  4. package/android/src/main/java/io/invertase/firebase/appcheck/generated/jni/react/renderer/components/RNFBAppCheckTurboModules/RNFBAppCheckTurboModulesJSI.h +77 -104
  5. package/dist/module/index.js +13 -6
  6. package/dist/module/index.js.map +1 -1
  7. package/dist/module/version.js +1 -1
  8. package/dist/typescript/lib/index.d.ts +1 -1
  9. package/dist/typescript/lib/index.d.ts.map +1 -1
  10. package/dist/typescript/lib/types/internal.d.ts +4 -2
  11. package/dist/typescript/lib/types/internal.d.ts.map +1 -1
  12. package/dist/typescript/lib/version.d.ts +1 -1
  13. package/ios/RNFBAppCheck/RNFBAppCheckModule.mm +49 -4
  14. package/ios/RNFBAppCheck/RNFBAppCheckProvider.h +3 -0
  15. package/ios/RNFBAppCheck/RNFBAppCheckProvider.m +24 -0
  16. package/ios/RNFBAppCheck/RNFBAppCheckProviderFactory.h +3 -0
  17. package/ios/RNFBAppCheck/RNFBAppCheckProviderFactory.m +12 -6
  18. package/ios/generated/RNFBAppCheckTurboModulesJSI.h +77 -104
  19. package/lib/index.ts +14 -6
  20. package/lib/types/internal.ts +4 -2
  21. package/lib/version.ts +1 -1
  22. package/package.json +6 -6
  23. package/plugin/build/ios/appDelegate.js +3 -2
  24. package/plugin/src/ios/appDelegate.ts +3 -2
  25. package/android/src/main/java/io/invertase/firebase/appcheck/generated/jni/react/renderer/components/RNFBAppCheckTurboModules/RNFBAppCheckTurboModulesJSI-generated.cpp +0 -85
  26. package/ios/generated/RCTAppDependencyProvider.h +0 -25
  27. package/ios/generated/RCTAppDependencyProvider.mm +0 -55
  28. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +0 -18
  29. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +0 -33
  30. package/ios/generated/RCTThirdPartyComponentsProvider.h +0 -16
  31. package/ios/generated/RCTThirdPartyComponentsProvider.mm +0 -23
  32. package/ios/generated/RNFBAppCheckTurboModulesJSI-generated.cpp +0 -85
  33. package/ios/generated/ReactAppDependencyProvider.podspec +0 -34
@@ -15,7 +15,6 @@
15
15
  namespace facebook::react {
16
16
 
17
17
 
18
-
19
18
  #pragma mark - NativeRNFBTurboAppCheckAppCheckTokenResult
20
19
 
21
20
  template <typename P0>
@@ -55,120 +54,94 @@ struct NativeRNFBTurboAppCheckAppCheckTokenResultBridging {
55
54
  }
56
55
  };
57
56
 
58
- class JSI_EXPORT NativeRNFBTurboAppCheckCxxSpecJSI : public TurboModule {
59
- protected:
60
- NativeRNFBTurboAppCheckCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
61
-
62
- public:
63
- virtual jsi::Value activate(jsi::Runtime &rt, jsi::String appName, jsi::String siteKeyProvider, bool isTokenAutoRefreshEnabled) = 0;
64
- virtual jsi::Value configureProvider(jsi::Runtime &rt, jsi::String appName, jsi::String providerName, std::optional<jsi::String> debugToken) = 0;
65
- virtual void setTokenAutoRefreshEnabled(jsi::Runtime &rt, jsi::String appName, bool isTokenAutoRefreshEnabled) = 0;
66
- virtual jsi::Value isTokenAutoRefreshEnabled(jsi::Runtime &rt, jsi::String appName) = 0;
67
- virtual jsi::Value getToken(jsi::Runtime &rt, jsi::String appName, bool forceRefresh) = 0;
68
- virtual jsi::Value getLimitedUseToken(jsi::Runtime &rt, jsi::String appName) = 0;
69
- virtual void addAppCheckListener(jsi::Runtime &rt, jsi::String appName) = 0;
70
- virtual void removeAppCheckListener(jsi::Runtime &rt, jsi::String appName) = 0;
71
-
72
- };
73
57
 
74
58
  template <typename T>
75
59
  class JSI_EXPORT NativeRNFBTurboAppCheckCxxSpec : public TurboModule {
76
60
  public:
77
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
78
- return delegate_.create(rt, propName);
61
+ static constexpr std::string_view kModuleName = "NativeRNFBTurboAppCheck";
62
+
63
+ protected:
64
+ NativeRNFBTurboAppCheckCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeRNFBTurboAppCheckCxxSpec::kModuleName}, jsInvoker) {
65
+ methodMap_["activate"] = MethodMetadata {.argCount = 3, .invoker = __activate};
66
+ methodMap_["configureProvider"] = MethodMetadata {.argCount = 3, .invoker = __configureProvider};
67
+ methodMap_["setTokenAutoRefreshEnabled"] = MethodMetadata {.argCount = 2, .invoker = __setTokenAutoRefreshEnabled};
68
+ methodMap_["isTokenAutoRefreshEnabled"] = MethodMetadata {.argCount = 1, .invoker = __isTokenAutoRefreshEnabled};
69
+ methodMap_["getToken"] = MethodMetadata {.argCount = 2, .invoker = __getToken};
70
+ methodMap_["getLimitedUseToken"] = MethodMetadata {.argCount = 1, .invoker = __getLimitedUseToken};
71
+ methodMap_["addAppCheckListener"] = MethodMetadata {.argCount = 1, .invoker = __addAppCheckListener};
72
+ methodMap_["removeAppCheckListener"] = MethodMetadata {.argCount = 1, .invoker = __removeAppCheckListener};
73
+ }
74
+
75
+ private:
76
+ static jsi::Value __activate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
77
+ static_assert(
78
+ bridging::getParameterCount(&T::activate) == 4,
79
+ "Expected activate(...) to have 4 parameters");
80
+ return bridging::callFromJs<jsi::Value>(rt, &T::activate, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
81
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
82
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
83
+ count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asBool());
79
84
  }
80
85
 
81
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
82
- return delegate_.getPropertyNames(runtime);
86
+ static jsi::Value __configureProvider(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
87
+ static_assert(
88
+ bridging::getParameterCount(&T::configureProvider) == 4,
89
+ "Expected configureProvider(...) to have 4 parameters");
90
+ return bridging::callFromJs<jsi::Value>(rt, &T::configureProvider, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
91
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
92
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
93
+ count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asString(rt)));
83
94
  }
84
95
 
85
- static constexpr std::string_view kModuleName = "NativeRNFBTurboAppCheck";
96
+ static jsi::Value __setTokenAutoRefreshEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
97
+ static_assert(
98
+ bridging::getParameterCount(&T::setTokenAutoRefreshEnabled) == 3,
99
+ "Expected setTokenAutoRefreshEnabled(...) to have 3 parameters");
100
+ bridging::callFromJs<void>(rt, &T::setTokenAutoRefreshEnabled, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
101
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
102
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool());return jsi::Value::undefined();
103
+ }
86
104
 
87
- protected:
88
- NativeRNFBTurboAppCheckCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
89
- : TurboModule(std::string{NativeRNFBTurboAppCheckCxxSpec::kModuleName}, jsInvoker),
90
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
105
+ static jsi::Value __isTokenAutoRefreshEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
106
+ static_assert(
107
+ bridging::getParameterCount(&T::isTokenAutoRefreshEnabled) == 2,
108
+ "Expected isTokenAutoRefreshEnabled(...) to have 2 parameters");
109
+ return bridging::callFromJs<jsi::Value>(rt, &T::isTokenAutoRefreshEnabled, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
110
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
111
+ }
91
112
 
113
+ static jsi::Value __getToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
114
+ static_assert(
115
+ bridging::getParameterCount(&T::getToken) == 3,
116
+ "Expected getToken(...) to have 3 parameters");
117
+ return bridging::callFromJs<jsi::Value>(rt, &T::getToken, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
118
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
119
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool());
120
+ }
92
121
 
93
- private:
94
- class Delegate : public NativeRNFBTurboAppCheckCxxSpecJSI {
95
- public:
96
- Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
97
- NativeRNFBTurboAppCheckCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
98
-
99
- }
100
-
101
- jsi::Value activate(jsi::Runtime &rt, jsi::String appName, jsi::String siteKeyProvider, bool isTokenAutoRefreshEnabled) override {
102
- static_assert(
103
- bridging::getParameterCount(&T::activate) == 4,
104
- "Expected activate(...) to have 4 parameters");
105
-
106
- return bridging::callFromJs<jsi::Value>(
107
- rt, &T::activate, jsInvoker_, instance_, std::move(appName), std::move(siteKeyProvider), std::move(isTokenAutoRefreshEnabled));
108
- }
109
- jsi::Value configureProvider(jsi::Runtime &rt, jsi::String appName, jsi::String providerName, std::optional<jsi::String> debugToken) override {
110
- static_assert(
111
- bridging::getParameterCount(&T::configureProvider) == 4,
112
- "Expected configureProvider(...) to have 4 parameters");
113
-
114
- return bridging::callFromJs<jsi::Value>(
115
- rt, &T::configureProvider, jsInvoker_, instance_, std::move(appName), std::move(providerName), std::move(debugToken));
116
- }
117
- void setTokenAutoRefreshEnabled(jsi::Runtime &rt, jsi::String appName, bool isTokenAutoRefreshEnabled) override {
118
- static_assert(
119
- bridging::getParameterCount(&T::setTokenAutoRefreshEnabled) == 3,
120
- "Expected setTokenAutoRefreshEnabled(...) to have 3 parameters");
121
-
122
- return bridging::callFromJs<void>(
123
- rt, &T::setTokenAutoRefreshEnabled, jsInvoker_, instance_, std::move(appName), std::move(isTokenAutoRefreshEnabled));
124
- }
125
- jsi::Value isTokenAutoRefreshEnabled(jsi::Runtime &rt, jsi::String appName) override {
126
- static_assert(
127
- bridging::getParameterCount(&T::isTokenAutoRefreshEnabled) == 2,
128
- "Expected isTokenAutoRefreshEnabled(...) to have 2 parameters");
129
-
130
- return bridging::callFromJs<jsi::Value>(
131
- rt, &T::isTokenAutoRefreshEnabled, jsInvoker_, instance_, std::move(appName));
132
- }
133
- jsi::Value getToken(jsi::Runtime &rt, jsi::String appName, bool forceRefresh) override {
134
- static_assert(
135
- bridging::getParameterCount(&T::getToken) == 3,
136
- "Expected getToken(...) to have 3 parameters");
137
-
138
- return bridging::callFromJs<jsi::Value>(
139
- rt, &T::getToken, jsInvoker_, instance_, std::move(appName), std::move(forceRefresh));
140
- }
141
- jsi::Value getLimitedUseToken(jsi::Runtime &rt, jsi::String appName) override {
142
- static_assert(
143
- bridging::getParameterCount(&T::getLimitedUseToken) == 2,
144
- "Expected getLimitedUseToken(...) to have 2 parameters");
145
-
146
- return bridging::callFromJs<jsi::Value>(
147
- rt, &T::getLimitedUseToken, jsInvoker_, instance_, std::move(appName));
148
- }
149
- void addAppCheckListener(jsi::Runtime &rt, jsi::String appName) override {
150
- static_assert(
151
- bridging::getParameterCount(&T::addAppCheckListener) == 2,
152
- "Expected addAppCheckListener(...) to have 2 parameters");
153
-
154
- return bridging::callFromJs<void>(
155
- rt, &T::addAppCheckListener, jsInvoker_, instance_, std::move(appName));
156
- }
157
- void removeAppCheckListener(jsi::Runtime &rt, jsi::String appName) override {
158
- static_assert(
159
- bridging::getParameterCount(&T::removeAppCheckListener) == 2,
160
- "Expected removeAppCheckListener(...) to have 2 parameters");
161
-
162
- return bridging::callFromJs<void>(
163
- rt, &T::removeAppCheckListener, jsInvoker_, instance_, std::move(appName));
164
- }
165
-
166
- private:
167
- friend class NativeRNFBTurboAppCheckCxxSpec;
168
- T *instance_;
169
- };
170
-
171
- Delegate delegate_;
122
+ static jsi::Value __getLimitedUseToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
123
+ static_assert(
124
+ bridging::getParameterCount(&T::getLimitedUseToken) == 2,
125
+ "Expected getLimitedUseToken(...) to have 2 parameters");
126
+ return bridging::callFromJs<jsi::Value>(rt, &T::getLimitedUseToken, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
127
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
128
+ }
129
+
130
+ static jsi::Value __addAppCheckListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
131
+ static_assert(
132
+ bridging::getParameterCount(&T::addAppCheckListener) == 2,
133
+ "Expected addAppCheckListener(...) to have 2 parameters");
134
+ bridging::callFromJs<void>(rt, &T::addAppCheckListener, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
135
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));return jsi::Value::undefined();
136
+ }
137
+
138
+ static jsi::Value __removeAppCheckListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
139
+ static_assert(
140
+ bridging::getParameterCount(&T::removeAppCheckListener) == 2,
141
+ "Expected removeAppCheckListener(...) to have 2 parameters");
142
+ bridging::callFromJs<void>(rt, &T::removeAppCheckListener, static_cast<NativeRNFBTurboAppCheckCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
143
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));return jsi::Value::undefined();
144
+ }
172
145
  };
173
146
 
174
147
  } // namespace facebook::react
package/lib/index.ts CHANGED
@@ -152,35 +152,43 @@ class FirebaseAppCheckModule extends FirebaseModule<typeof nativeModuleName> {
152
152
  if (!isBoolean(options.isTokenAutoRefreshEnabled)) {
153
153
  options.isTokenAutoRefreshEnabled = true;
154
154
  }
155
- this.native.setTokenAutoRefreshEnabled(options.isTokenAutoRefreshEnabled);
155
+ const isTokenAutoRefreshEnabled = options.isTokenAutoRefreshEnabled as boolean;
156
156
 
157
157
  if (!hasProviderOptions(options.provider)) {
158
158
  throw new Error('Invalid configuration: no provider or no provider options defined.');
159
159
  }
160
160
  const provider = options.provider;
161
+
162
+ // AppCheck-AD-4: attach the real provider before enabling auto-refresh so early
163
+ // refresh does not run while the native facade is still pending.
164
+ let configurePromise: Promise<void>;
161
165
  if (Platform.OS === 'android') {
162
166
  if (!isString(provider.providerOptions?.android?.provider)) {
163
167
  throw new Error(
164
168
  'Invalid configuration: no android provider configured while on android platform.',
165
169
  );
166
170
  }
167
- return this.native.configureProvider(
171
+ configurePromise = this.native.configureProvider(
168
172
  provider.providerOptions.android.provider,
169
173
  provider.providerOptions.android.debugToken,
170
174
  );
171
- }
172
- if (Platform.OS === 'ios' || Platform.OS === 'macos') {
175
+ } else if (Platform.OS === 'ios' || Platform.OS === 'macos') {
173
176
  if (!isString(provider.providerOptions?.apple?.provider)) {
174
177
  throw new Error(
175
178
  'Invalid configuration: no apple provider configured while on apple platform.',
176
179
  );
177
180
  }
178
- return this.native.configureProvider(
181
+ configurePromise = this.native.configureProvider(
179
182
  provider.providerOptions.apple.provider,
180
183
  provider.providerOptions.apple.debugToken,
181
184
  );
185
+ } else {
186
+ throw new Error('Unsupported platform: ' + Platform.OS);
182
187
  }
183
- throw new Error('Unsupported platform: ' + Platform.OS);
188
+
189
+ return Promise.resolve(configurePromise).then(() => {
190
+ this.native.setTokenAutoRefreshEnabled(isTokenAutoRefreshEnabled);
191
+ });
184
192
  }
185
193
 
186
194
  activate(
@@ -33,8 +33,10 @@ export type AppCheckInternal = AppCheck & {
33
33
 
34
34
  /**
35
35
  * Activate App Check
36
- * On iOS App Check is activated with DeviceCheck provider simply by including the module, using the token auto refresh default or
37
- * the specific value (if configured) in firebase.json, but calling this does no harm.
36
+ * On iOS calling this activates App Check with the DeviceCheck provider, using the token auto refresh default or
37
+ * the specific value (if configured) in firebase.json. Before `activate` or `initializeAppCheck` is called, the
38
+ * native App Check provider is pending and `getToken` / `getLimitedUseToken` fail closed with
39
+ * `appCheck/provider-not-ready`.
38
40
  * On Android if you call this it will install the PlayIntegrity provider in release builds, the Debug provider if debuggable.
39
41
  * On both platforms you may use this method to alter the token refresh setting after startup.
40
42
  * On iOS if you want to set a specific AppCheckProviderFactory (for instance to FIRAppCheckDebugProviderFactory or
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '26.1.0';
2
+ export const version = '26.3.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/app-check",
3
- "version": "26.1.0",
3
+ "version": "26.3.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - App Check",
6
6
  "main": "./dist/module/index.js",
@@ -27,8 +27,8 @@
27
27
  "compile": "bob build",
28
28
  "prepare": "yarn run build && yarn compile && yarn run build:plugin",
29
29
  "codegen": "yarn android:codegen && yarn ios:codegen",
30
- "android:codegen": "npx @react-native-community/cli codegen --platform android --outputPath=./android/src/main/java/io/invertase/firebase/appcheck/generated",
31
- "ios:codegen": "npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated"
30
+ "android:codegen": "node ../../scripts/codegen-package.mjs app-check android",
31
+ "ios:codegen": "node ../../scripts/codegen-package.mjs app-check ios"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
@@ -43,11 +43,11 @@
43
43
  "appCheck"
44
44
  ],
45
45
  "peerDependencies": {
46
- "@react-native-firebase/app": "26.1.0",
46
+ "@react-native-firebase/app": "26.3.0",
47
47
  "expo": ">=47.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@react-native-firebase/app": "26.1.0",
50
+ "@react-native-firebase/app": "26.3.0",
51
51
  "expo": "^55.0.18",
52
52
  "react-native-builder-bob": "^0.41.0",
53
53
  "typescript": "^6.0.3"
@@ -99,5 +99,5 @@
99
99
  "node_modules/",
100
100
  "dist/"
101
101
  ],
102
- "gitHead": "59d053eca14ab8aa80e5ac76887014925c67e52b"
102
+ "gitHead": "12a52d40c0d156d05a16f4b49eb0e507c0f5d8c5"
103
103
  }
@@ -121,8 +121,9 @@ function modifySwiftAppDelegate(contents) {
121
121
  FirebaseApp.configure()
122
122
  `);
123
123
  }
124
- // If Firebase initialization block not found, add both Firebase and App Check initialization
125
- // This is to make sure Firebase is initialized before App Check
124
+ // If Firebase initialization block not found, register the App Check provider factory
125
+ // then call FirebaseApp.configure(). Firebase requires the factory before configure
126
+ // (AppCheck-AD-3); do not reverse this order.
126
127
  const methodInvocationBlock = `RNFBAppCheckModule.sharedInstance()
127
128
  FirebaseApp.configure()`;
128
129
  const methodInvocationLineMatcher = /(?:factory\.startReactNative\()/;
@@ -141,8 +141,9 @@ export function modifySwiftAppDelegate(contents: string): string {
141
141
  );
142
142
  }
143
143
 
144
- // If Firebase initialization block not found, add both Firebase and App Check initialization
145
- // This is to make sure Firebase is initialized before App Check
144
+ // If Firebase initialization block not found, register the App Check provider factory
145
+ // then call FirebaseApp.configure(). Firebase requires the factory before configure
146
+ // (AppCheck-AD-3); do not reverse this order.
146
147
  const methodInvocationBlock = `RNFBAppCheckModule.sharedInstance()
147
148
  FirebaseApp.configure()`;
148
149
 
@@ -1,85 +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 "RNFBAppCheckTurboModulesJSI.h"
11
-
12
- namespace facebook::react {
13
-
14
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_activate(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
- return static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->activate(
16
- rt,
17
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
18
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
19
- count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asBool()
20
- );
21
- }
22
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_configureProvider(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
23
- return static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->configureProvider(
24
- rt,
25
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
26
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
27
- count <= 2 || args[2].isNull() || args[2].isUndefined() ? std::nullopt : std::make_optional(args[2].asString(rt))
28
- );
29
- }
30
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_setTokenAutoRefreshEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
31
- static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->setTokenAutoRefreshEnabled(
32
- rt,
33
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
34
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
35
- );
36
- return jsi::Value::undefined();
37
- }
38
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_isTokenAutoRefreshEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
39
- return static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->isTokenAutoRefreshEnabled(
40
- rt,
41
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
42
- );
43
- }
44
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_getToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
45
- return static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->getToken(
46
- rt,
47
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
48
- count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool()
49
- );
50
- }
51
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_getLimitedUseToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
52
- return static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->getLimitedUseToken(
53
- rt,
54
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
55
- );
56
- }
57
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_addAppCheckListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
58
- static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->addAppCheckListener(
59
- rt,
60
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
61
- );
62
- return jsi::Value::undefined();
63
- }
64
- static jsi::Value __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_removeAppCheckListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
65
- static_cast<NativeRNFBTurboAppCheckCxxSpecJSI *>(&turboModule)->removeAppCheckListener(
66
- rt,
67
- count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
68
- );
69
- return jsi::Value::undefined();
70
- }
71
-
72
- NativeRNFBTurboAppCheckCxxSpecJSI::NativeRNFBTurboAppCheckCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
73
- : TurboModule("NativeRNFBTurboAppCheck", jsInvoker) {
74
- methodMap_["activate"] = MethodMetadata {3, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_activate};
75
- methodMap_["configureProvider"] = MethodMetadata {3, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_configureProvider};
76
- methodMap_["setTokenAutoRefreshEnabled"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_setTokenAutoRefreshEnabled};
77
- methodMap_["isTokenAutoRefreshEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_isTokenAutoRefreshEnabled};
78
- methodMap_["getToken"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_getToken};
79
- methodMap_["getLimitedUseToken"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_getLimitedUseToken};
80
- methodMap_["addAppCheckListener"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_addAppCheckListener};
81
- methodMap_["removeAppCheckListener"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboAppCheckCxxSpecJSI_removeAppCheckListener};
82
- }
83
-
84
-
85
- } // namespace facebook::react
@@ -1,25 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
-
9
- #import <Foundation/Foundation.h>
10
-
11
- #if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
12
- #import <React-RCTAppDelegate/RCTDependencyProvider.h>
13
- #elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
14
- #import <React_RCTAppDelegate/RCTDependencyProvider.h>
15
- #else
16
- #import "RCTDependencyProvider.h"
17
- #endif
18
-
19
- NS_ASSUME_NONNULL_BEGIN
20
-
21
- @interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
22
-
23
- @end
24
-
25
- NS_ASSUME_NONNULL_END
@@ -1,55 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import "RCTAppDependencyProvider.h"
9
- #import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
10
- #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
11
-
12
- @implementation RCTAppDependencyProvider {
13
- NSArray<NSString *> * _URLRequestHandlerClassNames;
14
- NSArray<NSString *> * _imageDataDecoderClassNames;
15
- NSArray<NSString *> * _imageURLLoaderClassNames;
16
- NSDictionary<NSString *,Class<RCTComponentViewProtocol>> * _thirdPartyFabricComponents;
17
- }
18
-
19
- - (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
20
- static dispatch_once_t requestUrlToken;
21
- dispatch_once(&requestUrlToken, ^{
22
- self->_URLRequestHandlerClassNames = RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
23
- });
24
-
25
- return _URLRequestHandlerClassNames;
26
- }
27
-
28
- - (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
29
- static dispatch_once_t dataDecoderToken;
30
- dispatch_once(&dataDecoderToken, ^{
31
- _imageDataDecoderClassNames = RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
32
- });
33
-
34
- return _imageDataDecoderClassNames;
35
- }
36
-
37
- - (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
38
- static dispatch_once_t urlLoaderToken;
39
- dispatch_once(&urlLoaderToken, ^{
40
- _imageURLLoaderClassNames = RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
41
- });
42
-
43
- return _imageURLLoaderClassNames;
44
- }
45
-
46
- - (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
47
- static dispatch_once_t nativeComponentsToken;
48
- dispatch_once(&nativeComponentsToken, ^{
49
- _thirdPartyFabricComponents = RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
50
- });
51
-
52
- return _thirdPartyFabricComponents;
53
- }
54
-
55
- @end
@@ -1,18 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import <Foundation/Foundation.h>
9
-
10
- @interface RCTModulesConformingToProtocolsProvider: NSObject
11
-
12
- +(NSArray<NSString *> *)imageURLLoaderClassNames;
13
-
14
- +(NSArray<NSString *> *)imageDataDecoderClassNames;
15
-
16
- +(NSArray<NSString *> *)URLRequestHandlerClassNames;
17
-
18
- @end
@@ -1,33 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import "RCTModulesConformingToProtocolsProvider.h"
9
-
10
- @implementation RCTModulesConformingToProtocolsProvider
11
-
12
- +(NSArray<NSString *> *)imageURLLoaderClassNames
13
- {
14
- return @[
15
-
16
- ];
17
- }
18
-
19
- +(NSArray<NSString *> *)imageDataDecoderClassNames
20
- {
21
- return @[
22
-
23
- ];
24
- }
25
-
26
- +(NSArray<NSString *> *)URLRequestHandlerClassNames
27
- {
28
- return @[
29
-
30
- ];
31
- }
32
-
33
- @end
@@ -1,16 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
- #import <Foundation/Foundation.h>
9
-
10
- @protocol RCTComponentViewProtocol;
11
-
12
- @interface RCTThirdPartyComponentsProvider: NSObject
13
-
14
- + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
15
-
16
- @end
@@ -1,23 +0,0 @@
1
- /*
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
-
8
-
9
- #import <Foundation/Foundation.h>
10
-
11
- #import "RCTThirdPartyComponentsProvider.h"
12
- #import <React/RCTComponentViewProtocol.h>
13
-
14
- @implementation RCTThirdPartyComponentsProvider
15
-
16
- + (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
17
- {
18
- return @{
19
-
20
- };
21
- }
22
-
23
- @end