@react-native-firebase/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 (71) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/RNFBMessaging.podspec +20 -6
  3. package/android/build.gradle +24 -0
  4. package/android/src/main/java/io/invertase/firebase/messaging/{ReactNativeFirebaseMessagingModule.java → NativeRNFBTurboMessaging.java} +143 -81
  5. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingPackage.java +1 -1
  6. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingReceiver.java +16 -0
  7. package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStoreImpl.java +50 -11
  8. package/android/src/main/java/io/invertase/firebase/messaging/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboMessagingSpec.java +151 -0
  9. package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/CMakeLists.txt +36 -0
  10. package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/RNFBMessagingTurboModules-generated.cpp +152 -0
  11. package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/RNFBMessagingTurboModules.h +31 -0
  12. package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/react/renderer/components/RNFBMessagingTurboModules/RNFBMessagingTurboModulesJSI-generated.cpp +161 -0
  13. package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/react/renderer/components/RNFBMessagingTurboModules/RNFBMessagingTurboModulesJSI.h +356 -0
  14. package/app.plugin.js +1 -1
  15. package/dist/module/index.js +622 -7
  16. package/dist/module/index.js.map +1 -1
  17. package/dist/module/statics.js +1 -1
  18. package/dist/module/types/internal.js +4 -0
  19. package/dist/module/types/internal.js.map +1 -0
  20. package/dist/module/types/messaging.js +0 -15
  21. package/dist/module/types/messaging.js.map +1 -1
  22. package/dist/module/version.js +1 -1
  23. package/dist/typescript/lib/index.d.ts +182 -5
  24. package/dist/typescript/lib/index.d.ts.map +1 -1
  25. package/dist/typescript/lib/types/internal.d.ts +41 -0
  26. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  27. package/dist/typescript/lib/types/messaging.d.ts +7 -55
  28. package/dist/typescript/lib/types/messaging.d.ts.map +1 -1
  29. package/dist/typescript/lib/version.d.ts +1 -1
  30. package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.h +24 -2
  31. package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.m +82 -12
  32. package/ios/RNFBMessaging/RNFBMessaging+NSNotificationCenter.m +14 -4
  33. package/ios/RNFBMessaging/RNFBMessaging+UNUserNotificationCenter.m +31 -28
  34. package/ios/RNFBMessaging/RNFBMessagingModule.h +3 -2
  35. package/ios/RNFBMessaging/RNFBMessagingModule.mm +500 -0
  36. package/ios/RNFBMessaging.xcodeproj/project.pbxproj +8 -8
  37. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  38. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  39. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  40. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  41. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  42. package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  43. package/ios/generated/RNFBMessagingTurboModules/RNFBMessagingTurboModules-generated.mm +184 -0
  44. package/ios/generated/RNFBMessagingTurboModules/RNFBMessagingTurboModules.h +222 -0
  45. package/ios/generated/RNFBMessagingTurboModulesJSI-generated.cpp +161 -0
  46. package/ios/generated/RNFBMessagingTurboModulesJSI.h +356 -0
  47. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  48. package/lib/index.ts +821 -15
  49. package/lib/statics.ts +1 -1
  50. package/lib/types/internal.ts +59 -0
  51. package/lib/types/messaging.ts +7 -72
  52. package/lib/version.ts +1 -1
  53. package/package.json +30 -5
  54. package/plugin/build/app.plugin.d.ts +2 -0
  55. package/plugin/build/app.plugin.js +6 -0
  56. package/plugin/src/app.plugin.ts +3 -0
  57. package/plugin/tsconfig.tsbuildinfo +1 -1
  58. package/react-native.config.js +10 -0
  59. package/specs/NativeRNFBTurboMessaging.ts +46 -0
  60. package/typedoc.json +2 -19
  61. package/dist/module/modular.js +0 -396
  62. package/dist/module/modular.js.map +0 -1
  63. package/dist/module/namespaced.js +0 -415
  64. package/dist/module/namespaced.js.map +0 -1
  65. package/dist/typescript/lib/modular.d.ts +0 -255
  66. package/dist/typescript/lib/modular.d.ts.map +0 -1
  67. package/dist/typescript/lib/namespaced.d.ts +0 -12
  68. package/dist/typescript/lib/namespaced.d.ts.map +0 -1
  69. package/ios/RNFBMessaging/RNFBMessagingModule.m +0 -439
  70. package/lib/modular.ts +0 -455
  71. package/lib/namespaced.ts +0 -593
