reteno-react-native-sdk 1.6.2 → 1.7.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/android/app/build/generated/source/codegen/RCTAppDependencyProvider.h +25 -0
- package/android/app/build/generated/source/codegen/RCTAppDependencyProvider.mm +55 -0
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/app/build/generated/source/codegen/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/app/build/generated/source/codegen/RCTThirdPartyComponentsProvider.mm +23 -0
- package/android/app/build/generated/source/codegen/ReactAppDependencyProvider.podspec +34 -0
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeRetenoSdkSpec.java +172 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +5 -5
- package/android/app/build/generated/source/codegen/jni/NativeRetenoSdkSpec-generated.cpp +176 -0
- package/android/app/build/generated/source/codegen/jni/NativeRetenoSdkSpec.h +31 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/NativeRetenoSdkSpec/NativeRetenoSdkSpecJSI-generated.cpp +176 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/NativeRetenoSdkSpec/NativeRetenoSdkSpecJSI.h +343 -0
- package/android/build.gradle +1 -1
- package/ios/RetenoSdk.xcodeproj/project.xcworkspace/xcuserdata/artem.chupika.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/package.json +4 -4
- package/reteno-react-native-sdk.podspec +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
|
|
12
|
+
#import <React-RCTAppDelegate/RCTDependencyProvider.h>
|
|
13
|
+
#elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
|
|
14
|
+
#import <React_RCTAppDelegate/RCTDependencyProvider.h>
|
|
15
|
+
#else
|
|
16
|
+
#import "RCTDependencyProvider.h"
|
|
17
|
+
#endif
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
20
|
+
|
|
21
|
+
@interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTAppDependencyProvider.h"
|
|
9
|
+
#import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
|
|
10
|
+
#import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
|
|
11
|
+
|
|
12
|
+
@implementation RCTAppDependencyProvider {
|
|
13
|
+
NSArray<NSString *> * _URLRequestHandlerClassNames;
|
|
14
|
+
NSArray<NSString *> * _imageDataDecoderClassNames;
|
|
15
|
+
NSArray<NSString *> * _imageURLLoaderClassNames;
|
|
16
|
+
NSDictionary<NSString *,Class<RCTComponentViewProtocol>> * _thirdPartyFabricComponents;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
|
|
20
|
+
static dispatch_once_t requestUrlToken;
|
|
21
|
+
dispatch_once(&requestUrlToken, ^{
|
|
22
|
+
self->_URLRequestHandlerClassNames = RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return _URLRequestHandlerClassNames;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
- (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
|
|
29
|
+
static dispatch_once_t dataDecoderToken;
|
|
30
|
+
dispatch_once(&dataDecoderToken, ^{
|
|
31
|
+
_imageDataDecoderClassNames = RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return _imageDataDecoderClassNames;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
|
|
38
|
+
static dispatch_once_t urlLoaderToken;
|
|
39
|
+
dispatch_once(&urlLoaderToken, ^{
|
|
40
|
+
_imageURLLoaderClassNames = RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
return _imageURLLoaderClassNames;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
- (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
|
|
47
|
+
static dispatch_once_t nativeComponentsToken;
|
|
48
|
+
dispatch_once(&nativeComponentsToken, ^{
|
|
49
|
+
_thirdPartyFabricComponents = RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return _thirdPartyFabricComponents;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@interface RCTModulesConformingToProtocolsProvider: NSObject
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames;
|
|
13
|
+
|
|
14
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames;
|
|
15
|
+
|
|
16
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames;
|
|
17
|
+
|
|
18
|
+
@end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import "RCTModulesConformingToProtocolsProvider.h"
|
|
9
|
+
|
|
10
|
+
@implementation RCTModulesConformingToProtocolsProvider
|
|
11
|
+
|
|
12
|
+
+(NSArray<NSString *> *)imageURLLoaderClassNames
|
|
13
|
+
{
|
|
14
|
+
return @[
|
|
15
|
+
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
+(NSArray<NSString *> *)imageDataDecoderClassNames
|
|
20
|
+
{
|
|
21
|
+
return @[
|
|
22
|
+
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
+(NSArray<NSString *> *)URLRequestHandlerClassNames
|
|
27
|
+
{
|
|
28
|
+
return @[
|
|
29
|
+
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
@protocol RCTComponentViewProtocol;
|
|
11
|
+
|
|
12
|
+
@interface RCTThirdPartyComponentsProvider: NSObject
|
|
13
|
+
|
|
14
|
+
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
|
15
|
+
|
|
16
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
|
|
11
|
+
#import "RCTThirdPartyComponentsProvider.h"
|
|
12
|
+
#import <React/RCTComponentViewProtocol.h>
|
|
13
|
+
|
|
14
|
+
@implementation RCTThirdPartyComponentsProvider
|
|
15
|
+
|
|
16
|
+
+ (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
|
|
17
|
+
{
|
|
18
|
+
return @{
|
|
19
|
+
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
version = "0.78.0"
|
|
7
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
+
if version == '1000.0.0'
|
|
9
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
+
else
|
|
12
|
+
source[:tag] = "v#{version}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|
|
@@ -0,0 +1,172 @@
|
|
|
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.ReadableArray;
|
|
21
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
22
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
23
|
+
import javax.annotation.Nonnull;
|
|
24
|
+
|
|
25
|
+
public abstract class NativeRetenoSdkSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
26
|
+
public static final String NAME = "NativeRetenoSdk";
|
|
27
|
+
|
|
28
|
+
public NativeRetenoSdkSpec(ReactApplicationContext reactContext) {
|
|
29
|
+
super(reactContext);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
public @Nonnull String getName() {
|
|
34
|
+
return NAME;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
protected final void emitOnRetenoPushReceived(ReadableMap value) {
|
|
38
|
+
mEventEmitterCallback.invoke("onRetenoPushReceived", value);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
protected final void emitOnRetenoPushClicked(ReadableMap value) {
|
|
42
|
+
mEventEmitterCallback.invoke("onRetenoPushClicked", value);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
protected final void emitOnRetenoPushButtonClicked(ReadableMap value) {
|
|
46
|
+
mEventEmitterCallback.invoke("onRetenoPushButtonClicked", value);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected final void emitBeforeInAppDisplayHandler() {
|
|
50
|
+
mEventEmitterCallback.invoke("beforeInAppDisplayHandler");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
protected final void emitOnInAppDisplayHandler() {
|
|
54
|
+
mEventEmitterCallback.invoke("onInAppDisplayHandler");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
protected final void emitBeforeInAppCloseHandler() {
|
|
58
|
+
mEventEmitterCallback.invoke("beforeInAppCloseHandler");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
protected final void emitAfterInAppCloseHandler() {
|
|
62
|
+
mEventEmitterCallback.invoke("afterInAppCloseHandler");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
protected final void emitOnInAppErrorHandler(ReadableMap value) {
|
|
66
|
+
mEventEmitterCallback.invoke("onInAppErrorHandler", value);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
protected final void emitAddInAppMessageCustomDataHandler(ReadableMap value) {
|
|
70
|
+
mEventEmitterCallback.invoke("addInAppMessageCustomDataHandler", value);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
protected final void emitUnreadMessagesCountHandler(ReadableMap value) {
|
|
74
|
+
mEventEmitterCallback.invoke("unreadMessagesCountHandler", value);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
protected final void emitUnreadMessagesCountErrorHandler(ReadableMap value) {
|
|
78
|
+
mEventEmitterCallback.invoke("unreadMessagesCountErrorHandler", value);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@ReactMethod
|
|
82
|
+
@DoNotStrip
|
|
83
|
+
public abstract void logEvent(ReadableMap payload, Promise promise);
|
|
84
|
+
|
|
85
|
+
@ReactMethod
|
|
86
|
+
@DoNotStrip
|
|
87
|
+
public abstract void setDeviceToken(String deviceToken, Promise promise);
|
|
88
|
+
|
|
89
|
+
@ReactMethod
|
|
90
|
+
@DoNotStrip
|
|
91
|
+
public abstract void setUserAttributes(ReadableMap payload, Promise promise);
|
|
92
|
+
|
|
93
|
+
@ReactMethod
|
|
94
|
+
@DoNotStrip
|
|
95
|
+
public abstract void getInitialNotification(Promise promise);
|
|
96
|
+
|
|
97
|
+
@ReactMethod
|
|
98
|
+
@DoNotStrip
|
|
99
|
+
public abstract void registerForRemoteNotifications(Promise promise);
|
|
100
|
+
|
|
101
|
+
@ReactMethod
|
|
102
|
+
@DoNotStrip
|
|
103
|
+
public abstract void setAnonymousUserAttributes(ReadableMap payload, Promise promise);
|
|
104
|
+
|
|
105
|
+
@ReactMethod
|
|
106
|
+
@DoNotStrip
|
|
107
|
+
public abstract void pauseInAppMessages(boolean isPaused, Promise promise);
|
|
108
|
+
|
|
109
|
+
@ReactMethod
|
|
110
|
+
@DoNotStrip
|
|
111
|
+
public abstract void forcePushData(Promise promise);
|
|
112
|
+
|
|
113
|
+
@ReactMethod
|
|
114
|
+
@DoNotStrip
|
|
115
|
+
public abstract void updatePushPermissionStatusAndroid(Promise promise);
|
|
116
|
+
|
|
117
|
+
@ReactMethod
|
|
118
|
+
@DoNotStrip
|
|
119
|
+
public abstract void getRecommendations(ReadableMap payload, Promise promise);
|
|
120
|
+
|
|
121
|
+
@ReactMethod
|
|
122
|
+
@DoNotStrip
|
|
123
|
+
public abstract void logRecommendationEvent(ReadableMap payload, Promise promise);
|
|
124
|
+
|
|
125
|
+
@ReactMethod
|
|
126
|
+
@DoNotStrip
|
|
127
|
+
public abstract void getAppInboxMessages(ReadableMap payload, Promise promise);
|
|
128
|
+
|
|
129
|
+
@ReactMethod
|
|
130
|
+
@DoNotStrip
|
|
131
|
+
public abstract void markAsOpened(ReadableArray messageIds, Promise promise);
|
|
132
|
+
|
|
133
|
+
@ReactMethod
|
|
134
|
+
@DoNotStrip
|
|
135
|
+
public abstract void markAllAsOpened(Promise promise);
|
|
136
|
+
|
|
137
|
+
@ReactMethod
|
|
138
|
+
@DoNotStrip
|
|
139
|
+
public abstract void getAppInboxMessagesCount(Promise promise);
|
|
140
|
+
|
|
141
|
+
@ReactMethod
|
|
142
|
+
@DoNotStrip
|
|
143
|
+
public abstract void onUnreadMessagesCountChanged();
|
|
144
|
+
|
|
145
|
+
@ReactMethod
|
|
146
|
+
@DoNotStrip
|
|
147
|
+
public abstract void setInAppLifecycleCallback();
|
|
148
|
+
|
|
149
|
+
@ReactMethod
|
|
150
|
+
@DoNotStrip
|
|
151
|
+
public abstract void removeInAppLifecycleCallback();
|
|
152
|
+
|
|
153
|
+
@ReactMethod
|
|
154
|
+
@DoNotStrip
|
|
155
|
+
public abstract void unsubscribeMessagesCountChanged();
|
|
156
|
+
|
|
157
|
+
@ReactMethod
|
|
158
|
+
@DoNotStrip
|
|
159
|
+
public abstract void unsubscribeAllMessagesCountChanged();
|
|
160
|
+
|
|
161
|
+
@ReactMethod
|
|
162
|
+
@DoNotStrip
|
|
163
|
+
public abstract void addListener(String event);
|
|
164
|
+
|
|
165
|
+
@ReactMethod
|
|
166
|
+
@DoNotStrip
|
|
167
|
+
public abstract void removeListeners(double count);
|
|
168
|
+
|
|
169
|
+
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
170
|
+
@DoNotStrip
|
|
171
|
+
public abstract double getIsUSBBatteryCharge();
|
|
172
|
+
}
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
cmake_minimum_required(VERSION 3.13)
|
|
7
7
|
set(CMAKE_VERBOSE_MAKEFILE on)
|
|
8
8
|
|
|
9
|
-
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/
|
|
9
|
+
file(GLOB react_codegen_SRCS CONFIGURE_DEPENDS *.cpp react/renderer/components/NativeRetenoSdkSpec/*.cpp)
|
|
10
10
|
|
|
11
11
|
add_library(
|
|
12
|
-
|
|
12
|
+
react_codegen_NativeRetenoSdkSpec
|
|
13
13
|
OBJECT
|
|
14
14
|
${react_codegen_SRCS}
|
|
15
15
|
)
|
|
16
16
|
|
|
17
|
-
target_include_directories(
|
|
17
|
+
target_include_directories(react_codegen_NativeRetenoSdkSpec PUBLIC . react/renderer/components/NativeRetenoSdkSpec)
|
|
18
18
|
|
|
19
19
|
target_link_libraries(
|
|
20
|
-
|
|
20
|
+
react_codegen_NativeRetenoSdkSpec
|
|
21
21
|
fbjni
|
|
22
22
|
jsi
|
|
23
23
|
# We need to link different libraries based on whether we are building rncore or not, that's necessary
|
|
@@ -26,7 +26,7 @@ target_link_libraries(
|
|
|
26
26
|
)
|
|
27
27
|
|
|
28
28
|
target_compile_options(
|
|
29
|
-
|
|
29
|
+
react_codegen_NativeRetenoSdkSpec
|
|
30
30
|
PRIVATE
|
|
31
31
|
-DLOG_TAG=\"ReactNative\"
|
|
32
32
|
-fexceptions
|
|
@@ -0,0 +1,176 @@
|
|
|
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 "NativeRetenoSdkSpec.h"
|
|
12
|
+
|
|
13
|
+
namespace facebook::react {
|
|
14
|
+
|
|
15
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_logEvent(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, PromiseKind, "logEvent", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_setDeviceToken(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, "setDeviceToken", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_setUserAttributes(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, "setUserAttributes", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_getInitialNotification(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, "getInitialNotification", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_registerForRemoteNotifications(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, PromiseKind, "registerForRemoteNotifications", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_setAnonymousUserAttributes(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, PromiseKind, "setAnonymousUserAttributes", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_pauseInAppMessages(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, "pauseInAppMessages", "(ZLcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_forcePushData(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, "forcePushData", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_updatePushPermissionStatusAndroid(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, "updatePushPermissionStatusAndroid", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_getRecommendations(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, "getRecommendations", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_logRecommendationEvent(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, "logRecommendationEvent", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_getAppInboxMessages(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, "getAppInboxMessages", "(Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_markAsOpened(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, "markAsOpened", "(Lcom/facebook/react/bridge/ReadableArray;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_markAllAsOpened(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, "markAllAsOpened", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_getAppInboxMessagesCount(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, "getAppInboxMessagesCount", "(Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_onUnreadMessagesCountChanged(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, VoidKind, "onUnreadMessagesCountChanged", "()V", args, count, cachedMethodId);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_setInAppLifecycleCallback(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, VoidKind, "setInAppLifecycleCallback", "()V", args, count, cachedMethodId);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_removeInAppLifecycleCallback(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, VoidKind, "removeInAppLifecycleCallback", "()V", args, count, cachedMethodId);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_unsubscribeMessagesCountChanged(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, VoidKind, "unsubscribeMessagesCountChanged", "()V", args, count, cachedMethodId);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_unsubscribeAllMessagesCountChanged(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, VoidKind, "unsubscribeAllMessagesCountChanged", "()V", args, count, cachedMethodId);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_addListener(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, VoidKind, "addListener", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
121
|
+
static jmethodID cachedMethodId = nullptr;
|
|
122
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "removeListeners", "(D)V", args, count, cachedMethodId);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
static facebook::jsi::Value __hostFunction_NativeRetenoSdkSpecJSI_getIsUSBBatteryCharge(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
126
|
+
static jmethodID cachedMethodId = nullptr;
|
|
127
|
+
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, NumberKind, "getIsUSBBatteryCharge", "()D", args, count, cachedMethodId);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
NativeRetenoSdkSpecJSI::NativeRetenoSdkSpecJSI(const JavaTurboModule::InitParams ¶ms)
|
|
131
|
+
: JavaTurboModule(params) {
|
|
132
|
+
methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_logEvent};
|
|
133
|
+
methodMap_["setDeviceToken"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_setDeviceToken};
|
|
134
|
+
methodMap_["setUserAttributes"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_setUserAttributes};
|
|
135
|
+
methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_getInitialNotification};
|
|
136
|
+
methodMap_["registerForRemoteNotifications"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_registerForRemoteNotifications};
|
|
137
|
+
methodMap_["setAnonymousUserAttributes"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_setAnonymousUserAttributes};
|
|
138
|
+
methodMap_["pauseInAppMessages"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_pauseInAppMessages};
|
|
139
|
+
methodMap_["forcePushData"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_forcePushData};
|
|
140
|
+
methodMap_["updatePushPermissionStatusAndroid"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_updatePushPermissionStatusAndroid};
|
|
141
|
+
methodMap_["getRecommendations"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_getRecommendations};
|
|
142
|
+
methodMap_["logRecommendationEvent"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_logRecommendationEvent};
|
|
143
|
+
methodMap_["getAppInboxMessages"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_getAppInboxMessages};
|
|
144
|
+
methodMap_["markAsOpened"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_markAsOpened};
|
|
145
|
+
methodMap_["markAllAsOpened"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_markAllAsOpened};
|
|
146
|
+
methodMap_["getAppInboxMessagesCount"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_getAppInboxMessagesCount};
|
|
147
|
+
methodMap_["onUnreadMessagesCountChanged"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_onUnreadMessagesCountChanged};
|
|
148
|
+
methodMap_["setInAppLifecycleCallback"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_setInAppLifecycleCallback};
|
|
149
|
+
methodMap_["removeInAppLifecycleCallback"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_removeInAppLifecycleCallback};
|
|
150
|
+
methodMap_["unsubscribeMessagesCountChanged"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_unsubscribeMessagesCountChanged};
|
|
151
|
+
methodMap_["unsubscribeAllMessagesCountChanged"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_unsubscribeAllMessagesCountChanged};
|
|
152
|
+
methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_addListener};
|
|
153
|
+
methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkSpecJSI_removeListeners};
|
|
154
|
+
methodMap_["getIsUSBBatteryCharge"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkSpecJSI_getIsUSBBatteryCharge};
|
|
155
|
+
eventEmitterMap_["onRetenoPushReceived"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
156
|
+
eventEmitterMap_["onRetenoPushClicked"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
157
|
+
eventEmitterMap_["onRetenoPushButtonClicked"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
158
|
+
eventEmitterMap_["beforeInAppDisplayHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
159
|
+
eventEmitterMap_["onInAppDisplayHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
160
|
+
eventEmitterMap_["beforeInAppCloseHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
161
|
+
eventEmitterMap_["afterInAppCloseHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
162
|
+
eventEmitterMap_["onInAppErrorHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
163
|
+
eventEmitterMap_["addInAppMessageCustomDataHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
164
|
+
eventEmitterMap_["unreadMessagesCountHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
165
|
+
eventEmitterMap_["unreadMessagesCountErrorHandler"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
166
|
+
setEventEmitterCallback(params.instance);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
std::shared_ptr<TurboModule> NativeRetenoSdkSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms) {
|
|
170
|
+
if (moduleName == "NativeRetenoSdk") {
|
|
171
|
+
return std::make_shared<NativeRetenoSdkSpecJSI>(params);
|
|
172
|
+
}
|
|
173
|
+
return nullptr;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
} // 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 'NativeRetenoSdk'
|
|
21
|
+
*/
|
|
22
|
+
class JSI_EXPORT NativeRetenoSdkSpecJSI : public JavaTurboModule {
|
|
23
|
+
public:
|
|
24
|
+
NativeRetenoSdkSpecJSI(const JavaTurboModule::InitParams ¶ms);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
JSI_EXPORT
|
|
29
|
+
std::shared_ptr<TurboModule> NativeRetenoSdkSpec_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams ¶ms);
|
|
30
|
+
|
|
31
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,176 @@
|
|
|
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 "NativeRetenoSdkSpecJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_logEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->logEvent(
|
|
16
|
+
rt,
|
|
17
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_setDeviceToken(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
21
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->setDeviceToken(
|
|
22
|
+
rt,
|
|
23
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_setUserAttributes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
27
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->setUserAttributes(
|
|
28
|
+
rt,
|
|
29
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_getInitialNotification(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
33
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->getInitialNotification(
|
|
34
|
+
rt
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_registerForRemoteNotifications(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
38
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->registerForRemoteNotifications(
|
|
39
|
+
rt
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_setAnonymousUserAttributes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
43
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->setAnonymousUserAttributes(
|
|
44
|
+
rt,
|
|
45
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_pauseInAppMessages(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
49
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->pauseInAppMessages(
|
|
50
|
+
rt,
|
|
51
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_forcePushData(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
55
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->forcePushData(
|
|
56
|
+
rt
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_updatePushPermissionStatusAndroid(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
60
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->updatePushPermissionStatusAndroid(
|
|
61
|
+
rt
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_getRecommendations(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
65
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->getRecommendations(
|
|
66
|
+
rt,
|
|
67
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_logRecommendationEvent(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
71
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->logRecommendationEvent(
|
|
72
|
+
rt,
|
|
73
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_getAppInboxMessages(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
77
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->getAppInboxMessages(
|
|
78
|
+
rt,
|
|
79
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_markAsOpened(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
83
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->markAsOpened(
|
|
84
|
+
rt,
|
|
85
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_markAllAsOpened(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
89
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->markAllAsOpened(
|
|
90
|
+
rt
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_getAppInboxMessagesCount(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
94
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->getAppInboxMessagesCount(
|
|
95
|
+
rt
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_onUnreadMessagesCountChanged(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
99
|
+
static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->onUnreadMessagesCountChanged(
|
|
100
|
+
rt
|
|
101
|
+
);
|
|
102
|
+
return jsi::Value::undefined();
|
|
103
|
+
}
|
|
104
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_setInAppLifecycleCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
105
|
+
static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->setInAppLifecycleCallback(
|
|
106
|
+
rt
|
|
107
|
+
);
|
|
108
|
+
return jsi::Value::undefined();
|
|
109
|
+
}
|
|
110
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_removeInAppLifecycleCallback(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
111
|
+
static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->removeInAppLifecycleCallback(
|
|
112
|
+
rt
|
|
113
|
+
);
|
|
114
|
+
return jsi::Value::undefined();
|
|
115
|
+
}
|
|
116
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_unsubscribeMessagesCountChanged(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
117
|
+
static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->unsubscribeMessagesCountChanged(
|
|
118
|
+
rt
|
|
119
|
+
);
|
|
120
|
+
return jsi::Value::undefined();
|
|
121
|
+
}
|
|
122
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_unsubscribeAllMessagesCountChanged(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
123
|
+
static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->unsubscribeAllMessagesCountChanged(
|
|
124
|
+
rt
|
|
125
|
+
);
|
|
126
|
+
return jsi::Value::undefined();
|
|
127
|
+
}
|
|
128
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_addListener(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
129
|
+
static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->addListener(
|
|
130
|
+
rt,
|
|
131
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
132
|
+
);
|
|
133
|
+
return jsi::Value::undefined();
|
|
134
|
+
}
|
|
135
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_removeListeners(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
136
|
+
static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->removeListeners(
|
|
137
|
+
rt,
|
|
138
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber()
|
|
139
|
+
);
|
|
140
|
+
return jsi::Value::undefined();
|
|
141
|
+
}
|
|
142
|
+
static jsi::Value __hostFunction_NativeRetenoSdkCxxSpecJSI_getIsUSBBatteryCharge(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
143
|
+
return static_cast<NativeRetenoSdkCxxSpecJSI *>(&turboModule)->getIsUSBBatteryCharge(
|
|
144
|
+
rt
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
NativeRetenoSdkCxxSpecJSI::NativeRetenoSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
149
|
+
: TurboModule("NativeRetenoSdk", jsInvoker) {
|
|
150
|
+
methodMap_["logEvent"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_logEvent};
|
|
151
|
+
methodMap_["setDeviceToken"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_setDeviceToken};
|
|
152
|
+
methodMap_["setUserAttributes"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_setUserAttributes};
|
|
153
|
+
methodMap_["getInitialNotification"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_getInitialNotification};
|
|
154
|
+
methodMap_["registerForRemoteNotifications"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_registerForRemoteNotifications};
|
|
155
|
+
methodMap_["setAnonymousUserAttributes"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_setAnonymousUserAttributes};
|
|
156
|
+
methodMap_["pauseInAppMessages"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_pauseInAppMessages};
|
|
157
|
+
methodMap_["forcePushData"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_forcePushData};
|
|
158
|
+
methodMap_["updatePushPermissionStatusAndroid"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_updatePushPermissionStatusAndroid};
|
|
159
|
+
methodMap_["getRecommendations"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_getRecommendations};
|
|
160
|
+
methodMap_["logRecommendationEvent"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_logRecommendationEvent};
|
|
161
|
+
methodMap_["getAppInboxMessages"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_getAppInboxMessages};
|
|
162
|
+
methodMap_["markAsOpened"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_markAsOpened};
|
|
163
|
+
methodMap_["markAllAsOpened"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_markAllAsOpened};
|
|
164
|
+
methodMap_["getAppInboxMessagesCount"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_getAppInboxMessagesCount};
|
|
165
|
+
methodMap_["onUnreadMessagesCountChanged"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_onUnreadMessagesCountChanged};
|
|
166
|
+
methodMap_["setInAppLifecycleCallback"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_setInAppLifecycleCallback};
|
|
167
|
+
methodMap_["removeInAppLifecycleCallback"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_removeInAppLifecycleCallback};
|
|
168
|
+
methodMap_["unsubscribeMessagesCountChanged"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_unsubscribeMessagesCountChanged};
|
|
169
|
+
methodMap_["unsubscribeAllMessagesCountChanged"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_unsubscribeAllMessagesCountChanged};
|
|
170
|
+
methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_addListener};
|
|
171
|
+
methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeRetenoSdkCxxSpecJSI_removeListeners};
|
|
172
|
+
methodMap_["getIsUSBBatteryCharge"] = MethodMetadata {0, __hostFunction_NativeRetenoSdkCxxSpecJSI_getIsUSBBatteryCharge};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,343 @@
|
|
|
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 NativeRetenoSdkCxxSpecJSI : public TurboModule {
|
|
19
|
+
protected:
|
|
20
|
+
NativeRetenoSdkCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
virtual jsi::Value logEvent(jsi::Runtime &rt, jsi::Object payload) = 0;
|
|
24
|
+
virtual jsi::Value setDeviceToken(jsi::Runtime &rt, jsi::String deviceToken) = 0;
|
|
25
|
+
virtual jsi::Value setUserAttributes(jsi::Runtime &rt, jsi::Object payload) = 0;
|
|
26
|
+
virtual jsi::Value getInitialNotification(jsi::Runtime &rt) = 0;
|
|
27
|
+
virtual jsi::Value registerForRemoteNotifications(jsi::Runtime &rt) = 0;
|
|
28
|
+
virtual jsi::Value setAnonymousUserAttributes(jsi::Runtime &rt, jsi::Object payload) = 0;
|
|
29
|
+
virtual jsi::Value pauseInAppMessages(jsi::Runtime &rt, bool isPaused) = 0;
|
|
30
|
+
virtual jsi::Value forcePushData(jsi::Runtime &rt) = 0;
|
|
31
|
+
virtual jsi::Value updatePushPermissionStatusAndroid(jsi::Runtime &rt) = 0;
|
|
32
|
+
virtual jsi::Value getRecommendations(jsi::Runtime &rt, jsi::Object payload) = 0;
|
|
33
|
+
virtual jsi::Value logRecommendationEvent(jsi::Runtime &rt, jsi::Object payload) = 0;
|
|
34
|
+
virtual jsi::Value getAppInboxMessages(jsi::Runtime &rt, jsi::Object payload) = 0;
|
|
35
|
+
virtual jsi::Value markAsOpened(jsi::Runtime &rt, jsi::Array messageIds) = 0;
|
|
36
|
+
virtual jsi::Value markAllAsOpened(jsi::Runtime &rt) = 0;
|
|
37
|
+
virtual jsi::Value getAppInboxMessagesCount(jsi::Runtime &rt) = 0;
|
|
38
|
+
virtual void onUnreadMessagesCountChanged(jsi::Runtime &rt) = 0;
|
|
39
|
+
virtual void setInAppLifecycleCallback(jsi::Runtime &rt) = 0;
|
|
40
|
+
virtual void removeInAppLifecycleCallback(jsi::Runtime &rt) = 0;
|
|
41
|
+
virtual void unsubscribeMessagesCountChanged(jsi::Runtime &rt) = 0;
|
|
42
|
+
virtual void unsubscribeAllMessagesCountChanged(jsi::Runtime &rt) = 0;
|
|
43
|
+
virtual void addListener(jsi::Runtime &rt, jsi::String event) = 0;
|
|
44
|
+
virtual void removeListeners(jsi::Runtime &rt, double count) = 0;
|
|
45
|
+
virtual double getIsUSBBatteryCharge(jsi::Runtime &rt) = 0;
|
|
46
|
+
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
template <typename T>
|
|
50
|
+
class JSI_EXPORT NativeRetenoSdkCxxSpec : public TurboModule {
|
|
51
|
+
public:
|
|
52
|
+
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
53
|
+
return delegate_.create(rt, propName);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
57
|
+
return delegate_.getPropertyNames(runtime);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static constexpr std::string_view kModuleName = "NativeRetenoSdk";
|
|
61
|
+
|
|
62
|
+
protected:
|
|
63
|
+
NativeRetenoSdkCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
64
|
+
: TurboModule(std::string{NativeRetenoSdkCxxSpec::kModuleName}, jsInvoker),
|
|
65
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
66
|
+
|
|
67
|
+
template <typename OnRetenoPushReceivedType> void emitOnRetenoPushReceived(OnRetenoPushReceivedType value) {
|
|
68
|
+
static_assert(bridging::supportsFromJs<OnRetenoPushReceivedType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
69
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onRetenoPushReceived"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
70
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
template <typename OnRetenoPushClickedType> void emitOnRetenoPushClicked(OnRetenoPushClickedType value) {
|
|
75
|
+
static_assert(bridging::supportsFromJs<OnRetenoPushClickedType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
76
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onRetenoPushClicked"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
77
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
template <typename OnRetenoPushButtonClickedType> void emitOnRetenoPushButtonClicked(OnRetenoPushButtonClickedType value) {
|
|
82
|
+
static_assert(bridging::supportsFromJs<OnRetenoPushButtonClickedType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
83
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onRetenoPushButtonClicked"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
84
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
void emitBeforeInAppDisplayHandler() {
|
|
89
|
+
static_cast<AsyncEventEmitter<>&>(*delegate_.eventEmitterMap_["beforeInAppDisplayHandler"]).emit();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
void emitOnInAppDisplayHandler() {
|
|
93
|
+
static_cast<AsyncEventEmitter<>&>(*delegate_.eventEmitterMap_["onInAppDisplayHandler"]).emit();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
void emitBeforeInAppCloseHandler() {
|
|
97
|
+
static_cast<AsyncEventEmitter<>&>(*delegate_.eventEmitterMap_["beforeInAppCloseHandler"]).emit();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
void emitAfterInAppCloseHandler() {
|
|
101
|
+
static_cast<AsyncEventEmitter<>&>(*delegate_.eventEmitterMap_["afterInAppCloseHandler"]).emit();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
template <typename OnInAppErrorHandlerType> void emitOnInAppErrorHandler(OnInAppErrorHandlerType value) {
|
|
105
|
+
static_assert(bridging::supportsFromJs<OnInAppErrorHandlerType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
106
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["onInAppErrorHandler"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
107
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
template <typename AddInAppMessageCustomDataHandlerType> void emitAddInAppMessageCustomDataHandler(AddInAppMessageCustomDataHandlerType value) {
|
|
112
|
+
static_assert(bridging::supportsFromJs<AddInAppMessageCustomDataHandlerType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
113
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["addInAppMessageCustomDataHandler"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
114
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
template <typename UnreadMessagesCountHandlerType> void emitUnreadMessagesCountHandler(UnreadMessagesCountHandlerType value) {
|
|
119
|
+
static_assert(bridging::supportsFromJs<UnreadMessagesCountHandlerType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
120
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["unreadMessagesCountHandler"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
121
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
template <typename UnreadMessagesCountErrorHandlerType> void emitUnreadMessagesCountErrorHandler(UnreadMessagesCountErrorHandlerType value) {
|
|
126
|
+
static_assert(bridging::supportsFromJs<UnreadMessagesCountErrorHandlerType, jsi::Object>, "value cannnot be converted to jsi::Object");
|
|
127
|
+
static_cast<AsyncEventEmitter<jsi::Value>&>(*delegate_.eventEmitterMap_["unreadMessagesCountErrorHandler"]).emit([jsInvoker = jsInvoker_, eventValue = value](jsi::Runtime& rt) -> jsi::Value {
|
|
128
|
+
return bridging::toJs(rt, eventValue, jsInvoker);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private:
|
|
133
|
+
class Delegate : public NativeRetenoSdkCxxSpecJSI {
|
|
134
|
+
public:
|
|
135
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
136
|
+
NativeRetenoSdkCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
137
|
+
eventEmitterMap_["onRetenoPushReceived"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
138
|
+
eventEmitterMap_["onRetenoPushClicked"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
139
|
+
eventEmitterMap_["onRetenoPushButtonClicked"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
140
|
+
eventEmitterMap_["beforeInAppDisplayHandler"] = std::make_shared<AsyncEventEmitter<>>();
|
|
141
|
+
eventEmitterMap_["onInAppDisplayHandler"] = std::make_shared<AsyncEventEmitter<>>();
|
|
142
|
+
eventEmitterMap_["beforeInAppCloseHandler"] = std::make_shared<AsyncEventEmitter<>>();
|
|
143
|
+
eventEmitterMap_["afterInAppCloseHandler"] = std::make_shared<AsyncEventEmitter<>>();
|
|
144
|
+
eventEmitterMap_["onInAppErrorHandler"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
145
|
+
eventEmitterMap_["addInAppMessageCustomDataHandler"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
146
|
+
eventEmitterMap_["unreadMessagesCountHandler"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
147
|
+
eventEmitterMap_["unreadMessagesCountErrorHandler"] = std::make_shared<AsyncEventEmitter<jsi::Value>>();
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
jsi::Value logEvent(jsi::Runtime &rt, jsi::Object payload) override {
|
|
151
|
+
static_assert(
|
|
152
|
+
bridging::getParameterCount(&T::logEvent) == 2,
|
|
153
|
+
"Expected logEvent(...) to have 2 parameters");
|
|
154
|
+
|
|
155
|
+
return bridging::callFromJs<jsi::Value>(
|
|
156
|
+
rt, &T::logEvent, jsInvoker_, instance_, std::move(payload));
|
|
157
|
+
}
|
|
158
|
+
jsi::Value setDeviceToken(jsi::Runtime &rt, jsi::String deviceToken) override {
|
|
159
|
+
static_assert(
|
|
160
|
+
bridging::getParameterCount(&T::setDeviceToken) == 2,
|
|
161
|
+
"Expected setDeviceToken(...) to have 2 parameters");
|
|
162
|
+
|
|
163
|
+
return bridging::callFromJs<jsi::Value>(
|
|
164
|
+
rt, &T::setDeviceToken, jsInvoker_, instance_, std::move(deviceToken));
|
|
165
|
+
}
|
|
166
|
+
jsi::Value setUserAttributes(jsi::Runtime &rt, jsi::Object payload) override {
|
|
167
|
+
static_assert(
|
|
168
|
+
bridging::getParameterCount(&T::setUserAttributes) == 2,
|
|
169
|
+
"Expected setUserAttributes(...) to have 2 parameters");
|
|
170
|
+
|
|
171
|
+
return bridging::callFromJs<jsi::Value>(
|
|
172
|
+
rt, &T::setUserAttributes, jsInvoker_, instance_, std::move(payload));
|
|
173
|
+
}
|
|
174
|
+
jsi::Value getInitialNotification(jsi::Runtime &rt) override {
|
|
175
|
+
static_assert(
|
|
176
|
+
bridging::getParameterCount(&T::getInitialNotification) == 1,
|
|
177
|
+
"Expected getInitialNotification(...) to have 1 parameters");
|
|
178
|
+
|
|
179
|
+
return bridging::callFromJs<jsi::Value>(
|
|
180
|
+
rt, &T::getInitialNotification, jsInvoker_, instance_);
|
|
181
|
+
}
|
|
182
|
+
jsi::Value registerForRemoteNotifications(jsi::Runtime &rt) override {
|
|
183
|
+
static_assert(
|
|
184
|
+
bridging::getParameterCount(&T::registerForRemoteNotifications) == 1,
|
|
185
|
+
"Expected registerForRemoteNotifications(...) to have 1 parameters");
|
|
186
|
+
|
|
187
|
+
return bridging::callFromJs<jsi::Value>(
|
|
188
|
+
rt, &T::registerForRemoteNotifications, jsInvoker_, instance_);
|
|
189
|
+
}
|
|
190
|
+
jsi::Value setAnonymousUserAttributes(jsi::Runtime &rt, jsi::Object payload) override {
|
|
191
|
+
static_assert(
|
|
192
|
+
bridging::getParameterCount(&T::setAnonymousUserAttributes) == 2,
|
|
193
|
+
"Expected setAnonymousUserAttributes(...) to have 2 parameters");
|
|
194
|
+
|
|
195
|
+
return bridging::callFromJs<jsi::Value>(
|
|
196
|
+
rt, &T::setAnonymousUserAttributes, jsInvoker_, instance_, std::move(payload));
|
|
197
|
+
}
|
|
198
|
+
jsi::Value pauseInAppMessages(jsi::Runtime &rt, bool isPaused) override {
|
|
199
|
+
static_assert(
|
|
200
|
+
bridging::getParameterCount(&T::pauseInAppMessages) == 2,
|
|
201
|
+
"Expected pauseInAppMessages(...) to have 2 parameters");
|
|
202
|
+
|
|
203
|
+
return bridging::callFromJs<jsi::Value>(
|
|
204
|
+
rt, &T::pauseInAppMessages, jsInvoker_, instance_, std::move(isPaused));
|
|
205
|
+
}
|
|
206
|
+
jsi::Value forcePushData(jsi::Runtime &rt) override {
|
|
207
|
+
static_assert(
|
|
208
|
+
bridging::getParameterCount(&T::forcePushData) == 1,
|
|
209
|
+
"Expected forcePushData(...) to have 1 parameters");
|
|
210
|
+
|
|
211
|
+
return bridging::callFromJs<jsi::Value>(
|
|
212
|
+
rt, &T::forcePushData, jsInvoker_, instance_);
|
|
213
|
+
}
|
|
214
|
+
jsi::Value updatePushPermissionStatusAndroid(jsi::Runtime &rt) override {
|
|
215
|
+
static_assert(
|
|
216
|
+
bridging::getParameterCount(&T::updatePushPermissionStatusAndroid) == 1,
|
|
217
|
+
"Expected updatePushPermissionStatusAndroid(...) to have 1 parameters");
|
|
218
|
+
|
|
219
|
+
return bridging::callFromJs<jsi::Value>(
|
|
220
|
+
rt, &T::updatePushPermissionStatusAndroid, jsInvoker_, instance_);
|
|
221
|
+
}
|
|
222
|
+
jsi::Value getRecommendations(jsi::Runtime &rt, jsi::Object payload) override {
|
|
223
|
+
static_assert(
|
|
224
|
+
bridging::getParameterCount(&T::getRecommendations) == 2,
|
|
225
|
+
"Expected getRecommendations(...) to have 2 parameters");
|
|
226
|
+
|
|
227
|
+
return bridging::callFromJs<jsi::Value>(
|
|
228
|
+
rt, &T::getRecommendations, jsInvoker_, instance_, std::move(payload));
|
|
229
|
+
}
|
|
230
|
+
jsi::Value logRecommendationEvent(jsi::Runtime &rt, jsi::Object payload) override {
|
|
231
|
+
static_assert(
|
|
232
|
+
bridging::getParameterCount(&T::logRecommendationEvent) == 2,
|
|
233
|
+
"Expected logRecommendationEvent(...) to have 2 parameters");
|
|
234
|
+
|
|
235
|
+
return bridging::callFromJs<jsi::Value>(
|
|
236
|
+
rt, &T::logRecommendationEvent, jsInvoker_, instance_, std::move(payload));
|
|
237
|
+
}
|
|
238
|
+
jsi::Value getAppInboxMessages(jsi::Runtime &rt, jsi::Object payload) override {
|
|
239
|
+
static_assert(
|
|
240
|
+
bridging::getParameterCount(&T::getAppInboxMessages) == 2,
|
|
241
|
+
"Expected getAppInboxMessages(...) to have 2 parameters");
|
|
242
|
+
|
|
243
|
+
return bridging::callFromJs<jsi::Value>(
|
|
244
|
+
rt, &T::getAppInboxMessages, jsInvoker_, instance_, std::move(payload));
|
|
245
|
+
}
|
|
246
|
+
jsi::Value markAsOpened(jsi::Runtime &rt, jsi::Array messageIds) override {
|
|
247
|
+
static_assert(
|
|
248
|
+
bridging::getParameterCount(&T::markAsOpened) == 2,
|
|
249
|
+
"Expected markAsOpened(...) to have 2 parameters");
|
|
250
|
+
|
|
251
|
+
return bridging::callFromJs<jsi::Value>(
|
|
252
|
+
rt, &T::markAsOpened, jsInvoker_, instance_, std::move(messageIds));
|
|
253
|
+
}
|
|
254
|
+
jsi::Value markAllAsOpened(jsi::Runtime &rt) override {
|
|
255
|
+
static_assert(
|
|
256
|
+
bridging::getParameterCount(&T::markAllAsOpened) == 1,
|
|
257
|
+
"Expected markAllAsOpened(...) to have 1 parameters");
|
|
258
|
+
|
|
259
|
+
return bridging::callFromJs<jsi::Value>(
|
|
260
|
+
rt, &T::markAllAsOpened, jsInvoker_, instance_);
|
|
261
|
+
}
|
|
262
|
+
jsi::Value getAppInboxMessagesCount(jsi::Runtime &rt) override {
|
|
263
|
+
static_assert(
|
|
264
|
+
bridging::getParameterCount(&T::getAppInboxMessagesCount) == 1,
|
|
265
|
+
"Expected getAppInboxMessagesCount(...) to have 1 parameters");
|
|
266
|
+
|
|
267
|
+
return bridging::callFromJs<jsi::Value>(
|
|
268
|
+
rt, &T::getAppInboxMessagesCount, jsInvoker_, instance_);
|
|
269
|
+
}
|
|
270
|
+
void onUnreadMessagesCountChanged(jsi::Runtime &rt) override {
|
|
271
|
+
static_assert(
|
|
272
|
+
bridging::getParameterCount(&T::onUnreadMessagesCountChanged) == 1,
|
|
273
|
+
"Expected onUnreadMessagesCountChanged(...) to have 1 parameters");
|
|
274
|
+
|
|
275
|
+
return bridging::callFromJs<void>(
|
|
276
|
+
rt, &T::onUnreadMessagesCountChanged, jsInvoker_, instance_);
|
|
277
|
+
}
|
|
278
|
+
void setInAppLifecycleCallback(jsi::Runtime &rt) override {
|
|
279
|
+
static_assert(
|
|
280
|
+
bridging::getParameterCount(&T::setInAppLifecycleCallback) == 1,
|
|
281
|
+
"Expected setInAppLifecycleCallback(...) to have 1 parameters");
|
|
282
|
+
|
|
283
|
+
return bridging::callFromJs<void>(
|
|
284
|
+
rt, &T::setInAppLifecycleCallback, jsInvoker_, instance_);
|
|
285
|
+
}
|
|
286
|
+
void removeInAppLifecycleCallback(jsi::Runtime &rt) override {
|
|
287
|
+
static_assert(
|
|
288
|
+
bridging::getParameterCount(&T::removeInAppLifecycleCallback) == 1,
|
|
289
|
+
"Expected removeInAppLifecycleCallback(...) to have 1 parameters");
|
|
290
|
+
|
|
291
|
+
return bridging::callFromJs<void>(
|
|
292
|
+
rt, &T::removeInAppLifecycleCallback, jsInvoker_, instance_);
|
|
293
|
+
}
|
|
294
|
+
void unsubscribeMessagesCountChanged(jsi::Runtime &rt) override {
|
|
295
|
+
static_assert(
|
|
296
|
+
bridging::getParameterCount(&T::unsubscribeMessagesCountChanged) == 1,
|
|
297
|
+
"Expected unsubscribeMessagesCountChanged(...) to have 1 parameters");
|
|
298
|
+
|
|
299
|
+
return bridging::callFromJs<void>(
|
|
300
|
+
rt, &T::unsubscribeMessagesCountChanged, jsInvoker_, instance_);
|
|
301
|
+
}
|
|
302
|
+
void unsubscribeAllMessagesCountChanged(jsi::Runtime &rt) override {
|
|
303
|
+
static_assert(
|
|
304
|
+
bridging::getParameterCount(&T::unsubscribeAllMessagesCountChanged) == 1,
|
|
305
|
+
"Expected unsubscribeAllMessagesCountChanged(...) to have 1 parameters");
|
|
306
|
+
|
|
307
|
+
return bridging::callFromJs<void>(
|
|
308
|
+
rt, &T::unsubscribeAllMessagesCountChanged, jsInvoker_, instance_);
|
|
309
|
+
}
|
|
310
|
+
void addListener(jsi::Runtime &rt, jsi::String event) override {
|
|
311
|
+
static_assert(
|
|
312
|
+
bridging::getParameterCount(&T::addListener) == 2,
|
|
313
|
+
"Expected addListener(...) to have 2 parameters");
|
|
314
|
+
|
|
315
|
+
return bridging::callFromJs<void>(
|
|
316
|
+
rt, &T::addListener, jsInvoker_, instance_, std::move(event));
|
|
317
|
+
}
|
|
318
|
+
void removeListeners(jsi::Runtime &rt, double count) override {
|
|
319
|
+
static_assert(
|
|
320
|
+
bridging::getParameterCount(&T::removeListeners) == 2,
|
|
321
|
+
"Expected removeListeners(...) to have 2 parameters");
|
|
322
|
+
|
|
323
|
+
return bridging::callFromJs<void>(
|
|
324
|
+
rt, &T::removeListeners, jsInvoker_, instance_, std::move(count));
|
|
325
|
+
}
|
|
326
|
+
double getIsUSBBatteryCharge(jsi::Runtime &rt) override {
|
|
327
|
+
static_assert(
|
|
328
|
+
bridging::getParameterCount(&T::getIsUSBBatteryCharge) == 1,
|
|
329
|
+
"Expected getIsUSBBatteryCharge(...) to have 1 parameters");
|
|
330
|
+
|
|
331
|
+
return bridging::callFromJs<double>(
|
|
332
|
+
rt, &T::getIsUSBBatteryCharge, jsInvoker_, instance_);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
private:
|
|
336
|
+
friend class NativeRetenoSdkCxxSpec;
|
|
337
|
+
T *instance_;
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
Delegate delegate_;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
} // namespace facebook::react
|
package/android/build.gradle
CHANGED
|
@@ -72,7 +72,7 @@ dependencies {
|
|
|
72
72
|
//noinspection GradleDynamicVersion
|
|
73
73
|
implementation "com.facebook.react:react-native"
|
|
74
74
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
75
|
-
implementation 'com.reteno:fcm:2.0.
|
|
75
|
+
implementation 'com.reteno:fcm:2.0.20'
|
|
76
76
|
implementation "com.google.firebase:firebase-messaging:23.1.0"
|
|
77
77
|
implementation "com.google.firebase:firebase-messaging-ktx:23.1.0"
|
|
78
78
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reteno-react-native-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "The Reteno React Native SDK for App Analytics and Engagement.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@react-native-community/eslint-config": "^3.0.2",
|
|
66
66
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
67
67
|
"@types/jest": "^28.1.2",
|
|
68
|
-
"@types/react": "
|
|
68
|
+
"@types/react": "^19.0.0",
|
|
69
69
|
"@types/react-native": "0.70.0",
|
|
70
70
|
"commitlint": "^17.0.2",
|
|
71
71
|
"del-cli": "^5.0.0",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"metro-react-native-babel-preset": "^0.77.0",
|
|
77
77
|
"pod-install": "^0.1.0",
|
|
78
78
|
"prettier": "^2.0.5",
|
|
79
|
-
"react": "
|
|
80
|
-
"react-native": "0.
|
|
79
|
+
"react": "19.0.0",
|
|
80
|
+
"react-native": "0.78.0",
|
|
81
81
|
"react-native-builder-bob": "^0.20.0",
|
|
82
82
|
"release-it": "^15.11.0",
|
|
83
83
|
"typescript": "^4.5.2"
|
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency 'React-Core'
|
|
20
|
-
s.dependency 'Reteno', '2.0.
|
|
20
|
+
s.dependency 'Reteno', '2.0.23'
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|