react-native-repro 3.23.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/React-Repro.podspec +2 -2
- package/android/build.gradle +28 -1
- package/android/src/main/java/io/repro/android/reactbridge/{ReproReactBridgeModule.java → ReproReactBridgeModuleImpl.java} +265 -67
- package/android/src/main/java/io/repro/android/reactbridge/{ReproRemoteConfigBridge.java → ReproRemoteConfigBridgeModuleImpl.java} +19 -34
- package/android/src/newarch/java/io/repro/android/reactbridge/ReproEventEmitterOpenUrlModule.java +54 -0
- package/android/src/newarch/java/io/repro/android/reactbridge/ReproReactBridgeModule.java +367 -0
- package/android/src/newarch/java/io/repro/android/reactbridge/ReproReactBridgePackage.java +78 -0
- package/android/src/newarch/java/io/repro/android/reactbridge/ReproRemoteConfigBridgeModule.java +79 -0
- package/android/src/{main/java/io/repro/android/reactbridge/ReproEventEmitterOpenUrl.java → oldarch/java/io/repro/android/reactbridge/ReproEventEmitterOpenUrlModule.java} +4 -4
- package/android/src/oldarch/java/io/repro/android/reactbridge/ReproReactBridgeModule.java +365 -0
- package/android/src/oldarch/java/io/repro/android/reactbridge/ReproReactBridgePackage.java +29 -0
- package/android/src/oldarch/java/io/repro/android/reactbridge/ReproRemoteConfigBridgeModule.java +77 -0
- package/index.js +45 -228
- package/ios/RPRReproReactBridge.h +19 -4
- package/ios/{RPRReproReactBridge.m → RPRReproReactBridge.mm} +662 -187
- package/ios/RPRReproReactBridgeImpl.h +111 -0
- package/ios/RPRReproReactBridgeImpl.m +713 -0
- package/package.json +22 -1
- package/sdk-android/io/repro/repro-android-sdk/5.20.0/repro-android-sdk-5.20.0.aar +0 -0
- package/sdk-android/io/repro/repro-android-sdk/5.20.0/repro-android-sdk-5.20.0.aar.md5 +1 -0
- package/sdk-android/io/repro/repro-android-sdk/5.20.0/repro-android-sdk-5.20.0.aar.sha1 +1 -0
- package/sdk-android/io/repro/repro-android-sdk/5.20.0/repro-android-sdk-5.20.0.pom +24 -0
- package/sdk-android/io/repro/repro-android-sdk/5.20.0/repro-android-sdk-5.20.0.pom.md5 +1 -0
- package/sdk-android/io/repro/repro-android-sdk/5.20.0/repro-android-sdk-5.20.0.pom.sha1 +1 -0
- package/sdk-android/io/repro/repro-android-sdk/maven-metadata.xml +3 -3
- package/sdk-android/io/repro/repro-android-sdk/maven-metadata.xml.md5 +1 -1
- package/sdk-android/io/repro/repro-android-sdk/maven-metadata.xml.sha1 +1 -1
- package/sdk-ios/Repro.xcframework/_CodeSignature/CodeDirectory +0 -0
- package/sdk-ios/Repro.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
- package/sdk-ios/Repro.xcframework/_CodeSignature/CodeResources +18 -18
- package/sdk-ios/Repro.xcframework/_CodeSignature/CodeSignature +0 -0
- package/sdk-ios/Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework/Headers/Repro.h +63 -0
- package/sdk-ios/Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework/Info.plist +0 -0
- package/sdk-ios/Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework/Repro +0 -0
- package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/Repro.h +63 -0
- package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Info.plist +0 -0
- package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Repro +0 -0
- package/src/EventEmitterOpenUrl.js +24 -0
- package/src/NativeReproEventEmitterOpenUrl.ts +9 -0
- package/src/NativeReproReactBridge.ts +134 -0
- package/src/NativeReproRemoteConfigBridge.ts +26 -0
- package/src/NewsFeedManager.js +149 -0
- package/android/src/main/java/io/repro/android/reactbridge/ReproReactBridgePackage.java +0 -36
- package/repro-version.json +0 -5
- package/sdk-android/io/repro/repro-android-sdk/5.19.0/repro-android-sdk-5.19.0.aar +0 -0
- package/sdk-android/io/repro/repro-android-sdk/5.19.0/repro-android-sdk-5.19.0.aar.md5 +0 -1
- package/sdk-android/io/repro/repro-android-sdk/5.19.0/repro-android-sdk-5.19.0.aar.sha1 +0 -1
- package/sdk-android/io/repro/repro-android-sdk/5.19.0/repro-android-sdk-5.19.0.pom +0 -9
- package/sdk-android/io/repro/repro-android-sdk/5.19.0/repro-android-sdk-5.19.0.pom.md5 +0 -1
- package/sdk-android/io/repro/repro-android-sdk/5.19.0/repro-android-sdk-5.19.0.pom.sha1 +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// RPRReproReactBridge.
|
|
2
|
+
// RPRReproReactBridge.mm
|
|
3
3
|
// RPRReproReactBridge
|
|
4
4
|
//
|
|
5
5
|
// Created by Markus Wanke on 2018/08/08.
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
#import "RPRReproReactBridge.h"
|
|
11
|
+
#import "RPRReproReactBridgeImpl.h"
|
|
11
12
|
#import <Repro/Repro.h>
|
|
12
13
|
#import <Repro/RPRRemoteConfig.h>
|
|
13
14
|
#import <Repro/RPRNewsFeedEntry.h>
|
|
@@ -150,20 +151,44 @@ safe_value(id value)
|
|
|
150
151
|
|
|
151
152
|
@end
|
|
152
153
|
|
|
153
|
-
|
|
154
154
|
@implementation RPRRemoteConfigBridge
|
|
155
|
+
{
|
|
156
|
+
RPRReproReactBridgeImpl *_reproImpl;
|
|
157
|
+
}
|
|
155
158
|
|
|
156
|
-
RCT_EXPORT_MODULE(
|
|
159
|
+
RCT_EXPORT_MODULE(ReproRemoteConfigBridge)
|
|
160
|
+
|
|
161
|
+
- (instancetype)init
|
|
162
|
+
{
|
|
163
|
+
self = [super init];
|
|
164
|
+
if (self) {
|
|
165
|
+
_reproImpl = [[RPRReproReactBridgeImpl alloc] init];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return self;
|
|
169
|
+
}
|
|
157
170
|
|
|
158
171
|
- (NSDictionary *)constantsToExport
|
|
159
172
|
{
|
|
160
|
-
|
|
173
|
+
NSDictionary *fetchStatusConstants = @{
|
|
161
174
|
@"REMOTE_CONFIG_SUCCESS" : @(RPRRemoteConfigFetchStatusSuccess),
|
|
162
175
|
@"REMOTE_CONFIG_TIMEOUT_REACHED" : @(RPRRemoteConfigFetchStatusTimeoutReached),
|
|
163
176
|
@"REMOTE_CONFIG_ALREADY_FETCHED" : @(RPRRemoteConfigFetchStatusAlreadyFetched),
|
|
164
177
|
};
|
|
178
|
+
NSMutableDictionary *mergedDict = [fetchStatusConstants mutableCopy];
|
|
179
|
+
[mergedDict addEntriesFromDictionary:@{
|
|
180
|
+
@"FETCH_STATUS": fetchStatusConstants,
|
|
181
|
+
}];
|
|
182
|
+
NSDictionary *finalDict = [mergedDict copy];
|
|
183
|
+
return finalDict;
|
|
165
184
|
};
|
|
166
185
|
|
|
186
|
+
- (NSDictionary *)getConstants
|
|
187
|
+
{
|
|
188
|
+
return [self constantsToExport];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
167
192
|
+ (BOOL)requiresMainQueueSetup
|
|
168
193
|
{
|
|
169
194
|
return YES; // needed because we override `constantsToExport`
|
|
@@ -183,80 +208,110 @@ RCT_EXPORT_MODULE(RemoteConfig)
|
|
|
183
208
|
return [NSDictionary.alloc initWithDictionary: dict];
|
|
184
209
|
}
|
|
185
210
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
211
|
+
|
|
212
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
213
|
+
|
|
214
|
+
- (void)fetch:(double)timeout callback:(RCTResponseSenderBlock)callback
|
|
215
|
+
{
|
|
216
|
+
[_reproImpl fetch:timeout completionHandler:callback];
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
- (void)activateFetched
|
|
220
|
+
{
|
|
221
|
+
[_reproImpl activateFetched];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
- (void)setDefaultsFromDictionary:(NSDictionary<NSString *, id> *) json
|
|
225
|
+
{
|
|
226
|
+
[_reproImpl setDefaultsFromDictionary:json];
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
- (void)setDefaultsFromJsonString:(NSString *)string
|
|
230
|
+
{
|
|
231
|
+
[_reproImpl setDefaultsFromJsonString:string];
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
- (void)getValue:(NSString*)key callback:(RCTResponseSenderBlock)callback
|
|
235
|
+
{
|
|
236
|
+
[_reproImpl getValue:key callback:callback];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
- (void)getAllValues:(RCTResponseSenderBlock)callback
|
|
240
|
+
{
|
|
241
|
+
[_reproImpl getAllValues:callback];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
- (void)getAllValuesWithPrefix:(NSString*)key callback:(RCTResponseSenderBlock)callback
|
|
245
|
+
{
|
|
246
|
+
[_reproImpl getAllValuesWithPrefix:key callback:callback];
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
- (void)getLocalDefaultValue:(NSString*)key callback:(RCTResponseSenderBlock)callback
|
|
250
|
+
{
|
|
251
|
+
[_reproImpl getLocalDefaultValue:key callback:callback];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
- (void)forceReset
|
|
255
|
+
{
|
|
256
|
+
[_reproImpl forceReset];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
#else
|
|
260
|
+
|
|
203
261
|
RCT_EXPORT_METHOD(fetch:(double)timeout completionHandler:(RCTResponseSenderBlock)callback)
|
|
204
262
|
{
|
|
205
|
-
|
|
206
|
-
[[Repro remoteConfig] fetchWithTimeout:timeoutSecs completionHandler:^(RPRRemoteConfigFetchStatus status) {
|
|
207
|
-
callback(@[@(status)]);
|
|
208
|
-
}];
|
|
263
|
+
[_reproImpl fetch:timeout completionHandler:callback];
|
|
209
264
|
}
|
|
210
265
|
|
|
211
|
-
/// This is only needed if you use `fetchWithTimeout:completionHandler:`. See above.
|
|
212
|
-
/// Returns YES if a previously fetched remote config has replaced the current remote config.
|
|
213
266
|
RCT_EXPORT_METHOD(activateFetched)
|
|
214
267
|
{
|
|
215
|
-
[
|
|
268
|
+
[_reproImpl activateFetched];
|
|
216
269
|
}
|
|
217
270
|
|
|
218
|
-
/// Set local defaults for remote config queries via dictionary.
|
|
219
271
|
RCT_EXPORT_METHOD(setDefaultsFromDictionary:(NSDictionary<NSString *, id> *) json)
|
|
220
272
|
{
|
|
221
|
-
[
|
|
273
|
+
[_reproImpl setDefaultsFromDictionary:json];
|
|
222
274
|
}
|
|
223
275
|
|
|
224
|
-
/// Set local defaults for remote config queries via a json string.
|
|
225
276
|
RCT_EXPORT_METHOD(setDefaultsFromJsonString:(NSString *)string)
|
|
226
277
|
{
|
|
227
|
-
[
|
|
278
|
+
[_reproImpl setDefaultsFromJsonString:string];
|
|
228
279
|
}
|
|
229
280
|
|
|
230
|
-
/// Access to remote config values.
|
|
231
281
|
RCT_EXPORT_METHOD(getValue:(NSString*)key callback:(RCTResponseSenderBlock)callback)
|
|
232
282
|
{
|
|
233
|
-
|
|
283
|
+
[_reproImpl getValue:key callback:callback];
|
|
234
284
|
}
|
|
235
285
|
|
|
236
|
-
/// Return a dictonary with all key value pairs.
|
|
237
286
|
RCT_EXPORT_METHOD(getAllValues:(RCTResponseSenderBlock)callback)
|
|
238
287
|
{
|
|
239
|
-
|
|
288
|
+
[_reproImpl getAllValues:callback];
|
|
240
289
|
}
|
|
241
290
|
|
|
242
|
-
/// Return a dictonary with all key value pairs for a given prefix. Pass `nil` or an empty string to get all values.
|
|
243
291
|
RCT_EXPORT_METHOD(getAllValuesWithPrefix:(NSString*)key callback:(RCTResponseSenderBlock)callback)
|
|
244
292
|
{
|
|
245
|
-
|
|
293
|
+
[_reproImpl getAllValuesWithPrefix:key callback:callback];
|
|
246
294
|
}
|
|
247
295
|
|
|
248
|
-
/// Returns the local default value for a key.
|
|
249
296
|
RCT_EXPORT_METHOD(getLocalDefaultValue:(NSString*)key callback:(RCTResponseSenderBlock)callback)
|
|
250
297
|
{
|
|
251
|
-
|
|
298
|
+
[_reproImpl getLocalDefaultValue:key callback:callback];
|
|
252
299
|
}
|
|
253
300
|
|
|
254
|
-
/// Reset all data. Local config & remote Config. Should only be used while in development.
|
|
255
301
|
RCT_EXPORT_METHOD(forceReset)
|
|
256
302
|
{
|
|
257
|
-
[
|
|
303
|
+
[_reproImpl forceReset];
|
|
258
304
|
}
|
|
259
305
|
|
|
306
|
+
#endif
|
|
307
|
+
|
|
308
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
309
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
310
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
311
|
+
{
|
|
312
|
+
return std::make_shared<facebook::react::NativeReproRemoteConfigBridgeSpecJSI>(params);
|
|
313
|
+
}
|
|
314
|
+
#endif
|
|
260
315
|
|
|
261
316
|
@end
|
|
262
317
|
|
|
@@ -294,10 +349,18 @@ static NSString *get_react_native_version()
|
|
|
294
349
|
|
|
295
350
|
|
|
296
351
|
@implementation RPRReproReactBridge
|
|
352
|
+
{
|
|
353
|
+
RPRReproReactBridgeImpl *_reproImpl;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
RCT_EXPORT_MODULE(ReproReactBridgeModule)
|
|
297
357
|
|
|
298
358
|
- (instancetype)init
|
|
299
359
|
{
|
|
300
360
|
self = [super init];
|
|
361
|
+
if (self) {
|
|
362
|
+
_reproImpl = [[RPRReproReactBridgeImpl alloc] init];
|
|
363
|
+
}
|
|
301
364
|
|
|
302
365
|
if ([Repro respondsToSelector:@selector(_passRuntimeValues:)]) {
|
|
303
366
|
[Repro _passRuntimeValues:@{
|
|
@@ -312,9 +375,6 @@ static NSString *get_react_native_version()
|
|
|
312
375
|
return self;
|
|
313
376
|
}
|
|
314
377
|
|
|
315
|
-
|
|
316
|
-
RCT_EXPORT_MODULE(Repro)
|
|
317
|
-
|
|
318
378
|
- (NSDictionary *)constantsToExport
|
|
319
379
|
{
|
|
320
380
|
return @{
|
|
@@ -388,277 +448,659 @@ RCT_EXPORT_MODULE(Repro)
|
|
|
388
448
|
};
|
|
389
449
|
};
|
|
390
450
|
|
|
451
|
+
- (NSDictionary *)getConstants
|
|
452
|
+
{
|
|
453
|
+
return [self constantsToExport];
|
|
454
|
+
}
|
|
455
|
+
|
|
391
456
|
+ (BOOL)requiresMainQueueSetup
|
|
392
457
|
{
|
|
393
458
|
return YES; // needed because we override `constantsToExport`
|
|
394
459
|
}
|
|
395
460
|
|
|
396
461
|
|
|
462
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
463
|
+
|
|
397
464
|
// Opt In / Opt Out
|
|
398
465
|
|
|
399
|
-
|
|
466
|
+
- (void)optIn:(BOOL)endUserOptedIn
|
|
467
|
+
{
|
|
468
|
+
[_reproImpl optIn:endUserOptedIn];
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// User profile
|
|
472
|
+
|
|
473
|
+
- (void)setUserID:(NSString *)userID
|
|
474
|
+
{
|
|
475
|
+
[_reproImpl setUserID:userID];
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
- (void)getUserID:(RCTResponseSenderBlock)callback
|
|
400
479
|
{
|
|
401
|
-
[
|
|
480
|
+
[_reproImpl getUserID:callback];
|
|
402
481
|
}
|
|
403
482
|
|
|
483
|
+
- (void)getDeviceID:(RCTResponseSenderBlock)callback
|
|
484
|
+
{
|
|
485
|
+
[_reproImpl getDeviceID:callback];
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
- (void)setStringUserProfile:(NSString *)key value:(NSString *)value
|
|
489
|
+
{
|
|
490
|
+
[_reproImpl setStringUserProfile:key value:value];
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
- (void)setIntUserProfile:(NSString *)key value:(NSInteger)value
|
|
494
|
+
{
|
|
495
|
+
[_reproImpl setIntUserProfile:key value:value];
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
- (void)setDoubleUserProfile:(NSString *)key value:(double)value
|
|
499
|
+
{
|
|
500
|
+
[_reproImpl setDoubleUserProfile:key value:value];
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
- (void)setDateUserProfile:(NSString *)key value:(NSDate *)value
|
|
504
|
+
{
|
|
505
|
+
[_reproImpl setDateUserProfile:key value:value];
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
- (void)setUserGender:(RPRUserProfileGender)value
|
|
509
|
+
{
|
|
510
|
+
[_reproImpl setUserGender:value];
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
- (void)setUserEmailAddress:(NSString *)value
|
|
514
|
+
{
|
|
515
|
+
[_reproImpl setUserEmailAddress:value];
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
- (void)setUserResidencePrefecture:(RPRUserProfilePrefecture)value
|
|
519
|
+
{
|
|
520
|
+
[_reproImpl setUserResidencePrefecture:value];
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
- (void)setUserDateOfBirth:(NSDate *)value
|
|
524
|
+
{
|
|
525
|
+
[_reproImpl setUserDateOfBirth:value];
|
|
526
|
+
}
|
|
404
527
|
|
|
528
|
+
- (void)setUserAge:(NSInteger)value
|
|
529
|
+
{
|
|
530
|
+
[_reproImpl setUserAge:value];
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
- (void)onlySetIfAbsentStringUserProfile:(NSString *)key value:(NSString *)value
|
|
534
|
+
{
|
|
535
|
+
[_reproImpl onlySetIfAbsentStringUserProfile:key value:value];
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
- (void)onlySetIfAbsentIntUserProfile:(NSString *)key value:(NSInteger)value
|
|
539
|
+
{
|
|
540
|
+
[_reproImpl onlySetIfAbsentIntUserProfile:key value:value];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
- (void)onlySetIfAbsentDoubleUserProfile:(NSString *)key value:(double)value
|
|
544
|
+
{
|
|
545
|
+
[_reproImpl onlySetIfAbsentDoubleUserProfile:key value:value];
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
- (void)onlySetIfAbsentDateUserProfile:(NSString *)key value:(NSDate *)value
|
|
549
|
+
{
|
|
550
|
+
[_reproImpl onlySetIfAbsentDateUserProfile:key value:value];
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
- (void)incrementIntUserProfileBy:(NSString *)key value:(NSInteger)value
|
|
554
|
+
{
|
|
555
|
+
[_reproImpl incrementIntUserProfileBy:key value:value];
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
- (void)decrementIntUserProfileBy:(NSString *)key value:(NSInteger)value
|
|
559
|
+
{
|
|
560
|
+
[_reproImpl decrementIntUserProfileBy:key value:value];
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
- (void)incrementDoubleUserProfileBy:(NSString *)key value:(double)value
|
|
564
|
+
{
|
|
565
|
+
[_reproImpl incrementDoubleUserProfileBy:key value:value];
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
- (void)decrementDoubleUserProfileBy:(NSString *)key value:(double)value
|
|
569
|
+
{
|
|
570
|
+
[_reproImpl decrementDoubleUserProfileBy:key value:value];
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
- (void)onlySetIfAbsentUserGender:(RPRUserProfileGender)value
|
|
574
|
+
{
|
|
575
|
+
[_reproImpl onlySetIfAbsentUserGender:value];
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
- (void)onlySetIfAbsentUserEmailAddress:(NSString *)value
|
|
579
|
+
{
|
|
580
|
+
[_reproImpl onlySetIfAbsentUserEmailAddress:value];
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
- (void)onlySetIfAbsentUserResidencePrefecture:(RPRUserProfilePrefecture)value
|
|
584
|
+
{
|
|
585
|
+
[_reproImpl onlySetIfAbsentUserResidencePrefecture:value];
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
- (void)onlySetIfAbsentUserDateOfBirth:(NSDate *)value
|
|
589
|
+
{
|
|
590
|
+
[_reproImpl onlySetIfAbsentUserDateOfBirth:value];
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
- (void)onlySetIfAbsentUserAge:(NSInteger)value
|
|
594
|
+
{
|
|
595
|
+
[_reproImpl onlySetIfAbsentUserAge:value];
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
- (void)incrementUserAgeBy:(NSInteger)value
|
|
599
|
+
{
|
|
600
|
+
[_reproImpl incrementUserAgeBy:value];
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
- (void)decrementUserAgeBy:(NSInteger)value
|
|
604
|
+
{
|
|
605
|
+
[_reproImpl decrementUserAgeBy:value];
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
- (void)deleteUserProfile:(NSString *)key
|
|
609
|
+
{
|
|
610
|
+
[_reproImpl deleteUserProfile:key];
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
- (void)deleteUserGender
|
|
614
|
+
{
|
|
615
|
+
[_reproImpl deleteUserGender];
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
- (void)deleteUserEmailAddress
|
|
619
|
+
{
|
|
620
|
+
[_reproImpl deleteUserEmailAddress];
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
- (void)deleteUserResidencePrefecture
|
|
624
|
+
{
|
|
625
|
+
[_reproImpl deleteUserResidencePrefecture];
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
- (void)deleteUserDateOfBirth
|
|
629
|
+
{
|
|
630
|
+
[_reproImpl deleteUserDateOfBirth];
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
- (void)deleteUserAge
|
|
634
|
+
{
|
|
635
|
+
[_reproImpl deleteUserAge];
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// Custom event tracking
|
|
639
|
+
|
|
640
|
+
- (void)track:(NSString *)eventName properties:(NSDictionary *)props
|
|
641
|
+
{
|
|
642
|
+
[_reproImpl track:eventName properties:props];
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
// Standard event tracking
|
|
648
|
+
|
|
649
|
+
- (void)trackViewContent:(NSString *)contentId props:(NSDictionary *)props
|
|
650
|
+
{
|
|
651
|
+
[_reproImpl trackViewContent:contentId properties:props];
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
- (void)trackSearch:(NSDictionary *)props
|
|
655
|
+
{
|
|
656
|
+
[_reproImpl trackSearch:props];
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
- (void)trackAddToCart:(NSString *)contentId props:(NSDictionary *)props
|
|
660
|
+
{
|
|
661
|
+
[_reproImpl trackAddToCart:contentId properties:props];
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
- (void)trackAddToWishlist:(NSDictionary *)props
|
|
665
|
+
{
|
|
666
|
+
[_reproImpl trackAddToWishlist:props];
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
- (void)trackInitiateCheckout:(NSDictionary *)props
|
|
670
|
+
{
|
|
671
|
+
[_reproImpl trackInitiateCheckout:props];
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
- (void)trackAddPaymentInfo:(NSDictionary *)props
|
|
675
|
+
{
|
|
676
|
+
[_reproImpl trackAddPaymentInfo:props];
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
- (void)trackPurchase:(NSString *)contentId value:(double)value currency:(NSString *)currency props:(NSDictionary *)props
|
|
680
|
+
{
|
|
681
|
+
[_reproImpl trackPurchase:contentId value:value currency:currency properties:props];
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
- (void)trackShare:(NSDictionary *)props
|
|
685
|
+
{
|
|
686
|
+
[_reproImpl trackShare:props];
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
- (void)trackLead:(NSDictionary *)props
|
|
690
|
+
{
|
|
691
|
+
[_reproImpl trackLead:props];
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
- (void)trackCompleteRegistration:(NSDictionary *)props
|
|
695
|
+
{
|
|
696
|
+
[_reproImpl trackCompleteRegistration:props];
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
- (void)trackNotificationOpened:(NSString *)notificationId
|
|
700
|
+
{
|
|
701
|
+
[_reproImpl trackNotificationOpened:notificationId];
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// Other
|
|
705
|
+
|
|
706
|
+
- (void)setLogLevel:(RPRLogLevel)level
|
|
707
|
+
{
|
|
708
|
+
[_reproImpl setLogLevel:level];
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
- (void)setPushDeviceTokenString:(NSString *)deviceTokenHexString
|
|
712
|
+
{
|
|
713
|
+
[_reproImpl setPushDeviceTokenString:deviceTokenHexString];
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
- (void)setPushRegistrationID:(NSString *)pushRegId
|
|
717
|
+
{
|
|
718
|
+
[_reproImpl setPushDeviceTokenString:pushRegId];
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
- (void)setPushToken:(NSString *)token
|
|
722
|
+
{
|
|
723
|
+
[_reproImpl setPushDeviceTokenString:token];
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
- (void)enablePushNotification
|
|
727
|
+
{
|
|
728
|
+
[_reproImpl enablePushNotification];
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// NOTE: Should better be called native from AppDelegate::didFinishLaunchingWithOptions
|
|
732
|
+
- (void)setup:(NSString *)token
|
|
733
|
+
{
|
|
734
|
+
[_reproImpl setup:token];
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
- (void)enableInAppMessagesOnForegroundTransition
|
|
738
|
+
{
|
|
739
|
+
[_reproImpl enableInAppMessagesOnForegroundTransition];
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// NOTE: Should better be called native from AppDelegate::didFinishLaunchingWithOptions if needed
|
|
743
|
+
- (void)disableInAppMessagesOnForegroundTransition
|
|
744
|
+
{
|
|
745
|
+
[_reproImpl disableInAppMessagesOnForegroundTransition];
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
- (void)getNewsFeeds:(double)limit callback:(RCTResponseSenderBlock)callback
|
|
749
|
+
{
|
|
750
|
+
[_reproImpl getNewsFeeds:limit campaignType:@(RPRCampaignTypePushNotification) callback:callback];
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
- (void)oldArchGetNewsFeeds:(double)limit campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback
|
|
754
|
+
{
|
|
755
|
+
// Only Legacy Architecture method
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
- (void)getNewsFeedsFor:(double)limit offsetID:(double)offsetID callback:(RCTResponseSenderBlock)callback
|
|
759
|
+
{
|
|
760
|
+
[_reproImpl getNewsFeedsFor:limit offsetID:offsetID campaignType:@(RPRCampaignTypePushNotification) callback:callback];
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
- (void)oldArchGetNewsFeedsFor:(double)limit offsetID:(double)offsetID campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback
|
|
764
|
+
{
|
|
765
|
+
// Only Legacy Architecture method
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
- (void)getNewsFeedsWithCampaignType:(double)limit campaignType:(double)type callback:(RCTResponseSenderBlock)callback
|
|
769
|
+
{
|
|
770
|
+
[_reproImpl getNewsFeeds:limit campaignType:@(type) callback:callback];
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
- (void)getNewsFeedsWithCampaignTypeFor:(double)limit offsetID:(double)offsetID campaignType:(double)type callback:(RCTResponseSenderBlock)callback
|
|
774
|
+
{
|
|
775
|
+
[_reproImpl getNewsFeedsFor:limit offsetID:offsetID campaignType:@(type) callback:callback];
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
- (void)updateNewsFeeds:(NSArray<NSDictionary *> *)entryJsons callback:(RCTResponseSenderBlock)callback
|
|
779
|
+
{
|
|
780
|
+
[_reproImpl updateNewsFeeds:entryJsons callback:callback];
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
- (void)oldArchUpdateNewsFeeds:(NSArray<NSDictionary *> *)entryJsons callback:(RCTResponseSenderBlock)callback
|
|
784
|
+
{
|
|
785
|
+
// Only Legacy Architecture method
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
- (void)setSilverEggProdKey:(NSString *)silverEggProdKey
|
|
789
|
+
{
|
|
790
|
+
[_reproImpl setSilverEggProdKey:silverEggProdKey];
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
- (void)setSilverEggCookie:(NSString *)silverEggCookie
|
|
794
|
+
{
|
|
795
|
+
[_reproImpl setSilverEggCookie:silverEggCookie];
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
- (void)linkLineID:(NSString *)lineUserId lineChannelId:(NSString *)lineChannelId
|
|
799
|
+
{
|
|
800
|
+
[_reproImpl linkLineID:lineUserId lineChannelID:lineChannelId];
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
- (void)unlinkLineID:(NSString *)lineUserId lineChannelId:(NSString *)lineChannelId
|
|
804
|
+
{
|
|
805
|
+
[_reproImpl unlinkLineID:lineUserId lineChannelID:lineChannelId];
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
- (void)_handleWebViewUrl:(NSString *)webViewRequestUrl
|
|
810
|
+
{
|
|
811
|
+
[_reproImpl _webviewJavaScriptOpenUrlHandler:webViewRequestUrl];
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
#else
|
|
815
|
+
|
|
816
|
+
// Opt In / Opt Out
|
|
817
|
+
|
|
818
|
+
RCT_EXPORT_METHOD(optIn:(BOOL)endUserOptedIn)
|
|
819
|
+
{
|
|
820
|
+
[_reproImpl optIn:endUserOptedIn];
|
|
821
|
+
}
|
|
405
822
|
|
|
406
823
|
// User profile
|
|
407
824
|
|
|
408
825
|
RCT_EXPORT_METHOD(setUserID:(NSString *)userID)
|
|
409
826
|
{
|
|
410
|
-
[
|
|
827
|
+
[_reproImpl setUserID:userID];
|
|
411
828
|
}
|
|
412
829
|
|
|
413
830
|
RCT_EXPORT_METHOD(getUserID:(RCTResponseSenderBlock)callback)
|
|
414
831
|
{
|
|
415
|
-
|
|
832
|
+
[_reproImpl getUserID:callback];
|
|
416
833
|
}
|
|
417
834
|
|
|
418
835
|
RCT_EXPORT_METHOD(getDeviceID:(RCTResponseSenderBlock)callback)
|
|
419
836
|
{
|
|
420
|
-
|
|
837
|
+
[_reproImpl getDeviceID:callback];
|
|
421
838
|
}
|
|
422
839
|
|
|
423
840
|
RCT_EXPORT_METHOD(setStringUserProfile:(NSString *)key value:(NSString *)value)
|
|
424
841
|
{
|
|
425
|
-
[
|
|
842
|
+
[_reproImpl setStringUserProfile:key value:value];
|
|
426
843
|
}
|
|
427
844
|
|
|
428
845
|
RCT_EXPORT_METHOD(setIntUserProfile:(NSString *)key value:(NSInteger)value)
|
|
429
846
|
{
|
|
430
|
-
[
|
|
847
|
+
[_reproImpl setIntUserProfile:key value:value];
|
|
431
848
|
}
|
|
432
849
|
|
|
433
850
|
RCT_EXPORT_METHOD(setDoubleUserProfile:(NSString *)key value:(double)value)
|
|
434
851
|
{
|
|
435
|
-
[
|
|
852
|
+
[_reproImpl setDoubleUserProfile:key value:value];
|
|
436
853
|
}
|
|
437
854
|
|
|
438
855
|
RCT_EXPORT_METHOD(setDateUserProfile:(NSString *)key value:(NSDate *)value)
|
|
439
856
|
{
|
|
440
|
-
[
|
|
857
|
+
[_reproImpl setDateUserProfile:key value:value];
|
|
441
858
|
}
|
|
442
859
|
|
|
443
860
|
RCT_EXPORT_METHOD(setUserGender:(RPRUserProfileGender)value)
|
|
444
861
|
{
|
|
445
|
-
[
|
|
862
|
+
[_reproImpl setUserGender:value];
|
|
446
863
|
}
|
|
447
864
|
|
|
448
865
|
RCT_EXPORT_METHOD(setUserEmailAddress:(NSString *)value)
|
|
449
866
|
{
|
|
450
|
-
[
|
|
867
|
+
[_reproImpl setUserEmailAddress:value];
|
|
451
868
|
}
|
|
452
869
|
|
|
453
870
|
RCT_EXPORT_METHOD(setUserResidencePrefecture:(RPRUserProfilePrefecture)value)
|
|
454
871
|
{
|
|
455
|
-
[
|
|
872
|
+
[_reproImpl setUserResidencePrefecture:value];
|
|
456
873
|
}
|
|
457
874
|
|
|
458
875
|
RCT_EXPORT_METHOD(setUserDateOfBirth:(NSDate *)value)
|
|
459
876
|
{
|
|
460
|
-
[
|
|
877
|
+
[_reproImpl setUserDateOfBirth:value];
|
|
461
878
|
}
|
|
462
879
|
|
|
463
880
|
RCT_EXPORT_METHOD(setUserAge:(NSInteger)value)
|
|
464
881
|
{
|
|
465
|
-
[
|
|
882
|
+
[_reproImpl setUserAge:value];
|
|
466
883
|
}
|
|
467
884
|
|
|
885
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentStringUserProfile:(NSString *)key value:(NSString *)value)
|
|
886
|
+
{
|
|
887
|
+
[_reproImpl onlySetIfAbsentStringUserProfile:key value:value];
|
|
888
|
+
}
|
|
468
889
|
|
|
469
|
-
|
|
890
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentIntUserProfile:(NSString *)key value:(NSInteger)value)
|
|
891
|
+
{
|
|
892
|
+
[_reproImpl onlySetIfAbsentIntUserProfile:key value:value];
|
|
893
|
+
}
|
|
470
894
|
|
|
471
|
-
RCT_EXPORT_METHOD(
|
|
895
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentDoubleUserProfile:(NSString *)key value:(double)value)
|
|
472
896
|
{
|
|
473
|
-
[
|
|
897
|
+
[_reproImpl onlySetIfAbsentDoubleUserProfile:key value:value];
|
|
474
898
|
}
|
|
475
899
|
|
|
900
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentDateUserProfile:(NSString *)key value:(NSDate *)value)
|
|
901
|
+
{
|
|
902
|
+
[_reproImpl onlySetIfAbsentDateUserProfile:key value:value];
|
|
903
|
+
}
|
|
476
904
|
|
|
905
|
+
RCT_EXPORT_METHOD(incrementIntUserProfileBy:(NSString *)key value:(NSInteger)value)
|
|
906
|
+
{
|
|
907
|
+
[_reproImpl incrementIntUserProfileBy:key value:value];
|
|
908
|
+
}
|
|
477
909
|
|
|
478
|
-
|
|
910
|
+
RCT_EXPORT_METHOD(decrementIntUserProfileBy:(NSString *)key value:(NSInteger)value)
|
|
911
|
+
{
|
|
912
|
+
[_reproImpl decrementIntUserProfileBy:key value:value];
|
|
913
|
+
}
|
|
479
914
|
|
|
480
|
-
RCT_EXPORT_METHOD(
|
|
915
|
+
RCT_EXPORT_METHOD(incrementDoubleUserProfileBy:(NSString *)key value:(double)value)
|
|
481
916
|
{
|
|
482
|
-
|
|
917
|
+
[_reproImpl incrementDoubleUserProfileBy:key value:value];
|
|
918
|
+
}
|
|
483
919
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
489
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
920
|
+
RCT_EXPORT_METHOD(decrementDoubleUserProfileBy:(NSString *)key value:(double)value)
|
|
921
|
+
{
|
|
922
|
+
[_reproImpl decrementDoubleUserProfileBy:key value:value];
|
|
923
|
+
}
|
|
490
924
|
|
|
491
|
-
|
|
925
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserGender:(RPRUserProfileGender)value)
|
|
926
|
+
{
|
|
927
|
+
[_reproImpl onlySetIfAbsentUserGender:value];
|
|
492
928
|
}
|
|
493
929
|
|
|
494
|
-
RCT_EXPORT_METHOD(
|
|
930
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserEmailAddress:(NSString *)value)
|
|
495
931
|
{
|
|
496
|
-
|
|
932
|
+
[_reproImpl onlySetIfAbsentUserEmailAddress:value];
|
|
933
|
+
}
|
|
497
934
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
503
|
-
if ((val = props[@"search_string"])) { properties.searchString = [RCTConvert NSString:val]; }
|
|
504
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
935
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserResidencePrefecture:(RPRUserProfilePrefecture)value)
|
|
936
|
+
{
|
|
937
|
+
[_reproImpl onlySetIfAbsentUserResidencePrefecture:value];
|
|
938
|
+
}
|
|
505
939
|
|
|
506
|
-
|
|
940
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserDateOfBirth:(NSDate *)value)
|
|
941
|
+
{
|
|
942
|
+
[_reproImpl onlySetIfAbsentUserDateOfBirth:value];
|
|
507
943
|
}
|
|
508
944
|
|
|
945
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserAge:(NSInteger)value)
|
|
946
|
+
{
|
|
947
|
+
[_reproImpl onlySetIfAbsentUserAge:value];
|
|
948
|
+
}
|
|
509
949
|
|
|
950
|
+
RCT_EXPORT_METHOD(incrementUserAgeBy:(NSInteger)value)
|
|
951
|
+
{
|
|
952
|
+
[_reproImpl incrementUserAgeBy:value];
|
|
953
|
+
}
|
|
510
954
|
|
|
511
|
-
RCT_EXPORT_METHOD(
|
|
955
|
+
RCT_EXPORT_METHOD(decrementUserAgeBy:(NSInteger)value)
|
|
512
956
|
{
|
|
513
|
-
|
|
957
|
+
[_reproImpl decrementUserAgeBy:value];
|
|
958
|
+
}
|
|
514
959
|
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
520
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
960
|
+
RCT_EXPORT_METHOD(deleteUserProfile:(NSString *)key)
|
|
961
|
+
{
|
|
962
|
+
[_reproImpl deleteUserProfile:key];
|
|
963
|
+
}
|
|
521
964
|
|
|
522
|
-
|
|
965
|
+
RCT_EXPORT_METHOD(deleteUserGender)
|
|
966
|
+
{
|
|
967
|
+
[_reproImpl deleteUserGender];
|
|
523
968
|
}
|
|
524
969
|
|
|
970
|
+
RCT_EXPORT_METHOD(deleteUserEmailAddress)
|
|
971
|
+
{
|
|
972
|
+
[_reproImpl deleteUserEmailAddress];
|
|
973
|
+
}
|
|
525
974
|
|
|
526
|
-
RCT_EXPORT_METHOD(
|
|
975
|
+
RCT_EXPORT_METHOD(deleteUserResidencePrefecture)
|
|
527
976
|
{
|
|
528
|
-
|
|
977
|
+
[_reproImpl deleteUserResidencePrefecture];
|
|
978
|
+
}
|
|
529
979
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
535
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
536
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
980
|
+
RCT_EXPORT_METHOD(deleteUserDateOfBirth)
|
|
981
|
+
{
|
|
982
|
+
[_reproImpl deleteUserDateOfBirth];
|
|
983
|
+
}
|
|
537
984
|
|
|
538
|
-
|
|
985
|
+
RCT_EXPORT_METHOD(deleteUserAge)
|
|
986
|
+
{
|
|
987
|
+
[_reproImpl deleteUserAge];
|
|
539
988
|
}
|
|
540
989
|
|
|
541
|
-
|
|
990
|
+
// Custom event tracking
|
|
991
|
+
|
|
992
|
+
RCT_EXPORT_METHOD(track:(NSString *)eventName properties:(NSDictionary *)props)
|
|
542
993
|
{
|
|
543
|
-
|
|
994
|
+
[_reproImpl track:eventName properties:props];
|
|
995
|
+
}
|
|
544
996
|
|
|
545
|
-
|
|
546
|
-
if ((val = props[@"value"])) { properties.value = [RCTConvert double:val]; }
|
|
547
|
-
if ((val = props[@"currency"])) { properties.currency = [RCTConvert NSString:val]; }
|
|
548
|
-
if ((val = props[@"content_category"])) { properties.contentCategory = [RCTConvert NSString:val]; }
|
|
549
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
550
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
551
|
-
if ((val = props[@"num_items"])) { properties.numItems = [RCTConvert NSInteger:val]; }
|
|
552
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
997
|
+
// Standard event tracking
|
|
553
998
|
|
|
554
|
-
|
|
999
|
+
RCT_EXPORT_METHOD(trackViewContent:(NSString *)contentID properties:(NSDictionary *)props)
|
|
1000
|
+
{
|
|
1001
|
+
[_reproImpl trackViewContent:contentID properties:props];
|
|
555
1002
|
}
|
|
556
1003
|
|
|
557
|
-
RCT_EXPORT_METHOD(
|
|
1004
|
+
RCT_EXPORT_METHOD(trackSearch:(NSDictionary *)props)
|
|
558
1005
|
{
|
|
559
|
-
|
|
1006
|
+
[_reproImpl trackSearch:props];
|
|
1007
|
+
}
|
|
560
1008
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
566
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
1009
|
+
RCT_EXPORT_METHOD(trackAddToCart:(NSString *)contentID properties:(NSDictionary *)props)
|
|
1010
|
+
{
|
|
1011
|
+
[_reproImpl trackAddToCart:contentID properties:props];
|
|
1012
|
+
}
|
|
567
1013
|
|
|
568
|
-
|
|
1014
|
+
RCT_EXPORT_METHOD(trackAddToWishlist:(NSDictionary *)props)
|
|
1015
|
+
{
|
|
1016
|
+
[_reproImpl trackAddToWishlist:props];
|
|
569
1017
|
}
|
|
570
1018
|
|
|
571
|
-
RCT_EXPORT_METHOD(
|
|
1019
|
+
RCT_EXPORT_METHOD(trackInitiateCheckout:(NSDictionary *)props)
|
|
572
1020
|
{
|
|
573
|
-
|
|
1021
|
+
[_reproImpl trackInitiateCheckout:props];
|
|
1022
|
+
}
|
|
574
1023
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
1024
|
+
RCT_EXPORT_METHOD(trackAddPaymentInfo:(NSDictionary *)props)
|
|
1025
|
+
{
|
|
1026
|
+
[_reproImpl trackAddPaymentInfo:props];
|
|
1027
|
+
}
|
|
580
1028
|
|
|
581
|
-
|
|
1029
|
+
RCT_EXPORT_METHOD(trackPurchase:(NSString *)contentID value:(double)value currency:(NSString *)currency properties:(NSDictionary *)props)
|
|
1030
|
+
{
|
|
1031
|
+
[_reproImpl trackPurchase:contentID value:value currency:currency properties:props];
|
|
582
1032
|
}
|
|
583
1033
|
|
|
584
1034
|
RCT_EXPORT_METHOD(trackShare:(NSDictionary *)props)
|
|
585
1035
|
{
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
NSObject *val = nil;
|
|
589
|
-
if ((val = props[@"service_name"])) { properties.serviceName = [RCTConvert NSString:val]; }
|
|
590
|
-
if ((val = props[@"content_category"])) { properties.contentCategory = [RCTConvert NSString:val]; }
|
|
591
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
592
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
593
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
594
|
-
|
|
595
|
-
[Repro trackShare:properties];
|
|
1036
|
+
[_reproImpl trackShare:props];
|
|
596
1037
|
}
|
|
597
1038
|
|
|
598
1039
|
RCT_EXPORT_METHOD(trackLead:(NSDictionary *)props)
|
|
599
1040
|
{
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
NSObject *val = nil;
|
|
603
|
-
if ((val = props[@"value"])) { properties.value = [RCTConvert double:val]; }
|
|
604
|
-
if ((val = props[@"currency"])) { properties.currency = [RCTConvert NSString:val]; }
|
|
605
|
-
if ((val = props[@"content_category"])) { properties.contentCategory = [RCTConvert NSString:val]; }
|
|
606
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
607
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
608
|
-
|
|
609
|
-
[Repro trackLead:properties];
|
|
1041
|
+
[_reproImpl trackLead:props];
|
|
610
1042
|
}
|
|
611
1043
|
|
|
612
1044
|
RCT_EXPORT_METHOD(trackCompleteRegistration:(NSDictionary *)props)
|
|
613
1045
|
{
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
NSObject *val = nil;
|
|
617
|
-
if ((val = props[@"value"])) { properties.value = [RCTConvert double:val]; }
|
|
618
|
-
if ((val = props[@"currency"])) { properties.currency = [RCTConvert NSString:val]; }
|
|
619
|
-
if ((val = props[@"status"])) { properties.status = [RCTConvert NSString:val]; }
|
|
620
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
621
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
622
|
-
|
|
1046
|
+
[_reproImpl trackCompleteRegistration:props];
|
|
1047
|
+
}
|
|
623
1048
|
|
|
624
|
-
|
|
1049
|
+
RCT_EXPORT_METHOD(trackNotificationOpened:(NSString *)notificationId)
|
|
1050
|
+
{
|
|
1051
|
+
[_reproImpl trackNotificationOpened:notificationId];
|
|
625
1052
|
}
|
|
626
1053
|
|
|
627
1054
|
// Other
|
|
628
1055
|
|
|
629
1056
|
RCT_EXPORT_METHOD(setLogLevel:(RPRLogLevel)level)
|
|
630
1057
|
{
|
|
631
|
-
[
|
|
1058
|
+
[_reproImpl setLogLevel:level];
|
|
632
1059
|
}
|
|
633
1060
|
|
|
634
1061
|
RCT_EXPORT_METHOD(setPushDeviceTokenString:(NSString *)deviceTokenHexString)
|
|
635
1062
|
{
|
|
636
|
-
[
|
|
1063
|
+
[_reproImpl setPushDeviceTokenString:deviceTokenHexString];
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
RCT_EXPORT_METHOD(setPushRegistrationID:(NSString *)pushRegId)
|
|
1067
|
+
{
|
|
1068
|
+
[_reproImpl setPushDeviceTokenString:pushRegId];
|
|
637
1069
|
}
|
|
638
1070
|
|
|
639
|
-
RCT_EXPORT_METHOD(setPushToken:(NSString *)
|
|
1071
|
+
RCT_EXPORT_METHOD(setPushToken:(NSString *)token)
|
|
640
1072
|
{
|
|
641
|
-
[
|
|
1073
|
+
[_reproImpl setPushDeviceTokenString:token];
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
RCT_EXPORT_METHOD(enablePushNotification)
|
|
1077
|
+
{
|
|
1078
|
+
[_reproImpl enablePushNotification];
|
|
642
1079
|
}
|
|
643
1080
|
|
|
644
1081
|
// NOTE: Should better be called native from AppDelegate::didFinishLaunchingWithOptions
|
|
645
1082
|
RCT_EXPORT_METHOD(setup:(NSString *)token)
|
|
646
1083
|
{
|
|
647
|
-
[
|
|
1084
|
+
[_reproImpl setup:token];
|
|
648
1085
|
}
|
|
649
1086
|
|
|
650
1087
|
RCT_EXPORT_METHOD(enableInAppMessagesOnForegroundTransition)
|
|
651
1088
|
{
|
|
652
|
-
[
|
|
1089
|
+
[_reproImpl enableInAppMessagesOnForegroundTransition];
|
|
653
1090
|
}
|
|
654
1091
|
|
|
655
1092
|
// NOTE: Should better be called native from AppDelegate::didFinishLaunchingWithOptions if needed
|
|
656
1093
|
RCT_EXPORT_METHOD(disableInAppMessagesOnForegroundTransition)
|
|
657
1094
|
{
|
|
658
|
-
[
|
|
1095
|
+
[_reproImpl disableInAppMessagesOnForegroundTransition];
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
RCT_EXPORT_METHOD(getNewsFeeds:(double)limit callback:(RCTResponseSenderBlock)callback)
|
|
1099
|
+
{
|
|
1100
|
+
// Only New Architecture method
|
|
659
1101
|
}
|
|
660
1102
|
|
|
661
|
-
RCT_EXPORT_METHOD(
|
|
1103
|
+
RCT_EXPORT_METHOD(oldArchGetNewsFeeds:(uint64_t)limit campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
|
|
662
1104
|
{
|
|
663
1105
|
NSError *error = nil;
|
|
664
1106
|
RPRCampaignType campaignType = RPRCampaignTypeUnknown;
|
|
@@ -691,7 +1133,7 @@ RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit campaignType:(nonnull NSNumber *)
|
|
|
691
1133
|
|
|
692
1134
|
NSMutableArray *entryJsons = [NSMutableArray.alloc initWithCapacity:entries.count];
|
|
693
1135
|
|
|
694
|
-
for(RPRNewsFeedEntry *entry in entries) {
|
|
1136
|
+
for (RPRNewsFeedEntry *entry in entries) {
|
|
695
1137
|
|
|
696
1138
|
NSString *formattedDateString = [formatter stringFromDate:entry.deliveredAt];
|
|
697
1139
|
|
|
@@ -717,7 +1159,12 @@ RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit campaignType:(nonnull NSNumber *)
|
|
|
717
1159
|
callback(@[[NSNull null], safe_value(entryJsons)]);
|
|
718
1160
|
}
|
|
719
1161
|
|
|
720
|
-
RCT_EXPORT_METHOD(getNewsFeedsFor:(
|
|
1162
|
+
RCT_EXPORT_METHOD(getNewsFeedsFor:(double)limit offsetID:(double)offsetID campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
|
|
1163
|
+
{
|
|
1164
|
+
// Only New Architecture method
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
RCT_EXPORT_METHOD(oldArchGetNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
|
|
721
1168
|
{
|
|
722
1169
|
NSError *error = nil;
|
|
723
1170
|
RPRCampaignType campaignType = RPRCampaignTypeUnknown;
|
|
@@ -750,7 +1197,7 @@ RCT_EXPORT_METHOD(getNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID ca
|
|
|
750
1197
|
|
|
751
1198
|
NSMutableArray *entryJsons = [NSMutableArray.alloc initWithCapacity:entries.count];
|
|
752
1199
|
|
|
753
|
-
for(RPRNewsFeedEntry *entry in entries) {
|
|
1200
|
+
for (RPRNewsFeedEntry *entry in entries) {
|
|
754
1201
|
|
|
755
1202
|
NSString *formattedDateString = [formatter stringFromDate:entry.deliveredAt];
|
|
756
1203
|
|
|
@@ -776,11 +1223,26 @@ RCT_EXPORT_METHOD(getNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID ca
|
|
|
776
1223
|
callback(@[[NSNull null], safe_value(entryJsons)]);
|
|
777
1224
|
}
|
|
778
1225
|
|
|
1226
|
+
RCT_EXPORT_METHOD(getNewsFeedsWithCampaignType:(double)limit campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
|
|
1227
|
+
{
|
|
1228
|
+
// Only New Architecture method
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
RCT_EXPORT_METHOD(getNewsFeedsWithCampaignTypeFor:(double)limit offsetID:(double)offsetID campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
|
|
1232
|
+
{
|
|
1233
|
+
// Only New Architecture method
|
|
1234
|
+
}
|
|
1235
|
+
|
|
779
1236
|
RCT_EXPORT_METHOD(updateNewsFeeds:(NSArray<NSDictionary *> *)entryJsons callback:(RCTResponseSenderBlock)callback)
|
|
1237
|
+
{
|
|
1238
|
+
// Only New Architecture method
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
RCT_EXPORT_METHOD(oldArchUpdateNewsFeeds:(NSArray<NSDictionary *> *)entryJsons callback:(RCTResponseSenderBlock)callback)
|
|
780
1242
|
{
|
|
781
1243
|
NSMutableArray<RPRNewsFeedEntry *> *entries = [NSMutableArray.alloc initWithCapacity:entryJsons.count];
|
|
782
1244
|
|
|
783
|
-
for(NSDictionary *entryJson in entryJsons) {
|
|
1245
|
+
for (NSDictionary *entryJson in entryJsons) {
|
|
784
1246
|
RPRNewsFeedEntry *entry = [RPRNewsFeedEntry.alloc initWithDictionary: entryJson];
|
|
785
1247
|
[entries addObject:entry];
|
|
786
1248
|
}
|
|
@@ -799,32 +1261,38 @@ RCT_EXPORT_METHOD(updateNewsFeeds:(NSArray<NSDictionary *> *)entryJsons callback
|
|
|
799
1261
|
|
|
800
1262
|
RCT_EXPORT_METHOD(setSilverEggProdKey:(NSString *)silverEggProdKey)
|
|
801
1263
|
{
|
|
802
|
-
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
[Repro setSilverEggProdKey:silverEggProdKey];
|
|
1264
|
+
[_reproImpl setSilverEggProdKey:silverEggProdKey];
|
|
807
1265
|
}
|
|
808
1266
|
|
|
809
|
-
|
|
810
1267
|
RCT_EXPORT_METHOD(setSilverEggCookie:(NSString *)silverEggCookie)
|
|
811
1268
|
{
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
}
|
|
1269
|
+
[_reproImpl setSilverEggCookie:silverEggCookie];
|
|
1270
|
+
}
|
|
815
1271
|
|
|
816
|
-
|
|
1272
|
+
RCT_EXPORT_METHOD(linkLineID:(NSString *)lineUserId lineChannelId:(NSString *)lineChannelId)
|
|
1273
|
+
{
|
|
1274
|
+
[_reproImpl linkLineID:lineUserId lineChannelID:lineChannelId];
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
RCT_EXPORT_METHOD(unlinkLineID:(NSString *)lineUserId lineChannelId:(NSString *)lineChannelId)
|
|
1278
|
+
{
|
|
1279
|
+
[_reproImpl unlinkLineID:lineUserId lineChannelID:lineChannelId];
|
|
817
1280
|
}
|
|
818
1281
|
|
|
819
|
-
RCT_EXPORT_METHOD(
|
|
1282
|
+
RCT_EXPORT_METHOD(_handleWebViewUrl:(NSString *)webViewRequestUrl)
|
|
820
1283
|
{
|
|
821
|
-
[
|
|
1284
|
+
[_reproImpl _webviewJavaScriptOpenUrlHandler:webViewRequestUrl];
|
|
822
1285
|
}
|
|
823
1286
|
|
|
824
|
-
|
|
1287
|
+
#endif
|
|
1288
|
+
|
|
1289
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
1290
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
1291
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
825
1292
|
{
|
|
826
|
-
|
|
1293
|
+
return std::make_shared<facebook::react::NativeReproReactBridgeSpecJSI>(params);
|
|
827
1294
|
}
|
|
1295
|
+
#endif
|
|
828
1296
|
|
|
829
1297
|
@end
|
|
830
1298
|
|
|
@@ -832,7 +1300,7 @@ RCT_EXPORT_METHOD(unlinkLineID:(NSString *)lineUserId lineChannelID:(NSString *)
|
|
|
832
1300
|
|
|
833
1301
|
@implementation RPREventEmitterOpenUrl
|
|
834
1302
|
|
|
835
|
-
RCT_EXPORT_MODULE()
|
|
1303
|
+
RCT_EXPORT_MODULE(ReproEventEmitterOpenUrl)
|
|
836
1304
|
|
|
837
1305
|
- (NSArray<NSString*> *)supportedEvents
|
|
838
1306
|
{
|
|
@@ -851,7 +1319,14 @@ RCT_EXPORT_MODULE()
|
|
|
851
1319
|
[Repro setOpenUrlCallback:nil];
|
|
852
1320
|
}
|
|
853
1321
|
|
|
854
|
-
|
|
1322
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
1323
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
1324
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
1325
|
+
{
|
|
1326
|
+
return std::make_shared<facebook::react::NativeReproEventEmitterOpenUrlSpecJSI>(params);
|
|
1327
|
+
}
|
|
1328
|
+
#endif
|
|
855
1329
|
|
|
1330
|
+
@end
|
|
856
1331
|
|
|
857
1332
|
|