@react-native-firebase/messaging 25.1.0 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/RNFBMessaging.podspec +27 -8
- package/android/build.gradle +24 -0
- package/android/src/main/java/io/invertase/firebase/messaging/{ReactNativeFirebaseMessagingModule.java → NativeRNFBTurboMessaging.java} +143 -81
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingPackage.java +1 -1
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingReceiver.java +16 -0
- package/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingStoreImpl.java +50 -11
- package/android/src/main/java/io/invertase/firebase/messaging/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboMessagingSpec.java +151 -0
- package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/CMakeLists.txt +36 -0
- package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/RNFBMessagingTurboModules-generated.cpp +152 -0
- package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/RNFBMessagingTurboModules.h +31 -0
- package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/react/renderer/components/RNFBMessagingTurboModules/RNFBMessagingTurboModulesJSI-generated.cpp +161 -0
- package/android/src/main/java/io/invertase/firebase/messaging/generated/jni/react/renderer/components/RNFBMessagingTurboModules/RNFBMessagingTurboModulesJSI.h +356 -0
- package/app.plugin.js +1 -1
- package/dist/module/index.js +622 -7
- package/dist/module/index.js.map +1 -1
- package/dist/module/statics.js +1 -1
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/types/messaging.js +0 -15
- package/dist/module/types/messaging.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/index.d.ts +182 -5
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +41 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/types/messaging.d.ts +7 -55
- package/dist/typescript/lib/types/messaging.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.h +24 -2
- package/ios/RNFBMessaging/RNFBMessaging+AppDelegate.m +90 -12
- package/ios/RNFBMessaging/RNFBMessaging+FIRMessagingDelegate.h +8 -0
- package/ios/RNFBMessaging/RNFBMessaging+NSNotificationCenter.m +22 -4
- package/ios/RNFBMessaging/RNFBMessaging+UNUserNotificationCenter.m +31 -28
- package/ios/RNFBMessaging/RNFBMessagingModule.h +3 -2
- package/ios/RNFBMessaging/RNFBMessagingModule.mm +508 -0
- package/ios/RNFBMessaging/RNFBMessagingSerializer.h +8 -0
- package/ios/RNFBMessaging.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBMessagingTurboModules/RNFBMessagingTurboModules-generated.mm +184 -0
- package/ios/generated/RNFBMessagingTurboModules/RNFBMessagingTurboModules.h +222 -0
- package/ios/generated/RNFBMessagingTurboModulesJSI-generated.cpp +161 -0
- package/ios/generated/RNFBMessagingTurboModulesJSI.h +356 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/index.ts +821 -15
- package/lib/statics.ts +1 -1
- package/lib/types/internal.ts +59 -0
- package/lib/types/messaging.ts +7 -72
- package/lib/version.ts +1 -1
- package/package.json +30 -5
- package/plugin/build/android/setupFirebaseNotifationIcon.d.ts +3 -2
- package/plugin/build/android/setupFirebaseNotifationIcon.js +14 -7
- package/plugin/build/app.plugin.d.ts +2 -0
- package/plugin/build/app.plugin.js +6 -0
- package/plugin/build/index.d.ts +2 -1
- package/plugin/build/index.js +4 -4
- package/plugin/build/pluginConfig.d.ts +7 -0
- package/plugin/build/pluginConfig.js +2 -0
- package/plugin/src/android/setupFirebaseNotifationIcon.ts +19 -6
- package/plugin/src/app.plugin.ts +3 -0
- package/plugin/src/index.ts +5 -4
- package/plugin/src/pluginConfig.ts +8 -0
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboMessaging.ts +46 -0
- package/typedoc.json +2 -19
- package/dist/module/modular.js +0 -396
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -415
- package/dist/module/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -255
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -12
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/ios/RNFBMessaging/RNFBMessagingModule.m +0 -439
- package/lib/modular.ts +0 -455
- package/lib/namespaced.ts +0 -593
|
@@ -5,9 +5,13 @@ import static io.invertase.firebase.messaging.JsonConvert.reactToJSON;
|
|
|
5
5
|
import static io.invertase.firebase.messaging.ReactNativeFirebaseMessagingSerializer.remoteMessageFromReadableMap;
|
|
6
6
|
import static io.invertase.firebase.messaging.ReactNativeFirebaseMessagingSerializer.remoteMessageToWritableMap;
|
|
7
7
|
|
|
8
|
+
import android.util.Log;
|
|
8
9
|
import com.facebook.react.bridge.ReadableMap;
|
|
9
10
|
import com.facebook.react.bridge.WritableMap;
|
|
10
11
|
import com.google.firebase.messaging.RemoteMessage;
|
|
12
|
+
import io.invertase.firebase.common.ReactNativeFirebaseJSON;
|
|
13
|
+
import io.invertase.firebase.common.ReactNativeFirebaseMeta;
|
|
14
|
+
import io.invertase.firebase.common.ReactNativeFirebasePreferences;
|
|
11
15
|
import io.invertase.firebase.common.UniversalFirebasePreferences;
|
|
12
16
|
import java.util.ArrayList;
|
|
13
17
|
import java.util.Arrays;
|
|
@@ -17,31 +21,68 @@ import org.json.JSONObject;
|
|
|
17
21
|
|
|
18
22
|
public class ReactNativeFirebaseMessagingStoreImpl implements ReactNativeFirebaseMessagingStore {
|
|
19
23
|
|
|
24
|
+
private static final String TAG = "RNFirebaseMsgStore";
|
|
25
|
+
private static final String KEY_MAX_STORED_NOTIFICATIONS = "messaging_max_stored_notifications";
|
|
20
26
|
private static final String S_KEY_ALL_NOTIFICATION_IDS = "all_notification_ids";
|
|
21
|
-
private static final int
|
|
27
|
+
private static final int DEFAULT_MAX_SIZE_NOTIFICATIONS = 100;
|
|
22
28
|
private final String DELIMITER = ",";
|
|
29
|
+
private static volatile int maxNotificationSize = -1;
|
|
30
|
+
|
|
31
|
+
private static int resolveMaxNotificationSize() {
|
|
32
|
+
int maxSize = DEFAULT_MAX_SIZE_NOTIFICATIONS;
|
|
33
|
+
String source = "default";
|
|
34
|
+
ReactNativeFirebaseJSON json = ReactNativeFirebaseJSON.getSharedInstance();
|
|
35
|
+
ReactNativeFirebaseMeta meta = ReactNativeFirebaseMeta.getSharedInstance();
|
|
36
|
+
ReactNativeFirebasePreferences prefs = ReactNativeFirebasePreferences.getSharedInstance();
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
if (prefs.contains(KEY_MAX_STORED_NOTIFICATIONS)) {
|
|
40
|
+
maxSize = prefs.getIntValue(KEY_MAX_STORED_NOTIFICATIONS, DEFAULT_MAX_SIZE_NOTIFICATIONS);
|
|
41
|
+
source = "SharedPreferences";
|
|
42
|
+
} else if (json.contains(KEY_MAX_STORED_NOTIFICATIONS)) {
|
|
43
|
+
maxSize = json.getIntValue(KEY_MAX_STORED_NOTIFICATIONS, DEFAULT_MAX_SIZE_NOTIFICATIONS);
|
|
44
|
+
source = "firebase.json";
|
|
45
|
+
} else if (meta.contains(KEY_MAX_STORED_NOTIFICATIONS)) {
|
|
46
|
+
maxSize = meta.getIntValue(KEY_MAX_STORED_NOTIFICATIONS, DEFAULT_MAX_SIZE_NOTIFICATIONS);
|
|
47
|
+
source = "AndroidManifest";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Log.d(TAG, "messaging_max_stored_notifications: " + maxSize + " (from " + source + ")");
|
|
51
|
+
return maxSize;
|
|
52
|
+
} catch (Exception e) {
|
|
53
|
+
Log.w(
|
|
54
|
+
TAG,
|
|
55
|
+
"Error resolving max notification size, using default: " + DEFAULT_MAX_SIZE_NOTIFICATIONS,
|
|
56
|
+
e);
|
|
57
|
+
return DEFAULT_MAX_SIZE_NOTIFICATIONS;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
private static int getMaxNotificationSize() {
|
|
62
|
+
if (maxNotificationSize == -1) {
|
|
63
|
+
maxNotificationSize = resolveMaxNotificationSize();
|
|
64
|
+
}
|
|
65
|
+
return maxNotificationSize;
|
|
66
|
+
}
|
|
23
67
|
|
|
24
68
|
@Override
|
|
25
69
|
public void storeFirebaseMessage(RemoteMessage remoteMessage) {
|
|
26
70
|
try {
|
|
27
71
|
String remoteMessageString =
|
|
28
72
|
reactToJSON(remoteMessageToWritableMap(remoteMessage)).toString();
|
|
29
|
-
// Log.d("storeFirebaseMessage", remoteMessageString);
|
|
30
73
|
UniversalFirebasePreferences preferences = UniversalFirebasePreferences.getSharedInstance();
|
|
31
74
|
|
|
32
|
-
|
|
75
|
+
int limit = getMaxNotificationSize();
|
|
33
76
|
String notificationIds = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");
|
|
34
77
|
List<String> allNotificationList = convertToArray(notificationIds);
|
|
35
|
-
while (allNotificationList.size() >
|
|
78
|
+
while (allNotificationList.size() > limit - 1) {
|
|
36
79
|
clearFirebaseMessage(allNotificationList.get(0));
|
|
37
80
|
allNotificationList.remove(0);
|
|
38
81
|
}
|
|
39
82
|
|
|
40
|
-
// now refetch the ids after possible removals, and store the new message
|
|
41
83
|
notificationIds = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");
|
|
42
84
|
preferences.setStringValue(remoteMessage.getMessageId(), remoteMessageString);
|
|
43
|
-
|
|
44
|
-
notificationIds += remoteMessage.getMessageId() + DELIMITER; // append to last
|
|
85
|
+
notificationIds += remoteMessage.getMessageId() + DELIMITER;
|
|
45
86
|
preferences.setStringValue(S_KEY_ALL_NOTIFICATION_IDS, notificationIds);
|
|
46
87
|
} catch (JSONException e) {
|
|
47
88
|
e.printStackTrace();
|
|
@@ -63,10 +104,9 @@ public class ReactNativeFirebaseMessagingStoreImpl implements ReactNativeFirebas
|
|
|
63
104
|
String remoteMessageString =
|
|
64
105
|
UniversalFirebasePreferences.getSharedInstance().getStringValue(remoteMessageId, null);
|
|
65
106
|
if (remoteMessageString != null) {
|
|
66
|
-
// Log.d("getFirebaseMessage", remoteMessageString);
|
|
67
107
|
try {
|
|
68
108
|
WritableMap remoteMessageMap = jsonToReact(new JSONObject(remoteMessageString));
|
|
69
|
-
remoteMessageMap.putString("to", remoteMessageId);
|
|
109
|
+
remoteMessageMap.putString("to", remoteMessageId);
|
|
70
110
|
return remoteMessageMap;
|
|
71
111
|
} catch (JSONException e) {
|
|
72
112
|
e.printStackTrace();
|
|
@@ -79,10 +119,9 @@ public class ReactNativeFirebaseMessagingStoreImpl implements ReactNativeFirebas
|
|
|
79
119
|
public void clearFirebaseMessage(String remoteMessageId) {
|
|
80
120
|
UniversalFirebasePreferences preferences = UniversalFirebasePreferences.getSharedInstance();
|
|
81
121
|
preferences.remove(remoteMessageId).apply();
|
|
82
|
-
// check and remove old notifications message
|
|
83
122
|
String notificationIds = preferences.getStringValue(S_KEY_ALL_NOTIFICATION_IDS, "");
|
|
84
123
|
if (!notificationIds.isEmpty()) {
|
|
85
|
-
notificationIds = removeRemoteMessageId(remoteMessageId, notificationIds);
|
|
124
|
+
notificationIds = removeRemoteMessageId(remoteMessageId, notificationIds);
|
|
86
125
|
preferences.setStringValue(S_KEY_ALL_NOTIFICATION_IDS, notificationIds);
|
|
87
126
|
}
|
|
88
127
|
}
|
|
@@ -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 ¶ms)
|
|
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 ¶ms) {
|
|
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 ¶ms);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
JSI_EXPORT
|
|
29
|
+
std::shared_ptr<TurboModule> RNFBMessagingTurboModules_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
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
|