@amplytools/react-native-amply-sdk 0.2.4 → 0.2.5
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/build.gradle +1 -1
- package/android/src/main/java/tools/amply/sdk/reactnative/core/DefaultAmplyClient.kt +55 -14
- package/android/src/newarch/java/tools/amply/sdk/reactnative/NativeAmplyModuleSpec.java +2 -1
- package/android/src/newarch/jni/AmplyReactNative-generated.cpp +24 -0
- package/ios/AmplyReactNative.podspec +1 -1
- package/ios/Sources/AmplyReactNative/AmplyModule.mm +47 -22
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative/AmplyReactNative-generated.mm +160 -0
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative/AmplyReactNative.h +173 -0
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative-generated.mm +36 -8
- package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative.h +6 -0
- package/package.json +1 -1
package/android/build.gradle
CHANGED
|
@@ -15,7 +15,7 @@ buildscript {
|
|
|
15
15
|
apply plugin: 'com.android.library'
|
|
16
16
|
apply plugin: 'org.jetbrains.kotlin.android'
|
|
17
17
|
|
|
18
|
-
def amplySdkVersion = project.findProperty('amplySdkVersion') ?: System.getenv('AMPLY_SDK_VERSION') ?: '0.2.
|
|
18
|
+
def amplySdkVersion = project.findProperty('amplySdkVersion') ?: System.getenv('AMPLY_SDK_VERSION') ?: '0.2.4'
|
|
19
19
|
group = 'tools.amply'
|
|
20
20
|
version = amplySdkVersion
|
|
21
21
|
|
|
@@ -36,7 +36,9 @@ class DefaultAmplyClient(
|
|
|
36
36
|
) : AmplyClient {
|
|
37
37
|
|
|
38
38
|
private val mutex = Mutex()
|
|
39
|
-
private var amplyInstance: Amply? = null
|
|
39
|
+
@Volatile private var amplyInstance: Amply? = null
|
|
40
|
+
private val propertyLock = Any()
|
|
41
|
+
private val pendingPropertyOps = mutableListOf<(Amply) -> Unit>()
|
|
40
42
|
private val deepLinkRegistered = AtomicBoolean(false)
|
|
41
43
|
private val systemEventsRegistered = AtomicBoolean(false)
|
|
42
44
|
private val deepLinkSequence = AtomicLong(0L)
|
|
@@ -100,7 +102,17 @@ class DefaultAmplyClient(
|
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
ensureSystemEventsListener(instance)
|
|
103
|
-
|
|
105
|
+
|
|
106
|
+
// Drain buffered property operations under propertyLock
|
|
107
|
+
synchronized(propertyLock) {
|
|
108
|
+
amplyInstance = instance
|
|
109
|
+
if (pendingPropertyOps.isNotEmpty()) {
|
|
110
|
+
android.util.Log.i("AmplyReactNative", "Draining ${pendingPropertyOps.size} buffered property operations")
|
|
111
|
+
pendingPropertyOps.forEach { op -> op(instance) }
|
|
112
|
+
pendingPropertyOps.clear()
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
104
116
|
createdInstance = true
|
|
105
117
|
}
|
|
106
118
|
}
|
|
@@ -218,27 +230,56 @@ class DefaultAmplyClient(
|
|
|
218
230
|
}
|
|
219
231
|
|
|
220
232
|
override fun setCustomProperty(key: String, value: Any) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
233
|
+
synchronized(propertyLock) {
|
|
234
|
+
val instance = amplyInstance
|
|
235
|
+
if (instance != null) {
|
|
236
|
+
instance.setCustomProperty(key, value)
|
|
237
|
+
android.util.Log.i("AmplyReactNative", "Custom property set: $key")
|
|
238
|
+
} else {
|
|
239
|
+
android.util.Log.i("AmplyReactNative", "Buffering setCustomProperty until init: $key")
|
|
240
|
+
pendingPropertyOps.add { it.setCustomProperty(key, value) }
|
|
241
|
+
}
|
|
242
|
+
}
|
|
224
243
|
}
|
|
225
244
|
|
|
226
245
|
override fun setCustomProperties(properties: Map<String, Any?>) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
246
|
+
synchronized(propertyLock) {
|
|
247
|
+
val instance = amplyInstance
|
|
248
|
+
if (instance != null) {
|
|
249
|
+
instance.setCustomProperties(properties.toNonNullMap())
|
|
250
|
+
android.util.Log.i("AmplyReactNative", "Custom properties set: ${properties.keys}")
|
|
251
|
+
} else {
|
|
252
|
+
android.util.Log.i("AmplyReactNative", "Buffering setCustomProperties until init: ${properties.keys}")
|
|
253
|
+
val snapshot = properties.toNonNullMap()
|
|
254
|
+
pendingPropertyOps.add { it.setCustomProperties(snapshot) }
|
|
255
|
+
}
|
|
256
|
+
}
|
|
230
257
|
}
|
|
231
258
|
|
|
232
259
|
override fun removeCustomProperty(key: String) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
260
|
+
synchronized(propertyLock) {
|
|
261
|
+
val instance = amplyInstance
|
|
262
|
+
if (instance != null) {
|
|
263
|
+
instance.removeCustomProperty(key)
|
|
264
|
+
android.util.Log.i("AmplyReactNative", "Custom property removed: $key")
|
|
265
|
+
} else {
|
|
266
|
+
android.util.Log.i("AmplyReactNative", "Buffering removeCustomProperty until init: $key")
|
|
267
|
+
pendingPropertyOps.add { it.removeCustomProperty(key) }
|
|
268
|
+
}
|
|
269
|
+
}
|
|
236
270
|
}
|
|
237
271
|
|
|
238
272
|
override fun clearCustomProperties() {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
273
|
+
synchronized(propertyLock) {
|
|
274
|
+
val instance = amplyInstance
|
|
275
|
+
if (instance != null) {
|
|
276
|
+
instance.clearCustomProperties()
|
|
277
|
+
android.util.Log.i("AmplyReactNative", "All custom properties cleared")
|
|
278
|
+
} else {
|
|
279
|
+
android.util.Log.i("AmplyReactNative", "Buffering clearCustomProperties until init")
|
|
280
|
+
pendingPropertyOps.add { it.clearCustomProperties() }
|
|
281
|
+
}
|
|
282
|
+
}
|
|
242
283
|
}
|
|
243
284
|
|
|
244
285
|
override suspend fun getCustomProperty(key: String): Any? {
|
|
@@ -20,6 +20,7 @@ import com.facebook.react.bridge.ReactMethod;
|
|
|
20
20
|
import com.facebook.react.bridge.ReadableMap;
|
|
21
21
|
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
22
22
|
import javax.annotation.Nonnull;
|
|
23
|
+
import javax.annotation.Nullable;
|
|
23
24
|
|
|
24
25
|
public abstract class NativeAmplyModuleSpec extends ReactContextBaseJavaModule implements TurboModule {
|
|
25
26
|
public static final String NAME = "Amply";
|
|
@@ -67,7 +68,7 @@ public abstract class NativeAmplyModuleSpec extends ReactContextBaseJavaModule i
|
|
|
67
68
|
|
|
68
69
|
@ReactMethod
|
|
69
70
|
@DoNotStrip
|
|
70
|
-
public abstract void setUserId(String userId);
|
|
71
|
+
public abstract void setUserId(@Nullable String userId);
|
|
71
72
|
|
|
72
73
|
@ReactMethod
|
|
73
74
|
@DoNotStrip
|
|
@@ -57,6 +57,26 @@ static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_getLogLevel(
|
|
|
57
57
|
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, StringKind, "getLogLevel", "()Ljava/lang/String;", args, count, cachedMethodId);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setCustomProperties(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, VoidKind, "setCustomProperties", "(Lcom/facebook/react/bridge/ReadableMap;)V", args, count, cachedMethodId);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_getCustomProperty(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, "getCustomProperty", "(Ljava/lang/String;Lcom/facebook/react/bridge/Promise;)V", args, count, cachedMethodId);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_removeCustomProperty(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, VoidKind, "removeCustomProperty", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_clearCustomProperties(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, VoidKind, "clearCustomProperties", "()V", args, count, cachedMethodId);
|
|
78
|
+
}
|
|
79
|
+
|
|
60
80
|
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
61
81
|
static jmethodID cachedMethodId = nullptr;
|
|
62
82
|
return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "addListener", "(Ljava/lang/String;)V", args, count, cachedMethodId);
|
|
@@ -78,6 +98,10 @@ NativeAmplyModuleSpecJSI::NativeAmplyModuleSpecJSI(const JavaTurboModule::InitPa
|
|
|
78
98
|
methodMap_["setUserId"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setUserId};
|
|
79
99
|
methodMap_["setLogLevel"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setLogLevel};
|
|
80
100
|
methodMap_["getLogLevel"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_getLogLevel};
|
|
101
|
+
methodMap_["setCustomProperties"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setCustomProperties};
|
|
102
|
+
methodMap_["getCustomProperty"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_getCustomProperty};
|
|
103
|
+
methodMap_["removeCustomProperty"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_removeCustomProperty};
|
|
104
|
+
methodMap_["clearCustomProperties"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_clearCustomProperties};
|
|
81
105
|
methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_addListener};
|
|
82
106
|
methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_removeListeners};
|
|
83
107
|
eventEmitterMap_["onSystemEvent"] = std::make_shared<AsyncEventEmitter<folly::dynamic>>();
|
|
@@ -51,6 +51,7 @@ static NSString* AmplyLogLevelToString(AmplyLogLevel level) {
|
|
|
51
51
|
@property (nonatomic, assign) BOOL lifecycleObserversRegistered;
|
|
52
52
|
@property (nonatomic, assign) BOOL logListenerRegistered;
|
|
53
53
|
@property (nonatomic, assign) AmplyLogLevel currentLogLevel;
|
|
54
|
+
@property (nonatomic, strong) NSMutableArray<void (^)(ASDKAmply *)> *pendingPropertyOps;
|
|
54
55
|
@end
|
|
55
56
|
|
|
56
57
|
@implementation Amply
|
|
@@ -137,6 +138,15 @@ RCT_EXPORT_MODULE()
|
|
|
137
138
|
// Register for app lifecycle notifications to manage session state
|
|
138
139
|
[self registerLifecycleObservers];
|
|
139
140
|
|
|
141
|
+
// Drain buffered property operations
|
|
142
|
+
if (self.pendingPropertyOps.count > 0) {
|
|
143
|
+
RCTLogInfo(@"[AmplyReactNative] Draining %lu buffered property operations", (unsigned long)self.pendingPropertyOps.count);
|
|
144
|
+
for (void (^op)(ASDKAmply *) in self.pendingPropertyOps) {
|
|
145
|
+
op(self.amplyInstance);
|
|
146
|
+
}
|
|
147
|
+
[self.pendingPropertyOps removeAllObjects];
|
|
148
|
+
}
|
|
149
|
+
|
|
140
150
|
RCTLogInfo(@"[AmplyReactNative] Initialized with appId=%@", appId);
|
|
141
151
|
|
|
142
152
|
if (resolve) {
|
|
@@ -385,18 +395,23 @@ RCT_EXPORT_MODULE()
|
|
|
385
395
|
|
|
386
396
|
- (void)setCustomProperties:(NSDictionary *)properties
|
|
387
397
|
{
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
id value = properties[key];
|
|
395
|
-
if (value && ![value isKindOfClass:[NSNull class]]) {
|
|
396
|
-
[self.amplyInstance setCustomPropertyKey:key value:value];
|
|
398
|
+
void (^apply)(ASDKAmply *) = ^(ASDKAmply *instance) {
|
|
399
|
+
for (NSString *key in properties) {
|
|
400
|
+
id value = properties[key];
|
|
401
|
+
if (value && ![value isKindOfClass:[NSNull class]]) {
|
|
402
|
+
[instance setCustomPropertyKey:key value:value];
|
|
403
|
+
}
|
|
397
404
|
}
|
|
405
|
+
RCTLogInfo(@"[AmplyReactNative] Custom properties set: %@", [properties allKeys]);
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
if (self.amplyInstance) {
|
|
409
|
+
apply(self.amplyInstance);
|
|
410
|
+
} else {
|
|
411
|
+
RCTLogInfo(@"[AmplyReactNative] Buffering setCustomProperties until init: %@", [properties allKeys]);
|
|
412
|
+
if (!self.pendingPropertyOps) self.pendingPropertyOps = [NSMutableArray new];
|
|
413
|
+
[self.pendingPropertyOps addObject:apply];
|
|
398
414
|
}
|
|
399
|
-
RCTLogInfo(@"[AmplyReactNative] Custom properties set: %@", [properties allKeys]);
|
|
400
415
|
}
|
|
401
416
|
|
|
402
417
|
- (void)getCustomProperty:(NSString *)key
|
|
@@ -431,24 +446,34 @@ RCT_EXPORT_MODULE()
|
|
|
431
446
|
|
|
432
447
|
- (void)removeCustomProperty:(NSString *)key
|
|
433
448
|
{
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}
|
|
449
|
+
void (^apply)(ASDKAmply *) = ^(ASDKAmply *instance) {
|
|
450
|
+
[instance removeCustomPropertyKey:key];
|
|
451
|
+
RCTLogInfo(@"[AmplyReactNative] Custom property removed: %@", key);
|
|
452
|
+
};
|
|
438
453
|
|
|
439
|
-
|
|
440
|
-
|
|
454
|
+
if (self.amplyInstance) {
|
|
455
|
+
apply(self.amplyInstance);
|
|
456
|
+
} else {
|
|
457
|
+
RCTLogInfo(@"[AmplyReactNative] Buffering removeCustomProperty until init: %@", key);
|
|
458
|
+
if (!self.pendingPropertyOps) self.pendingPropertyOps = [NSMutableArray new];
|
|
459
|
+
[self.pendingPropertyOps addObject:apply];
|
|
460
|
+
}
|
|
441
461
|
}
|
|
442
462
|
|
|
443
463
|
- (void)clearCustomProperties
|
|
444
464
|
{
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
465
|
+
void (^apply)(ASDKAmply *) = ^(ASDKAmply *instance) {
|
|
466
|
+
[instance clearCustomProperties];
|
|
467
|
+
RCTLogInfo(@"[AmplyReactNative] All custom properties cleared");
|
|
468
|
+
};
|
|
449
469
|
|
|
450
|
-
|
|
451
|
-
|
|
470
|
+
if (self.amplyInstance) {
|
|
471
|
+
apply(self.amplyInstance);
|
|
472
|
+
} else {
|
|
473
|
+
RCTLogInfo(@"[AmplyReactNative] Buffering clearCustomProperties until init");
|
|
474
|
+
if (!self.pendingPropertyOps) self.pendingPropertyOps = [NSMutableArray new];
|
|
475
|
+
[self.pendingPropertyOps addObject:apply];
|
|
476
|
+
}
|
|
452
477
|
}
|
|
453
478
|
|
|
454
479
|
- (void)addListener:(NSString *)eventName
|
package/ios/Sources/AmplyReactNative/AmplyReactNative/AmplyReactNative/AmplyReactNative-generated.mm
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
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: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#import "AmplyReactNative.h"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@implementation NativeAmplyModuleSpecBase
|
|
18
|
+
- (void)emitOnSystemEvent:(NSDictionary *)value
|
|
19
|
+
{
|
|
20
|
+
_eventEmitterCallback("onSystemEvent", value);
|
|
21
|
+
}
|
|
22
|
+
- (void)emitOnDeepLink:(NSDictionary *)value
|
|
23
|
+
{
|
|
24
|
+
_eventEmitterCallback("onDeepLink", value);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper
|
|
28
|
+
{
|
|
29
|
+
_eventEmitterCallback = std::move(eventEmitterCallbackWrapper->_eventEmitterCallback);
|
|
30
|
+
}
|
|
31
|
+
@end
|
|
32
|
+
|
|
33
|
+
@implementation RCTCxxConvert (NativeAmplyModule_AmplyInitializationConfig)
|
|
34
|
+
+ (RCTManagedPointer *)JS_NativeAmplyModule_AmplyInitializationConfig:(id)json
|
|
35
|
+
{
|
|
36
|
+
return facebook::react::managedPointer<JS::NativeAmplyModule::AmplyInitializationConfig>(json);
|
|
37
|
+
}
|
|
38
|
+
@end
|
|
39
|
+
@implementation RCTCxxConvert (NativeAmplyModule_TrackEventPayload)
|
|
40
|
+
+ (RCTManagedPointer *)JS_NativeAmplyModule_TrackEventPayload:(id)json
|
|
41
|
+
{
|
|
42
|
+
return facebook::react::managedPointer<JS::NativeAmplyModule::TrackEventPayload>(json);
|
|
43
|
+
}
|
|
44
|
+
@end
|
|
45
|
+
namespace facebook::react {
|
|
46
|
+
|
|
47
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_initialize(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
48
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "initialize", @selector(initialize:resolve:reject:), args, count);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_isInitialized(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
52
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, BooleanKind, "isInitialized", @selector(isInitialized), args, count);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_track(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
56
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "track", @selector(track:resolve:reject:), args, count);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_getRecentEvents(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
60
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "getRecentEvents", @selector(getRecentEvents:resolve:reject:), args, count);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_getDataSetSnapshot(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
64
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "getDataSetSnapshot", @selector(getDataSetSnapshot:resolve:reject:), args, count);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_registerDeepLinkListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
68
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "registerDeepLinkListener", @selector(registerDeepLinkListener), args, count);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setUserId(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
72
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "setUserId", @selector(setUserId:), args, count);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setLogLevel(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
76
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "setLogLevel", @selector(setLogLevel:), args, count);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_getLogLevel(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
80
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, StringKind, "getLogLevel", @selector(getLogLevel), args, count);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setCustomProperties(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
84
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "setCustomProperties", @selector(setCustomProperties:), args, count);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_getCustomProperty(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
88
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "getCustomProperty", @selector(getCustomProperty:resolve:reject:), args, count);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_removeCustomProperty(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
92
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "removeCustomProperty", @selector(removeCustomProperty:), args, count);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_clearCustomProperties(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
96
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "clearCustomProperties", @selector(clearCustomProperties), args, count);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
100
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_removeListeners(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
104
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "removeListeners", @selector(removeListeners:), args, count);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
NativeAmplyModuleSpecJSI::NativeAmplyModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms)
|
|
108
|
+
: ObjCTurboModule(params) {
|
|
109
|
+
|
|
110
|
+
methodMap_["initialize"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_initialize};
|
|
111
|
+
setMethodArgConversionSelector(@"initialize", 0, @"JS_NativeAmplyModule_AmplyInitializationConfig:");
|
|
112
|
+
|
|
113
|
+
methodMap_["isInitialized"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_isInitialized};
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
methodMap_["track"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_track};
|
|
117
|
+
setMethodArgConversionSelector(@"track", 0, @"JS_NativeAmplyModule_TrackEventPayload:");
|
|
118
|
+
|
|
119
|
+
methodMap_["getRecentEvents"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_getRecentEvents};
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
methodMap_["getDataSetSnapshot"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_getDataSetSnapshot};
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
methodMap_["registerDeepLinkListener"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_registerDeepLinkListener};
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
methodMap_["setUserId"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setUserId};
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
methodMap_["setLogLevel"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setLogLevel};
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
methodMap_["getLogLevel"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_getLogLevel};
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
methodMap_["setCustomProperties"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setCustomProperties};
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
methodMap_["getCustomProperty"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_getCustomProperty};
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
methodMap_["removeCustomProperty"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_removeCustomProperty};
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
methodMap_["clearCustomProperties"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_clearCustomProperties};
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_addListener};
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
methodMap_["removeListeners"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_removeListeners};
|
|
153
|
+
|
|
154
|
+
eventEmitterMap_["onSystemEvent"] = std::make_shared<AsyncEventEmitter<id>>();
|
|
155
|
+
eventEmitterMap_["onDeepLink"] = std::make_shared<AsyncEventEmitter<id>>();
|
|
156
|
+
setEventEmitterCallback([&](const std::string &name, id value) {
|
|
157
|
+
static_cast<AsyncEventEmitter<id> &>(*eventEmitterMap_[name]).emit(value);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,173 @@
|
|
|
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: GenerateModuleObjCpp
|
|
8
|
+
*
|
|
9
|
+
* We create an umbrella header (and corresponding implementation) here since
|
|
10
|
+
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
|
|
11
|
+
* must have a single output. More files => more genrule()s => slower builds.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
#ifndef __cplusplus
|
|
15
|
+
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
// Avoid multiple includes of AmplyReactNative symbols
|
|
19
|
+
#ifndef AmplyReactNative_H
|
|
20
|
+
#define AmplyReactNative_H
|
|
21
|
+
|
|
22
|
+
#import <Foundation/Foundation.h>
|
|
23
|
+
#import <RCTRequired/RCTRequired.h>
|
|
24
|
+
#import <RCTTypeSafety/RCTConvertHelpers.h>
|
|
25
|
+
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
|
|
26
|
+
#import <React/RCTBridgeModule.h>
|
|
27
|
+
#import <React/RCTCxxConvert.h>
|
|
28
|
+
#import <React/RCTManagedPointer.h>
|
|
29
|
+
#import <ReactCommon/RCTTurboModule.h>
|
|
30
|
+
#import <optional>
|
|
31
|
+
#import <vector>
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
35
|
+
namespace JS {
|
|
36
|
+
namespace NativeAmplyModule {
|
|
37
|
+
struct AmplyInitializationConfig {
|
|
38
|
+
NSString *appId() const;
|
|
39
|
+
NSString *apiKeyPublic() const;
|
|
40
|
+
NSString *apiKeySecret() const;
|
|
41
|
+
NSString *endpoint() const;
|
|
42
|
+
id<NSObject> _Nullable datasetPrefetch() const;
|
|
43
|
+
NSString *defaultConfig() const;
|
|
44
|
+
std::optional<bool> debug() const;
|
|
45
|
+
NSString *logLevel() const;
|
|
46
|
+
|
|
47
|
+
AmplyInitializationConfig(NSDictionary *const v) : _v(v) {}
|
|
48
|
+
private:
|
|
49
|
+
NSDictionary *_v;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@interface RCTCxxConvert (NativeAmplyModule_AmplyInitializationConfig)
|
|
55
|
+
+ (RCTManagedPointer *)JS_NativeAmplyModule_AmplyInitializationConfig:(id)json;
|
|
56
|
+
@end
|
|
57
|
+
namespace JS {
|
|
58
|
+
namespace NativeAmplyModule {
|
|
59
|
+
struct TrackEventPayload {
|
|
60
|
+
NSString *name() const;
|
|
61
|
+
id<NSObject> _Nullable properties() const;
|
|
62
|
+
|
|
63
|
+
TrackEventPayload(NSDictionary *const v) : _v(v) {}
|
|
64
|
+
private:
|
|
65
|
+
NSDictionary *_v;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@interface RCTCxxConvert (NativeAmplyModule_TrackEventPayload)
|
|
71
|
+
+ (RCTManagedPointer *)JS_NativeAmplyModule_TrackEventPayload:(id)json;
|
|
72
|
+
@end
|
|
73
|
+
@protocol NativeAmplyModuleSpec <RCTBridgeModule, RCTTurboModule>
|
|
74
|
+
|
|
75
|
+
- (void)initialize:(JS::NativeAmplyModule::AmplyInitializationConfig &)config
|
|
76
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
77
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
78
|
+
- (NSNumber *)isInitialized;
|
|
79
|
+
- (void)track:(JS::NativeAmplyModule::TrackEventPayload &)payload
|
|
80
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
81
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
82
|
+
- (void)getRecentEvents:(double)limit
|
|
83
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
84
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
85
|
+
- (void)getDataSetSnapshot:(NSDictionary *)type
|
|
86
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
87
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
88
|
+
- (void)registerDeepLinkListener;
|
|
89
|
+
- (void)setUserId:(NSString * _Nullable)userId;
|
|
90
|
+
- (void)setLogLevel:(NSString *)level;
|
|
91
|
+
- (NSString *)getLogLevel;
|
|
92
|
+
- (void)setCustomProperties:(NSDictionary *)properties;
|
|
93
|
+
- (void)getCustomProperty:(NSString *)key
|
|
94
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
95
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
96
|
+
- (void)removeCustomProperty:(NSString *)key;
|
|
97
|
+
- (void)clearCustomProperties;
|
|
98
|
+
- (void)addListener:(NSString *)eventName;
|
|
99
|
+
- (void)removeListeners:(double)count;
|
|
100
|
+
|
|
101
|
+
@end
|
|
102
|
+
|
|
103
|
+
@interface NativeAmplyModuleSpecBase : NSObject {
|
|
104
|
+
@protected
|
|
105
|
+
facebook::react::EventEmitterCallback _eventEmitterCallback;
|
|
106
|
+
}
|
|
107
|
+
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
|
|
108
|
+
|
|
109
|
+
- (void)emitOnSystemEvent:(NSDictionary *)value;
|
|
110
|
+
- (void)emitOnDeepLink:(NSDictionary *)value;
|
|
111
|
+
@end
|
|
112
|
+
|
|
113
|
+
namespace facebook::react {
|
|
114
|
+
/**
|
|
115
|
+
* ObjC++ class for module 'NativeAmplyModule'
|
|
116
|
+
*/
|
|
117
|
+
class JSI_EXPORT NativeAmplyModuleSpecJSI : public ObjCTurboModule {
|
|
118
|
+
public:
|
|
119
|
+
NativeAmplyModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms);
|
|
120
|
+
};
|
|
121
|
+
} // namespace facebook::react
|
|
122
|
+
inline NSString *JS::NativeAmplyModule::AmplyInitializationConfig::appId() const
|
|
123
|
+
{
|
|
124
|
+
id const p = _v[@"appId"];
|
|
125
|
+
return RCTBridgingToString(p);
|
|
126
|
+
}
|
|
127
|
+
inline NSString *JS::NativeAmplyModule::AmplyInitializationConfig::apiKeyPublic() const
|
|
128
|
+
{
|
|
129
|
+
id const p = _v[@"apiKeyPublic"];
|
|
130
|
+
return RCTBridgingToString(p);
|
|
131
|
+
}
|
|
132
|
+
inline NSString *JS::NativeAmplyModule::AmplyInitializationConfig::apiKeySecret() const
|
|
133
|
+
{
|
|
134
|
+
id const p = _v[@"apiKeySecret"];
|
|
135
|
+
return RCTBridgingToOptionalString(p);
|
|
136
|
+
}
|
|
137
|
+
inline NSString *JS::NativeAmplyModule::AmplyInitializationConfig::endpoint() const
|
|
138
|
+
{
|
|
139
|
+
id const p = _v[@"endpoint"];
|
|
140
|
+
return RCTBridgingToOptionalString(p);
|
|
141
|
+
}
|
|
142
|
+
inline id<NSObject> _Nullable JS::NativeAmplyModule::AmplyInitializationConfig::datasetPrefetch() const
|
|
143
|
+
{
|
|
144
|
+
id const p = _v[@"datasetPrefetch"];
|
|
145
|
+
return p;
|
|
146
|
+
}
|
|
147
|
+
inline NSString *JS::NativeAmplyModule::AmplyInitializationConfig::defaultConfig() const
|
|
148
|
+
{
|
|
149
|
+
id const p = _v[@"defaultConfig"];
|
|
150
|
+
return RCTBridgingToOptionalString(p);
|
|
151
|
+
}
|
|
152
|
+
inline std::optional<bool> JS::NativeAmplyModule::AmplyInitializationConfig::debug() const
|
|
153
|
+
{
|
|
154
|
+
id const p = _v[@"debug"];
|
|
155
|
+
return RCTBridgingToOptionalBool(p);
|
|
156
|
+
}
|
|
157
|
+
inline NSString *JS::NativeAmplyModule::AmplyInitializationConfig::logLevel() const
|
|
158
|
+
{
|
|
159
|
+
id const p = _v[@"logLevel"];
|
|
160
|
+
return RCTBridgingToOptionalString(p);
|
|
161
|
+
}
|
|
162
|
+
inline NSString *JS::NativeAmplyModule::TrackEventPayload::name() const
|
|
163
|
+
{
|
|
164
|
+
id const p = _v[@"name"];
|
|
165
|
+
return RCTBridgingToString(p);
|
|
166
|
+
}
|
|
167
|
+
inline id<NSObject> _Nullable JS::NativeAmplyModule::TrackEventPayload::properties() const
|
|
168
|
+
{
|
|
169
|
+
id const p = _v[@"properties"];
|
|
170
|
+
return p;
|
|
171
|
+
}
|
|
172
|
+
NS_ASSUME_NONNULL_END
|
|
173
|
+
#endif // AmplyReactNative_H
|
|
@@ -80,6 +80,22 @@ namespace facebook::react {
|
|
|
80
80
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, StringKind, "getLogLevel", @selector(getLogLevel), args, count);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_setCustomProperties(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
84
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "setCustomProperties", @selector(setCustomProperties:), args, count);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_getCustomProperty(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
88
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, PromiseKind, "getCustomProperty", @selector(getCustomProperty:resolve:reject:), args, count);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_removeCustomProperty(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
92
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "removeCustomProperty", @selector(removeCustomProperty:), args, count);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_clearCustomProperties(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
96
|
+
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "clearCustomProperties", @selector(clearCustomProperties), args, count);
|
|
97
|
+
}
|
|
98
|
+
|
|
83
99
|
static facebook::jsi::Value __hostFunction_NativeAmplyModuleSpecJSI_addListener(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
|
|
84
100
|
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "addListener", @selector(addListener:), args, count);
|
|
85
101
|
}
|
|
@@ -107,17 +123,29 @@ namespace facebook::react {
|
|
|
107
123
|
|
|
108
124
|
|
|
109
125
|
methodMap_["registerDeepLinkListener"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_registerDeepLinkListener};
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
|
|
127
|
+
|
|
112
128
|
methodMap_["setUserId"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setUserId};
|
|
113
|
-
|
|
114
|
-
|
|
129
|
+
|
|
130
|
+
|
|
115
131
|
methodMap_["setLogLevel"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setLogLevel};
|
|
116
|
-
|
|
117
|
-
|
|
132
|
+
|
|
133
|
+
|
|
118
134
|
methodMap_["getLogLevel"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_getLogLevel};
|
|
119
|
-
|
|
120
|
-
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
methodMap_["setCustomProperties"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_setCustomProperties};
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
methodMap_["getCustomProperty"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_getCustomProperty};
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
methodMap_["removeCustomProperty"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_removeCustomProperty};
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
methodMap_["clearCustomProperties"] = MethodMetadata {0, __hostFunction_NativeAmplyModuleSpecJSI_clearCustomProperties};
|
|
147
|
+
|
|
148
|
+
|
|
121
149
|
methodMap_["addListener"] = MethodMetadata {1, __hostFunction_NativeAmplyModuleSpecJSI_addListener};
|
|
122
150
|
|
|
123
151
|
|
|
@@ -89,6 +89,12 @@ namespace JS {
|
|
|
89
89
|
- (void)setUserId:(NSString * _Nullable)userId;
|
|
90
90
|
- (void)setLogLevel:(NSString *)level;
|
|
91
91
|
- (NSString *)getLogLevel;
|
|
92
|
+
- (void)setCustomProperties:(NSDictionary *)properties;
|
|
93
|
+
- (void)getCustomProperty:(NSString *)key
|
|
94
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
95
|
+
reject:(RCTPromiseRejectBlock)reject;
|
|
96
|
+
- (void)removeCustomProperty:(NSString *)key;
|
|
97
|
+
- (void)clearCustomProperties;
|
|
92
98
|
- (void)addListener:(NSString *)eventName;
|
|
93
99
|
- (void)removeListeners:(double)count;
|
|
94
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplytools/react-native-amply-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "React Native SDK for Amply: Mobile SDK to orchestrate in-app experiences and campaigns remotely, without app releases",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|