@@ -0,0 +1,151 @@
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.bridge.ReadableMap;
21
+ import com.facebook.react.common.build.ReactBuildConfig;
22
+ import com.facebook.react.turbomodule.core.interfaces.TurboModule;
23
+ import java.util.Arrays;
24
+ import java.util.HashSet;
25
+ import java.util.Map;
26
+ import java.util.Set;
27
+ import javax.annotation.Nonnull;
28
+ import javax.annotation.Nullable;
29
+
30
+ public abstract class NativeRNFBTurboMessagingSpec extends ReactContextBaseJavaModule implements TurboModule {
31
+ public static final String NAME = "NativeRNFBTurboMessaging";
32
+
33
+ public NativeRNFBTurboMessagingSpec(ReactApplicationContext reactContext) {
34
+ super(reactContext);
35
+ }
36
+
37
+ @Override
38
+ public @Nonnull String getName() {
39
+ return NAME;
40
+ }
41
+
42
+ protected abstract Map<String, Object> getTypedExportedConstants();
43
+
44
+ @Override
45
+ @DoNotStrip
46
+ public final @Nullable Map<String, Object> getConstants() {
47
+ Map<String, Object> constants = getTypedExportedConstants();
48
+ if (ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD) {
49
+ Set<String> obligatoryFlowConstants = new HashSet<>(Arrays.asList(
50
+ "isAutoInitEnabled",
51
+ "isDeliveryMetricsExportToBigQueryEnabled"
52
+ ));
53
+ Set<String> optionalFlowConstants = new HashSet<>(Arrays.asList(
54
+ "isNotificationDelegationEnabled",
55
+ "isRegisteredForRemoteNotifications"
56
+ ));
57
+ Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
58
+ undeclaredConstants.removeAll(obligatoryFlowConstants);
59
+ undeclaredConstants.removeAll(optionalFlowConstants);
60
+ if (!undeclaredConstants.isEmpty()) {
61
+ throw new IllegalStateException(String.format("Native Module Flow doesn't declare constants: %s", undeclaredConstants));
62
+ }
63
+ undeclaredConstants = obligatoryFlowConstants;
64
+ undeclaredConstants.removeAll(constants.keySet());
65
+ if (!undeclaredConstants.isEmpty()) {
66
+ throw new IllegalStateException(String.format("Native Module doesn't fill in constants: %s", undeclaredConstants));
67
+ }
68
+ }
69
+ return constants;
70
+ }
71
+
72
+ @ReactMethod
73
+ @DoNotStrip
74
+ public abstract void getInitialNotification(Promise promise);
75
+
76
+ @ReactMethod
77
+ @DoNotStrip
78
+ public abstract void getDidOpenSettingsForNotification(Promise promise);
79
+
80
+ @ReactMethod
81
+ @DoNotStrip
82
+ public abstract void setAutoInitEnabled(boolean enabled, Promise promise);
83
+
84
+ @ReactMethod
85
+ @DoNotStrip
86
+ public abstract void signalBackgroundMessageHandlerSet();
87
+
88
+ @ReactMethod
89
+ @DoNotStrip
90
+ public abstract void completeNotificationProcessing();
91
+
92
+ @ReactMethod
93
+ @DoNotStrip
94
+ public abstract void getToken(String appName, String senderId, Promise promise);
95
+
96
+ @ReactMethod
97
+ @DoNotStrip
98
+ public abstract void deleteToken(String appName, String senderId, Promise promise);
99
+
100
+ @ReactMethod
101
+ @DoNotStrip
102
+ public abstract void getAPNSToken(Promise promise);
103
+
104
+ @ReactMethod
105
+ @DoNotStrip
106
+ public abstract void setAPNSToken(String token, @Nullable String type, Promise promise);
107
+
108
+ @ReactMethod
109
+ @DoNotStrip
110
+ public abstract void getIsHeadless(Promise promise);
111
+
112
+ @ReactMethod
113
+ @DoNotStrip
114
+ public abstract void requestPermission(ReadableMap permissions, Promise promise);
115
+
116
+ @ReactMethod
117
+ @DoNotStrip
118
+ public abstract void registerForRemoteNotifications(Promise promise);
119
+
120
+ @ReactMethod
121
+ @DoNotStrip
122
+ public abstract void unregisterForRemoteNotifications(Promise promise);
123
+
124
+ @ReactMethod
125
+ @DoNotStrip
126
+ public abstract void hasPermission(Promise promise);
127
+
128
+ @ReactMethod
129
+ @DoNotStrip
130
+ public abstract void sendMessage(ReadableMap remoteMessageMap, Promise promise);
131
+
132
+ @ReactMethod
133
+ @DoNotStrip
134
+ public abstract void subscribeToTopic(String topic, Promise promise);
135
+
136
+ @ReactMethod
137
+ @DoNotStrip
138
+ public abstract void unsubscribeFromTopic(String topic, Promise promise);
139
+
140
+ @ReactMethod
141
+ @DoNotStrip
142
+ public abstract void setDeliveryMetricsExportToBigQuery(boolean enabled, Promise promise);
143
+
144
+ @ReactMethod
145
+ @DoNotStrip
146
+ public abstract void setNotificationDelegationEnabled(boolean enabled, Promise promise);
147
+
148
+ @ReactMethod
149
+ @DoNotStrip
150
+ public abstract void isNotificationDelegationEnabled(Promise promise);
151
+ }
@@ -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/RNFBMessagingTurboModules/*.cpp)
10
+
11
+ add_library(
12
+ react_codegen_RNFBMessagingTurboModules
13
+ OBJECT
14
+ ${react_codegen_SRCS}
15
+ )
16
+
17
+ target_include_directories(react_codegen_RNFBMessagingTurboModules PUBLIC . react/renderer/components/RNFBMessagingTurboModules)
18
+
19
+ target_link_libraries(
20
+ react_codegen_RNFBMessagingTurboModules
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_RNFBMessagingTurboModules
30
+ PRIVATE
31
+ -DLOG_TAG=\"ReactNative\"
32
+ -fexceptions
33
+ -frtti
34
+ -std=c++20
35
+ -Wall
36
+ )
@@ -0,0 +1,152 @@
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 "RNFBMessagingTurboModules.h"
12
+
13
+ namespace facebook::react {
14
+
15
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_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_NativeRNFBTurboMessagingSpecJSI_getInitialNotification(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, "getInitialNotification", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
23
+ }
24
+
25
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_getDidOpenSettingsForNotification(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, "getDidOpenSettingsForNotification", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
28
+ }
29
+
30
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_setAutoInitEnabled(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, "setAutoInitEnabled", "(ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
33
+ }
34
+
35
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_signalBackgroundMessageHandlerSet(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
36
+ static jmethodID cachedMethodId = nullptr;
37
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "signalBackgroundMessageHandlerSet", "()V", args, count, cachedMethodId);
38
+ }
39
+
40
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_completeNotificationProcessing(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
41
+ static jmethodID cachedMethodId = nullptr;
42
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "completeNotificationProcessing", "()V", args, count, cachedMethodId);
43
+ }
44
+
45
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_getToken(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
46
+ static jmethodID cachedMethodId = nullptr;
47
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getToken", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
48
+ }
49
+
50
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_deleteToken(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
51
+ static jmethodID cachedMethodId = nullptr;
52
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "deleteToken", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
53
+ }
54
+
55
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_getAPNSToken(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
56
+ static jmethodID cachedMethodId = nullptr;
57
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getAPNSToken", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
58
+ }
59
+
60
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_setAPNSToken(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
61
+ static jmethodID cachedMethodId = nullptr;
62
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setAPNSToken", "(Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
63
+ }
64
+
65
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_getIsHeadless(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
66
+ static jmethodID cachedMethodId = nullptr;
67
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "getIsHeadless", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
68
+ }
69
+
70
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_requestPermission(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
71
+ static jmethodID cachedMethodId = nullptr;
72
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "requestPermission", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
73
+ }
74
+
75
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_registerForRemoteNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
76
+ static jmethodID cachedMethodId = nullptr;
77
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "registerForRemoteNotifications", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
78
+ }
79
+
80
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_unregisterForRemoteNotifications(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
81
+ static jmethodID cachedMethodId = nullptr;
82
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "unregisterForRemoteNotifications", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
83
+ }
84
+
85
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_hasPermission(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
86
+ static jmethodID cachedMethodId = nullptr;
87
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "hasPermission", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
88
+ }
89
+
90
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_sendMessage(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
91
+ static jmethodID cachedMethodId = nullptr;
92
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "sendMessage", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
93
+ }
94
+
95
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_subscribeToTopic(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
96
+ static jmethodID cachedMethodId = nullptr;
97
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "subscribeToTopic", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
98
+ }
99
+
100
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_unsubscribeFromTopic(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
101
+ static jmethodID cachedMethodId = nullptr;
102
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "unsubscribeFromTopic", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
103
+ }
104
+
105
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_setDeliveryMetricsExportToBigQuery(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
106
+ static jmethodID cachedMethodId = nullptr;
107
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setDeliveryMetricsExportToBigQuery", "(ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
108
+ }
109
+
110
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_setNotificationDelegationEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
111
+ static jmethodID cachedMethodId = nullptr;
112
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "setNotificationDelegationEnabled", "(ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
113
+ }
114
+
115
+ static facebook::jsi::Value __hostFunction_NativeRNFBTurboMessagingSpecJSI_isNotificationDelegationEnabled(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
116
+ static jmethodID cachedMethodId = nullptr;
117
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, PromiseKind, "isNotificationDelegationEnabled", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
118
+ }
119
+
120
+ NativeRNFBTurboMessagingSpecJSI::NativeRNFBTurboMessagingSpecJSI(const JavaTurboModule::InitParams &params)
121
+ : JavaTurboModule(params) {
122
+ methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_getConstants};
123
+ methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_getInitialNotification};
124
+ methodMap_["getDidOpenSettingsForNotification"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_getDidOpenSettingsForNotification};
125
+ methodMap_["setAutoInitEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingSpecJSI_setAutoInitEnabled};
126
+ methodMap_["signalBackgroundMessageHandlerSet"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_signalBackgroundMessageHandlerSet};
127
+ methodMap_["completeNotificationProcessing"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_completeNotificationProcessing};
128
+ methodMap_["getToken"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboMessagingSpecJSI_getToken};
129
+ methodMap_["deleteToken"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboMessagingSpecJSI_deleteToken};
130
+ methodMap_["getAPNSToken"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_getAPNSToken};
131
+ methodMap_["setAPNSToken"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboMessagingSpecJSI_setAPNSToken};
132
+ methodMap_["getIsHeadless"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_getIsHeadless};
133
+ methodMap_["requestPermission"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingSpecJSI_requestPermission};
134
+ methodMap_["registerForRemoteNotifications"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_registerForRemoteNotifications};
135
+ methodMap_["unregisterForRemoteNotifications"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_unregisterForRemoteNotifications};
136
+ methodMap_["hasPermission"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_hasPermission};
137
+ methodMap_["sendMessage"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingSpecJSI_sendMessage};
138
+ methodMap_["subscribeToTopic"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingSpecJSI_subscribeToTopic};
139
+ methodMap_["unsubscribeFromTopic"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingSpecJSI_unsubscribeFromTopic};
140
+ methodMap_["setDeliveryMetricsExportToBigQuery"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingSpecJSI_setDeliveryMetricsExportToBigQuery};
141
+ methodMap_["setNotificationDelegationEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingSpecJSI_setNotificationDelegationEnabled};
142
+ methodMap_["isNotificationDelegationEnabled"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingSpecJSI_isNotificationDelegationEnabled};
143
+ }
144
+
145
+ std::shared_ptr<TurboModule> RNFBMessagingTurboModules_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
146
+ if (moduleName == "NativeRNFBTurboMessaging") {
147
+ return std::make_shared<NativeRNFBTurboMessagingSpecJSI>(params);
148
+ }
149
+ return nullptr;
150
+ }
151
+
152
+ } // 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 'NativeRNFBTurboMessaging'
21
+ */
22
+ class JSI_EXPORT NativeRNFBTurboMessagingSpecJSI : public JavaTurboModule {
23
+ public:
24
+ NativeRNFBTurboMessagingSpecJSI(const JavaTurboModule::InitParams &params);
25
+ };
26
+
27
+
28
+ JSI_EXPORT
29
+ std::shared_ptr<TurboModule> RNFBMessagingTurboModules_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params);
30
+
31
+ } // namespace facebook::react
@@ -0,0 +1,161 @@
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 "RNFBMessagingTurboModulesJSI.h"
11
+
12
+ namespace facebook::react {
13
+
14
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
15
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->getConstants(
16
+ rt
17
+ );
18
+ }
19
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getInitialNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
20
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->getInitialNotification(
21
+ rt
22
+ );
23
+ }
24
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getDidOpenSettingsForNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
25
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->getDidOpenSettingsForNotification(
26
+ rt
27
+ );
28
+ }
29
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setAutoInitEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
30
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->setAutoInitEnabled(
31
+ rt,
32
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
33
+ );
34
+ }
35
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_signalBackgroundMessageHandlerSet(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
36
+ static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->signalBackgroundMessageHandlerSet(
37
+ rt
38
+ );
39
+ return jsi::Value::undefined();
40
+ }
41
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_completeNotificationProcessing(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
42
+ static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->completeNotificationProcessing(
43
+ rt
44
+ );
45
+ return jsi::Value::undefined();
46
+ }
47
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
48
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->getToken(
49
+ rt,
50
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
51
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
52
+ );
53
+ }
54
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_deleteToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
55
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->deleteToken(
56
+ rt,
57
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
58
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
59
+ );
60
+ }
61
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getAPNSToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
62
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->getAPNSToken(
63
+ rt
64
+ );
65
+ }
66
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setAPNSToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
67
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->setAPNSToken(
68
+ rt,
69
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
70
+ count <= 1 || args[1].isUndefined() ? std::nullopt : std::make_optional(args[1].asString(rt))
71
+ );
72
+ }
73
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getIsHeadless(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
74
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->getIsHeadless(
75
+ rt
76
+ );
77
+ }
78
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_requestPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
79
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->requestPermission(
80
+ rt,
81
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
82
+ );
83
+ }
84
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_registerForRemoteNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
85
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->registerForRemoteNotifications(
86
+ rt
87
+ );
88
+ }
89
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_unregisterForRemoteNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
90
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->unregisterForRemoteNotifications(
91
+ rt
92
+ );
93
+ }
94
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_hasPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
95
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->hasPermission(
96
+ rt
97
+ );
98
+ }
99
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_sendMessage(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
100
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->sendMessage(
101
+ rt,
102
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
103
+ );
104
+ }
105
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_subscribeToTopic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
106
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->subscribeToTopic(
107
+ rt,
108
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
109
+ );
110
+ }
111
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_unsubscribeFromTopic(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
112
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->unsubscribeFromTopic(
113
+ rt,
114
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
115
+ );
116
+ }
117
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setDeliveryMetricsExportToBigQuery(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
118
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->setDeliveryMetricsExportToBigQuery(
119
+ rt,
120
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
121
+ );
122
+ }
123
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setNotificationDelegationEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
124
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->setNotificationDelegationEnabled(
125
+ rt,
126
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
127
+ );
128
+ }
129
+ static jsi::Value __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_isNotificationDelegationEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
130
+ return static_cast<NativeRNFBTurboMessagingCxxSpecJSI *>(&turboModule)->isNotificationDelegationEnabled(
131
+ rt
132
+ );
133
+ }
134
+
135
+ NativeRNFBTurboMessagingCxxSpecJSI::NativeRNFBTurboMessagingCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
136
+ : TurboModule("NativeRNFBTurboMessaging", jsInvoker) {
137
+ methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getConstants};
138
+ methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getInitialNotification};
139
+ methodMap_["getDidOpenSettingsForNotification"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getDidOpenSettingsForNotification};
140
+ methodMap_["setAutoInitEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setAutoInitEnabled};
141
+ methodMap_["signalBackgroundMessageHandlerSet"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_signalBackgroundMessageHandlerSet};
142
+ methodMap_["completeNotificationProcessing"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_completeNotificationProcessing};
143
+ methodMap_["getToken"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getToken};
144
+ methodMap_["deleteToken"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_deleteToken};
145
+ methodMap_["getAPNSToken"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getAPNSToken};
146
+ methodMap_["setAPNSToken"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setAPNSToken};
147
+ methodMap_["getIsHeadless"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_getIsHeadless};
148
+ methodMap_["requestPermission"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_requestPermission};
149
+ methodMap_["registerForRemoteNotifications"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_registerForRemoteNotifications};
150
+ methodMap_["unregisterForRemoteNotifications"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_unregisterForRemoteNotifications};
151
+ methodMap_["hasPermission"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_hasPermission};
152
+ methodMap_["sendMessage"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_sendMessage};
153
+ methodMap_["subscribeToTopic"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_subscribeToTopic};
154
+ methodMap_["unsubscribeFromTopic"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_unsubscribeFromTopic};
155
+ methodMap_["setDeliveryMetricsExportToBigQuery"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setDeliveryMetricsExportToBigQuery};
156
+ methodMap_["setNotificationDelegationEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_setNotificationDelegationEnabled};
157
+ methodMap_["isNotificationDelegationEnabled"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboMessagingCxxSpecJSI_isNotificationDelegationEnabled};
158
+ }
159
+
160
+
161
+ } // namespace facebook::react