@react-native-firebase/in-app-messaging 25.1.0 → 26.0.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 (61) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/RNFBInAppMessaging.podspec +7 -6
  3. package/android/build.gradle +19 -0
  4. package/android/src/reactnative/java/io/invertase/firebase/fiam/{ReactNativeFirebaseFiamModule.java → NativeRNFBTurboFiam.java} +17 -18
  5. package/android/src/reactnative/java/io/invertase/firebase/fiam/ReactNativeFirebaseFiamPackage.java +1 -1
  6. package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboFiamSpec.java +79 -0
  7. package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/CMakeLists.txt +36 -0
  8. package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/RNFBInAppMessagingTurboModules-generated.cpp +50 -0
  9. package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/RNFBInAppMessagingTurboModules.h +31 -0
  10. package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/react/renderer/components/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModulesJSI-generated.cpp +47 -0
  11. package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/react/renderer/components/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModulesJSI.h +98 -0
  12. package/dist/module/index.js +113 -3
  13. package/dist/module/index.js.map +1 -1
  14. package/dist/module/version.js +1 -1
  15. package/dist/module/web/RNFBFiamModule.js +34 -0
  16. package/dist/module/web/RNFBFiamModule.js.map +1 -0
  17. package/dist/typescript/lib/index.d.ts +46 -4
  18. package/dist/typescript/lib/index.d.ts.map +1 -1
  19. package/dist/typescript/lib/types/internal.d.ts +1 -8
  20. package/dist/typescript/lib/types/internal.d.ts.map +1 -1
  21. package/dist/typescript/lib/version.d.ts +1 -1
  22. package/dist/typescript/lib/web/RNFBFiamModule.d.ts +4 -0
  23. package/dist/typescript/lib/web/RNFBFiamModule.d.ts.map +1 -0
  24. package/ios/RNFBFiam/RNFBFiamModule.h +2 -3
  25. package/ios/RNFBFiam/{RNFBFiamModule.m → RNFBFiamModule.mm} +25 -21
  26. package/ios/RNFBFiam.xcodeproj/project.pbxproj +8 -8
  27. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  28. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  29. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  30. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  31. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  32. package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  33. package/ios/generated/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModules-generated.mm +60 -0
  34. package/ios/generated/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModules.h +112 -0
  35. package/ios/generated/RNFBInAppMessagingTurboModulesJSI-generated.cpp +47 -0
  36. package/ios/generated/RNFBInAppMessagingTurboModulesJSI.h +98 -0
  37. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  38. package/lib/index.ts +141 -5
  39. package/lib/types/internal.ts +1 -16
  40. package/lib/version.ts +1 -1
  41. package/lib/web/RNFBFiamModule.ts +34 -0
  42. package/package.json +23 -5
  43. package/react-native.config.js +10 -0
  44. package/specs/NativeRNFBTurboFiam.ts +15 -0
  45. package/tsconfig.json +4 -0
  46. package/typedoc.json +1 -1
  47. package/dist/module/modular.js +0 -80
  48. package/dist/module/modular.js.map +0 -1
  49. package/dist/module/namespaced.js +0 -78
  50. package/dist/module/namespaced.js.map +0 -1
  51. package/dist/module/types/namespaced.js +0 -62
  52. package/dist/module/types/namespaced.js.map +0 -1
  53. package/dist/typescript/lib/modular.d.ts +0 -36
  54. package/dist/typescript/lib/modular.d.ts.map +0 -1
  55. package/dist/typescript/lib/namespaced.d.ts +0 -12
  56. package/dist/typescript/lib/namespaced.d.ts.map +0 -1
  57. package/dist/typescript/lib/types/namespaced.d.ts +0 -107
  58. package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
  59. package/lib/modular.ts +0 -103
  60. package/lib/namespaced.ts +0 -117
  61. package/lib/types/namespaced.ts +0 -137
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [26.0.0](https://github.com/invertase/react-native-firebase/compare/v25.1.0...v26.0.0) (2026-07-29)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - **in-app-messaging:** migrate in-app-messaging to TurboModules
11
+
12
+ ### Features
13
+
14
+ - **in-app-messaging:** migrate in-app-messaging to TurboModules ([05d0497](https://github.com/invertase/react-native-firebase/commit/05d0497d25c14ecebb935000f04712b11eeed5a7))
15
+
16
+ ### Bug Fixes
17
+
18
+ - add codegen verify and spec-native parity tests ([49d9f1b](https://github.com/invertase/react-native-firebase/commit/49d9f1baba4fc83c1dd4983f582bbd7352d78809))
19
+ - add ResultT codegen type alias ([ff2d68f](https://github.com/invertase/react-native-firebase/commit/ff2d68ff8f73092f8ba3c75e007049dd31be822f))
20
+ - **ios:** set IPHONEOS_DEPLOYMENT_TARGET to 15.0, update platform support docs/conditionals ([#9108](https://github.com/invertase/react-native-firebase/issues/9108)) ([99d0899](https://github.com/invertase/react-native-firebase/commit/99d089908e3eec6155d73ecf05ff7274ad33c46e)), closes [#8882](https://github.com/invertase/react-native-firebase/issues/8882)
21
+
6
22
  ## [25.1.0](https://github.com/invertase/react-native-firebase/compare/v25.0.1...v25.1.0) (2026-06-25)
7
23
 
8
24
  **Note:** Version bump only for package @react-native-firebase/in-app-messaging
@@ -28,15 +28,16 @@ Pod::Spec.new do |s|
28
28
  s.ios.deployment_target = firebase_ios_target
29
29
  s.macos.deployment_target = firebase_macos_target
30
30
  s.tvos.deployment_target = firebase_tvos_target
31
- s.source_files = 'ios/**/*.{h,m}'
31
+ s.source_files = 'ios/**/*.{h,m,mm,cpp,swift}'
32
+ s.private_header_files = "ios/**/*.h"
33
+ s.exclude_files = 'ios/generated/RCTThirdPartyComponentsProvider.*', 'ios/generated/RCTAppDependencyProvider.*', 'ios/generated/RCTModuleProviders.*', 'ios/generated/RCTModulesConformingToProtocolsProvider.*', 'ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.*'
32
34
 
33
35
  s.dependency 'RNFBApp'
34
36
 
35
- # React Native dependencies
36
- if defined?(install_modules_dependencies()) != nil
37
- install_modules_dependencies(s);
38
- else
39
- s.dependency "React-Core"
37
+ install_modules_dependencies(s);
38
+
39
+ if defined?(ENV["RCT_NEW_ARCH_ENABLED"]) != nil && (ENV["RCT_NEW_ARCH_ENABLED"] == '0')
40
+ raise "#{s.name} requires New Architecture. Enable New Architecture to use this module"
40
41
  end
41
42
 
42
43
  if defined?($FirebaseSDKVersion)
@@ -112,6 +112,7 @@ android {
112
112
  sourceSets {
113
113
  main {
114
114
  java.srcDirs = ['src/main/java', 'src/reactnative/java']
115
+ java.excludes = ['**/generated/jni/**']
115
116
  }
116
117
  }
117
118
  }
@@ -131,3 +132,21 @@ ReactNative.shared.applyPackageVersion()
131
132
  ReactNative.shared.applyDefaultExcludes()
132
133
  ReactNative.module.applyAndroidVersions()
133
134
  ReactNative.module.applyReactNativeDependency("api")
135
+
136
+ def isNewArchitectureDisabled() {
137
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled != "true"
138
+ }
139
+
140
+ if (isNewArchitectureDisabled()) {
141
+ def ANSI_RED = "\u001B[31m";
142
+ def ANSI_RESET = "\u001B[0m";
143
+
144
+ println("\n\n\n")
145
+ println(ANSI_RED + "**************************************************************************************************************")
146
+ println("\n\n\n")
147
+ println("New Architecture support is required for @react-native-firebase/in-app-messaging")
148
+ println("\n\n\n")
149
+ println("**************************************************************************************************************" + ANSI_RESET)
150
+ println("\n\n\n")
151
+ System.exit(1)
152
+ }
@@ -17,23 +17,27 @@ package io.invertase.firebase.fiam;
17
17
  *
18
18
  */
19
19
 
20
+ import com.facebook.fbreact.specs.NativeRNFBTurboFiamSpec;
20
21
  import com.facebook.react.bridge.Promise;
21
22
  import com.facebook.react.bridge.ReactApplicationContext;
22
- import com.facebook.react.bridge.ReactMethod;
23
- import io.invertase.firebase.common.ReactNativeFirebaseModule;
24
23
  import java.util.Map;
25
24
 
26
- public class ReactNativeFirebaseFiamModule extends ReactNativeFirebaseModule {
25
+ public class NativeRNFBTurboFiam extends NativeRNFBTurboFiamSpec {
27
26
  private static final String SERVICE_NAME = "Fiam";
28
27
  private final UniversalFirebaseFiamModule module;
29
28
 
30
- ReactNativeFirebaseFiamModule(ReactApplicationContext reactContext) {
31
- super(reactContext, SERVICE_NAME);
29
+ public NativeRNFBTurboFiam(ReactApplicationContext reactContext) {
30
+ super(reactContext);
32
31
  module = new UniversalFirebaseFiamModule(reactContext, SERVICE_NAME);
33
32
  }
34
33
 
35
- @ReactMethod
36
- public void setAutomaticDataCollectionEnabled(Boolean enabled, Promise promise) {
34
+ @Override
35
+ protected Map<String, Object> getTypedExportedConstants() {
36
+ return module.getConstants();
37
+ }
38
+
39
+ @Override
40
+ public void setAutomaticDataCollectionEnabled(boolean enabled, Promise promise) {
37
41
  module
38
42
  .setAutomaticDataCollectionEnabled(enabled)
39
43
  .addOnCompleteListener(
@@ -41,13 +45,13 @@ public class ReactNativeFirebaseFiamModule extends ReactNativeFirebaseModule {
41
45
  if (task.isSuccessful()) {
42
46
  promise.resolve(task.getResult());
43
47
  } else {
44
- rejectPromiseWithExceptionMap(promise, task.getException());
48
+ promise.reject(task.getException());
45
49
  }
46
50
  });
47
51
  }
48
52
 
49
- @ReactMethod
50
- public void setMessagesDisplaySuppressed(Boolean enabled, Promise promise) {
53
+ @Override
54
+ public void setMessagesDisplaySuppressed(boolean enabled, Promise promise) {
51
55
  module
52
56
  .setMessagesDisplaySuppressed(enabled)
53
57
  .addOnCompleteListener(
@@ -55,12 +59,12 @@ public class ReactNativeFirebaseFiamModule extends ReactNativeFirebaseModule {
55
59
  if (task.isSuccessful()) {
56
60
  promise.resolve(task.getResult());
57
61
  } else {
58
- rejectPromiseWithExceptionMap(promise, task.getException());
62
+ promise.reject(task.getException());
59
63
  }
60
64
  });
61
65
  }
62
66
 
63
- @ReactMethod
67
+ @Override
64
68
  public void triggerEvent(String eventId, Promise promise) {
65
69
  module
66
70
  .triggerEvent(eventId)
@@ -69,13 +73,8 @@ public class ReactNativeFirebaseFiamModule extends ReactNativeFirebaseModule {
69
73
  if (task.isSuccessful()) {
70
74
  promise.resolve(task.getResult());
71
75
  } else {
72
- rejectPromiseWithExceptionMap(promise, task.getException());
76
+ promise.reject(task.getException());
73
77
  }
74
78
  });
75
79
  }
76
-
77
- @Override
78
- public Map<String, Object> getConstants() {
79
- return module.getConstants();
80
- }
81
80
  }
@@ -32,7 +32,7 @@ public class ReactNativeFirebaseFiamPackage implements ReactPackage {
32
32
  @Override
33
33
  public List<NativeModule> createNativeModules(@Nonnull ReactApplicationContext reactContext) {
34
34
  List<NativeModule> modules = new ArrayList<>();
35
- modules.add(new ReactNativeFirebaseFiamModule(reactContext));
35
+ modules.add(new NativeRNFBTurboFiam(reactContext));
36
36
  return modules;
37
37
  }
38
38
 
@@ -0,0 +1,79 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJavaSpec.js
9
+ *
10
+ * @nolint
11
+ */
12
+
13
+ package com.facebook.fbreact.specs;
14
+
15
+ import com.facebook.proguard.annotations.DoNotStrip;
16
+ import com.facebook.react.bridge.Promise;
17
+ import com.facebook.react.bridge.ReactApplicationContext;
18
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
19
+ import com.facebook.react.bridge.ReactMethod;
20
+ import com.facebook.react.common.build.ReactBuildConfig;
21
+ import com.facebook.react.turbomodule.core.interfaces.TurboModule;
22
+ import java.util.Arrays;
23
+ import java.util.HashSet;
24
+ import java.util.Map;
25
+ import java.util.Set;
26
+ import javax.annotation.Nonnull;
27
+ import javax.annotation.Nullable;
28
+
29
+ public abstract class NativeRNFBTurboFiamSpec extends ReactContextBaseJavaModule implements TurboModule {
30
+ public static final String NAME = "NativeRNFBTurboFiam";
31
+
32
+ public NativeRNFBTurboFiamSpec(ReactApplicationContext reactContext) {
33
+ super(reactContext);
34
+ }
35
+
36
+ @Override
37
+ public @Nonnull String getName() {
38
+ return NAME;
39
+ }
40
+
41
+ protected abstract Map<String, Object> getTypedExportedConstants();
42
+
43
+ @Override
44
+ @DoNotStrip
45
+ public final @Nullable Map<String, Object> getConstants() {
46
+ Map<String, Object> constants = getTypedExportedConstants();
47
+ if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
48
+ Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
49
+ "isAutomaticDataCollectionEnabled",
50
+ "isMessagesDisplaySuppressed"
51
+ ));
52
+ Set<String> optionalFlowConstants = new HashSet<>();
53
+ Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
54
+ undeclaredConstants.removeAll(obligatoryFlowConstants);
55
+ undeclaredConstants.removeAll(optionalFlowConstants);
56
+ if (!undeclaredConstants.isEmpty()) {
57
+ throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
58
+ }
59
+ undeclaredConstants = obligatoryFlowConstants;
60
+ undeclaredConstants.removeAll(constants.keySet());
61
+ if (!undeclaredConstants.isEmpty()) {
62
+ throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
63
+ }
64
+ }
65
+ return constants;
66
+ }
67
+
68
+ @ReactMethod
69
+ @DoNotStrip
70
+ public abstract void setAutomaticDataCollectionEnabled(boolean enabled, Promise promise);
71
+
72
+ @ReactMethod
73
+ @DoNotStrip
74
+ public abstract void setMessagesDisplaySuppressed(boolean enabled, Promise promise);
75
+
76
+ @ReactMethod
77
+ @DoNotStrip
78
+ public abstract void triggerEvent(String eventId, Promise promise);
79
+ }
@@ -0,0 +1,36 @@
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
+ cmake_minimum_required(VERSION 3.13)
7
+ set(CMAKE_VERBOSE_MAKEFILE on)
8
+
9
+ file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/RNFBInAppMessagingTurboModules/*.cpp)
10
+
11
+ add_library(
12
+ react_codegen_RNFBInAppMessagingTurboModules
13
+ OBJECT
14
+ ${react_codegen_SRCS}
15
+ )
16
+
17
+ target_include_directories(react_codegen_RNFBInAppMessagingTurboModules PUBLIC . react/renderer/components/RNFBInAppMessagingTurboModules)
18
+
19
+ target_link_libraries(
20
+ react_codegen_RNFBInAppMessagingTurboModules
21
+ fbjni
22
+ jsi
23
+ # We need to link different libraries based on whether we are building rncore or not, that's necessary
24
+ # because we want to break a circular dependency between react_codegen_rncore and reactnative
25
+ reactnative
26
+ )
27
+
28
+ target_compile_options(
29
+ react_codegen_RNFBInAppMessagingTurboModules
30
+ PRIVATE
31
+ -DLOG_TAG=\"ReactNative\"
32
+ -fexceptions
33
+ -frtti
34
+ -std=c++20
35
+ -Wall
36
+ )
@@ -0,0 +1,50 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJniCpp.js
9
+ */
10
+
11
+ #include "RNFBInAppMessagingTurboModules.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboFiamSpecJSI_getConstants(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
16
+ static jmethodID cachedMethodId = nullptr;
17
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, ObjectKind, "getConstants", "()Ljava/util/Map;", args, count, cachedMethodId);
18
+ }
19
+
20
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboFiamSpecJSI_setAutomaticDataCollectionEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
21
+ static jmethodID cachedMethodId = nullptr;
22
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setAutomaticDataCollectionEnabled", "(ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
+ }
24
+
25
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboFiamSpecJSI_setMessagesDisplaySuppressed(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
26
+ static jmethodID cachedMethodId = nullptr;
27
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setMessagesDisplaySuppressed", "(ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
28
+ }
29
+
30
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboFiamSpecJSI_triggerEvent(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
+ static jmethodID cachedMethodId = nullptr;
32
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "triggerEvent", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
33
+ }
34
+
35
+ NativeRNFBTurboFiamSpecJSI::NativeRNFBTurboFiamSpecJSI(const JavaTurboModule::InitParams &params)
36
+ : JavaTurboModule(params) {
37
+ methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboFiamSpecJSI_getConstants};
38
+ methodMap_["setAutomaticDataCollectionEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboFiamSpecJSI_setAutomaticDataCollectionEnabled};
39
+ methodMap_["setMessagesDisplaySuppressed"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboFiamSpecJSI_setMessagesDisplaySuppressed};
40
+ methodMap_["triggerEvent"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboFiamSpecJSI_triggerEvent};
41
+ }
42
+
43
+ std::shared_ptr<TurboModule> RNFBInAppMessagingTurboModules_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
44
+ if (moduleName == "NativeRNFBTurboFiam") {
45
+ return std::make_shared<NativeRNFBTurboFiamSpecJSI>(params);
46
+ }
47
+ return nullptr;
48
+ }
49
+
50
+ } // namespace facebook::react
@@ -0,0 +1,31 @@
1
+
2
+ /**
3
+ * This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4
+ *
5
+ * Do not edit this file as changes may cause incorrect behavior and will be lost
6
+ * once the code is regenerated.
7
+ *
8
+ * @generated by codegen project: GenerateModuleJniH.js
9
+ */
10
+
11
+ #pragma once
12
+
13
+ #include <ReactCommon/JavaTurboModule.h>
14
+ #include <ReactCommon/TurboModule.h>
15
+ #include <jsi/jsi.h>
16
+
17
+ namespace facebook::react {
18
+
19
+ /**
20
+ * JNI C++ class for module 'NativeRNFBTurboFiam'
21
+ */
22
+ class JSI_EXPORT NativeRNFBTurboFiamSpecJSI : public JavaTurboModule {
23
+ public:
24
+ NativeRNFBTurboFiamSpecJSI(const JavaTurboModule::InitParams &params);
25
+ };
26
+
27
+
28
+ JSI_EXPORT
29
+ std::shared_ptr<TurboModule> RNFBInAppMessagingTurboModules_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
+
31
+ } // namespace facebook::react
@@ -0,0 +1,47 @@
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 "RNFBInAppMessagingTurboModulesJSI.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ static jsi::Value __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
+ return static_cast<NativeRNFBTurboFiamCxxSpecJSI *>(&turboModule)->getConstants(
16
+ rt
17
+ );
18
+ }
19
+ static jsi::Value __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_setAutomaticDataCollectionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
20
+ return static_cast<NativeRNFBTurboFiamCxxSpecJSI *>(&turboModule)->setAutomaticDataCollectionEnabled(
21
+ rt,
22
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
23
+ );
24
+ }
25
+ static jsi::Value __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_setMessagesDisplaySuppressed(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
26
+ return static_cast<NativeRNFBTurboFiamCxxSpecJSI *>(&turboModule)->setMessagesDisplaySuppressed(
27
+ rt,
28
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
29
+ );
30
+ }
31
+ static jsi::Value __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_triggerEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
32
+ return static_cast<NativeRNFBTurboFiamCxxSpecJSI *>(&turboModule)->triggerEvent(
33
+ rt,
34
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
35
+ );
36
+ }
37
+
38
+ NativeRNFBTurboFiamCxxSpecJSI::NativeRNFBTurboFiamCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
39
+ : TurboModule("NativeRNFBTurboFiam", jsInvoker) {
40
+ methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_getConstants};
41
+ methodMap_["setAutomaticDataCollectionEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_setAutomaticDataCollectionEnabled};
42
+ methodMap_["setMessagesDisplaySuppressed"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_setMessagesDisplaySuppressed};
43
+ methodMap_["triggerEvent"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboFiamCxxSpecJSI_triggerEvent};
44
+ }
45
+
46
+
47
+ } // namespace facebook::react
@@ -0,0 +1,98 @@
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
+ class JSI_EXPORT NativeRNFBTurboFiamCxxSpecJSI : public TurboModule {
19
+ protected:
20
+ NativeRNFBTurboFiamCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
21
+
22
+ public:
23
+ virtual jsi::Object getConstants(jsi::Runtime &rt) = 0;
24
+ virtual jsi::Value setAutomaticDataCollectionEnabled(jsi::Runtime &rt, bool enabled) = 0;
25
+ virtual jsi::Value setMessagesDisplaySuppressed(jsi::Runtime &rt, bool enabled) = 0;
26
+ virtual jsi::Value triggerEvent(jsi::Runtime &rt, jsi::String eventId) = 0;
27
+
28
+ };
29
+
30
+ template <typename T>
31
+ class JSI_EXPORT NativeRNFBTurboFiamCxxSpec : public TurboModule {
32
+ public:
33
+ jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
34
+ return delegate_.create(rt, propName);
35
+ }
36
+
37
+ std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
38
+ return delegate_.getPropertyNames(runtime);
39
+ }
40
+
41
+ static constexpr std::string_view kModuleName = "NativeRNFBTurboFiam";
42
+
43
+ protected:
44
+ NativeRNFBTurboFiamCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
45
+ : TurboModule(std::string{NativeRNFBTurboFiamCxxSpec::kModuleName}, jsInvoker),
46
+ delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
47
+
48
+
49
+ private:
50
+ class Delegate : public NativeRNFBTurboFiamCxxSpecJSI {
51
+ public:
52
+ Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
53
+ NativeRNFBTurboFiamCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
54
+
55
+ }
56
+
57
+ jsi::Object getConstants(jsi::Runtime &rt) override {
58
+ static_assert(
59
+ bridging::getParameterCount(&T::getConstants) == 1,
60
+ "Expected getConstants(...) to have 1 parameters");
61
+
62
+ return bridging::callFromJs<jsi::Object>(
63
+ rt, &T::getConstants, jsInvoker_, instance_);
64
+ }
65
+ jsi::Value setAutomaticDataCollectionEnabled(jsi::Runtime &rt, bool enabled) override {
66
+ static_assert(
67
+ bridging::getParameterCount(&T::setAutomaticDataCollectionEnabled) == 2,
68
+ "Expected setAutomaticDataCollectionEnabled(...) to have 2 parameters");
69
+
70
+ return bridging::callFromJs<jsi::Value>(
71
+ rt, &T::setAutomaticDataCollectionEnabled, jsInvoker_, instance_, std::move(enabled));
72
+ }
73
+ jsi::Value setMessagesDisplaySuppressed(jsi::Runtime &rt, bool enabled) override {
74
+ static_assert(
75
+ bridging::getParameterCount(&T::setMessagesDisplaySuppressed) == 2,
76
+ "Expected setMessagesDisplaySuppressed(...) to have 2 parameters");
77
+
78
+ return bridging::callFromJs<jsi::Value>(
79
+ rt, &T::setMessagesDisplaySuppressed, jsInvoker_, instance_, std::move(enabled));
80
+ }
81
+ jsi::Value triggerEvent(jsi::Runtime &rt, jsi::String eventId) override {
82
+ static_assert(
83
+ bridging::getParameterCount(&T::triggerEvent) == 2,
84
+ "Expected triggerEvent(...) to have 2 parameters");
85
+
86
+ return bridging::callFromJs<jsi::Value>(
87
+ rt, &T::triggerEvent, jsInvoker_, instance_, std::move(eventId));
88
+ }
89
+
90
+ private:
91
+ friend class NativeRNFBTurboFiamCxxSpec;
92
+ T *instance_;
93
+ };
94
+
95
+ Delegate delegate_;
96
+ };
97
+
98
+ } // namespace facebook::react
@@ -17,7 +17,117 @@
17
17
  *
18
18
  */
19
19
 
20
- export * from "./modular.js";
21
- export * from "./namespaced.js";
22
- export { default } from "./namespaced.js";
20
+ import { isBoolean, isString } from '@react-native-firebase/app/dist/module/common';
21
+ import { FirebaseModule, getOrCreateModularInstance } from '@react-native-firebase/app/dist/module/internal';
22
+ import { setReactNativeModule } from '@react-native-firebase/app/dist/module/internal/nativeModule';
23
+ import "./types/internal.js";
24
+ import fallBackModule from "./web/RNFBFiamModule.js";
25
+ import { version } from "./version.js";
26
+ const nativeModuleName = 'NativeRNFBTurboFiam';
27
+ class FirebaseFiamModule extends FirebaseModule {
28
+ constructor(...args) {
29
+ super(...args);
30
+ this._isMessagesDisplaySuppressed = this.native.isMessagesDisplaySuppressed;
31
+ this._isAutomaticDataCollectionEnabled = this.native.isAutomaticDataCollectionEnabled;
32
+ }
33
+ get isMessagesDisplaySuppressed() {
34
+ return this._isMessagesDisplaySuppressed;
35
+ }
36
+ get isAutomaticDataCollectionEnabled() {
37
+ return this._isAutomaticDataCollectionEnabled;
38
+ }
39
+ setMessagesDisplaySuppressed(enabled) {
40
+ if (!isBoolean(enabled)) {
41
+ throw new Error("getInAppMessaging().setMessagesDisplaySuppressed(*) 'enabled' must be a boolean.");
42
+ }
43
+ this._isMessagesDisplaySuppressed = enabled;
44
+ return this.native.setMessagesDisplaySuppressed(enabled);
45
+ }
46
+ setAutomaticDataCollectionEnabled(enabled) {
47
+ if (!isBoolean(enabled)) {
48
+ throw new Error("getInAppMessaging().setAutomaticDataCollectionEnabled(*) 'enabled' must be a boolean.");
49
+ }
50
+ this._isAutomaticDataCollectionEnabled = enabled;
51
+ return this.native.setAutomaticDataCollectionEnabled(enabled);
52
+ }
53
+ triggerEvent(eventId) {
54
+ if (!isString(eventId)) {
55
+ throw new Error("getInAppMessaging().triggerEvent(*) 'eventId' must be a string.");
56
+ }
57
+ return this.native.triggerEvent(eventId);
58
+ }
59
+ }
60
+ const config = {
61
+ namespace: 'inAppMessaging',
62
+ nativeModuleName,
63
+ nativeEvents: false,
64
+ hasMultiAppSupport: false,
65
+ hasCustomUrlOrRegionSupport: false,
66
+ turboModule: true
67
+ };
68
+
69
+ /**
70
+ * RN Firebase package version string exported from the modular entry point.
71
+ *
72
+ * The firebase-js-sdk does not ship a modular In-App Messaging entry point or `SDK_VERSION` export.
73
+ */
74
+ export const SDK_VERSION = version;
75
+
76
+ /**
77
+ * Returns the {@link InAppMessaging} instance for the default or given {@link FirebaseApp}.
78
+ *
79
+ * @param app - The Firebase `FirebaseApp` to use. When omitted, the default app is used.
80
+ * @returns The In-App Messaging service instance for that app.
81
+ */
82
+ export function getInAppMessaging(app) {
83
+ return getOrCreateModularInstance(FirebaseFiamModule, config, app);
84
+ }
85
+
86
+ /**
87
+ * Determines whether messages are suppressed or not.
88
+ */
89
+ export function isMessagesDisplaySuppressed(inAppMessaging) {
90
+ return inAppMessaging.isMessagesDisplaySuppressed;
91
+ }
92
+
93
+ /**
94
+ * Enable or disable suppression of Firebase In App Messaging messages.
95
+ *
96
+ * When enabled, no in app messages will be rendered until either you disable suppression, or the app
97
+ * restarts. This state is not persisted between app restarts.
98
+ */
99
+ export function setMessagesDisplaySuppressed(inAppMessaging, enabled) {
100
+ return inAppMessaging.setMessagesDisplaySuppressed(enabled);
101
+ }
102
+
103
+ /**
104
+ * Determines whether automatic data collection is enabled or not.
105
+ */
106
+ export function isAutomaticDataCollectionEnabled(inAppMessaging) {
107
+ return inAppMessaging.isAutomaticDataCollectionEnabled;
108
+ }
109
+
110
+ /**
111
+ * Enable or disable automatic data collection for Firebase In-App Messaging.
112
+ *
113
+ * When enabled, generates a registration token on app startup if there is no valid one and
114
+ * generates a new token when it is deleted (which prevents `deleteInstanceId()` from stopping the
115
+ * periodic sending of data).
116
+ *
117
+ * This setting is persisted across app restarts and overrides the setting specified in your
118
+ * manifest/plist file.
119
+ */
120
+ export function setAutomaticDataCollectionEnabled(inAppMessaging, enabled) {
121
+ return inAppMessaging.setAutomaticDataCollectionEnabled(enabled);
122
+ }
123
+
124
+ /**
125
+ * Trigger in-app messages programmatically.
126
+ */
127
+ export function triggerEvent(inAppMessaging, eventId) {
128
+ return inAppMessaging.triggerEvent(eventId);
129
+ }
130
+
131
+ // Register the interop module for non-native platforms.
132
+ setReactNativeModule(nativeModuleName, fallBackModule);
23
133
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["default"],"sourceRoot":"../../lib","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,cAAc,cAAW;AAEzB,cAAc,iBAAc;AAC5B,SAASA,OAAO,QAAQ,iBAAc","ignoreList":[]}
1
+ {"version":3,"names":["isBoolean","isString","FirebaseModule","getOrCreateModularInstance","setReactNativeModule","fallBackModule","version","nativeModuleName","FirebaseFiamModule","constructor","args","_isMessagesDisplaySuppressed","native","isMessagesDisplaySuppressed","_isAutomaticDataCollectionEnabled","isAutomaticDataCollectionEnabled","setMessagesDisplaySuppressed","enabled","Error","setAutomaticDataCollectionEnabled","triggerEvent","eventId","config","namespace","nativeEvents","hasMultiAppSupport","hasCustomUrlOrRegionSupport","turboModule","SDK_VERSION","getInAppMessaging","app","inAppMessaging"],"sourceRoot":"../../lib","sources":["index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,QAAQ,QAAQ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":[]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  // Generated by genversion.
4
- export const version = '25.1.0';
4
+ export const version = '26.0.0';
5
5
  //# sourceMappingURL=version.js.map