react-native-repro 3.24.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} +262 -70
- 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 +44 -232
- package/ios/RPRReproReactBridge.h +19 -4
- package/ios/{RPRReproReactBridge.m → RPRReproReactBridge.mm} +660 -193
- 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
|
|
|
@@ -265,7 +320,6 @@ RCT_EXPORT_METHOD(forceReset)
|
|
|
265
320
|
|
|
266
321
|
@interface Repro (NonPublicApi)
|
|
267
322
|
+ (void)_passRuntimeValues:(nonnull NSDictionary<NSString *, NSString *> *)values;
|
|
268
|
-
+ (BOOL)_webviewJavaScriptOpenUrlHandler:(NSString *)url;
|
|
269
323
|
@end
|
|
270
324
|
|
|
271
325
|
|
|
@@ -295,10 +349,18 @@ static NSString *get_react_native_version()
|
|
|
295
349
|
|
|
296
350
|
|
|
297
351
|
@implementation RPRReproReactBridge
|
|
352
|
+
{
|
|
353
|
+
RPRReproReactBridgeImpl *_reproImpl;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
RCT_EXPORT_MODULE(ReproReactBridgeModule)
|
|
298
357
|
|
|
299
358
|
- (instancetype)init
|
|
300
359
|
{
|
|
301
360
|
self = [super init];
|
|
361
|
+
if (self) {
|
|
362
|
+
_reproImpl = [[RPRReproReactBridgeImpl alloc] init];
|
|
363
|
+
}
|
|
302
364
|
|
|
303
365
|
if ([Repro respondsToSelector:@selector(_passRuntimeValues:)]) {
|
|
304
366
|
[Repro _passRuntimeValues:@{
|
|
@@ -313,9 +375,6 @@ static NSString *get_react_native_version()
|
|
|
313
375
|
return self;
|
|
314
376
|
}
|
|
315
377
|
|
|
316
|
-
|
|
317
|
-
RCT_EXPORT_MODULE(Repro)
|
|
318
|
-
|
|
319
378
|
- (NSDictionary *)constantsToExport
|
|
320
379
|
{
|
|
321
380
|
return @{
|
|
@@ -389,284 +448,659 @@ RCT_EXPORT_MODULE(Repro)
|
|
|
389
448
|
};
|
|
390
449
|
};
|
|
391
450
|
|
|
451
|
+
- (NSDictionary *)getConstants
|
|
452
|
+
{
|
|
453
|
+
return [self constantsToExport];
|
|
454
|
+
}
|
|
455
|
+
|
|
392
456
|
+ (BOOL)requiresMainQueueSetup
|
|
393
457
|
{
|
|
394
458
|
return YES; // needed because we override `constantsToExport`
|
|
395
459
|
}
|
|
396
460
|
|
|
397
461
|
|
|
462
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
463
|
+
|
|
398
464
|
// Opt In / Opt Out
|
|
399
465
|
|
|
400
|
-
|
|
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
|
|
479
|
+
{
|
|
480
|
+
[_reproImpl getUserID:callback];
|
|
481
|
+
}
|
|
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
|
+
}
|
|
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
|
|
401
564
|
{
|
|
402
|
-
[
|
|
565
|
+
[_reproImpl incrementDoubleUserProfileBy:key value:value];
|
|
403
566
|
}
|
|
404
567
|
|
|
568
|
+
- (void)decrementDoubleUserProfileBy:(NSString *)key value:(double)value
|
|
569
|
+
{
|
|
570
|
+
[_reproImpl decrementDoubleUserProfileBy:key value:value];
|
|
571
|
+
}
|
|
405
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
|
+
}
|
|
406
822
|
|
|
407
823
|
// User profile
|
|
408
824
|
|
|
409
825
|
RCT_EXPORT_METHOD(setUserID:(NSString *)userID)
|
|
410
826
|
{
|
|
411
|
-
[
|
|
827
|
+
[_reproImpl setUserID:userID];
|
|
412
828
|
}
|
|
413
829
|
|
|
414
830
|
RCT_EXPORT_METHOD(getUserID:(RCTResponseSenderBlock)callback)
|
|
415
831
|
{
|
|
416
|
-
|
|
832
|
+
[_reproImpl getUserID:callback];
|
|
417
833
|
}
|
|
418
834
|
|
|
419
835
|
RCT_EXPORT_METHOD(getDeviceID:(RCTResponseSenderBlock)callback)
|
|
420
836
|
{
|
|
421
|
-
|
|
837
|
+
[_reproImpl getDeviceID:callback];
|
|
422
838
|
}
|
|
423
839
|
|
|
424
840
|
RCT_EXPORT_METHOD(setStringUserProfile:(NSString *)key value:(NSString *)value)
|
|
425
841
|
{
|
|
426
|
-
[
|
|
842
|
+
[_reproImpl setStringUserProfile:key value:value];
|
|
427
843
|
}
|
|
428
844
|
|
|
429
845
|
RCT_EXPORT_METHOD(setIntUserProfile:(NSString *)key value:(NSInteger)value)
|
|
430
846
|
{
|
|
431
|
-
[
|
|
847
|
+
[_reproImpl setIntUserProfile:key value:value];
|
|
432
848
|
}
|
|
433
849
|
|
|
434
850
|
RCT_EXPORT_METHOD(setDoubleUserProfile:(NSString *)key value:(double)value)
|
|
435
851
|
{
|
|
436
|
-
[
|
|
852
|
+
[_reproImpl setDoubleUserProfile:key value:value];
|
|
437
853
|
}
|
|
438
854
|
|
|
439
855
|
RCT_EXPORT_METHOD(setDateUserProfile:(NSString *)key value:(NSDate *)value)
|
|
440
856
|
{
|
|
441
|
-
[
|
|
857
|
+
[_reproImpl setDateUserProfile:key value:value];
|
|
442
858
|
}
|
|
443
859
|
|
|
444
860
|
RCT_EXPORT_METHOD(setUserGender:(RPRUserProfileGender)value)
|
|
445
861
|
{
|
|
446
|
-
[
|
|
862
|
+
[_reproImpl setUserGender:value];
|
|
447
863
|
}
|
|
448
864
|
|
|
449
865
|
RCT_EXPORT_METHOD(setUserEmailAddress:(NSString *)value)
|
|
450
866
|
{
|
|
451
|
-
[
|
|
867
|
+
[_reproImpl setUserEmailAddress:value];
|
|
452
868
|
}
|
|
453
869
|
|
|
454
870
|
RCT_EXPORT_METHOD(setUserResidencePrefecture:(RPRUserProfilePrefecture)value)
|
|
455
871
|
{
|
|
456
|
-
[
|
|
872
|
+
[_reproImpl setUserResidencePrefecture:value];
|
|
457
873
|
}
|
|
458
874
|
|
|
459
875
|
RCT_EXPORT_METHOD(setUserDateOfBirth:(NSDate *)value)
|
|
460
876
|
{
|
|
461
|
-
[
|
|
877
|
+
[_reproImpl setUserDateOfBirth:value];
|
|
462
878
|
}
|
|
463
879
|
|
|
464
880
|
RCT_EXPORT_METHOD(setUserAge:(NSInteger)value)
|
|
465
881
|
{
|
|
466
|
-
[
|
|
882
|
+
[_reproImpl setUserAge:value];
|
|
467
883
|
}
|
|
468
884
|
|
|
885
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentStringUserProfile:(NSString *)key value:(NSString *)value)
|
|
886
|
+
{
|
|
887
|
+
[_reproImpl onlySetIfAbsentStringUserProfile:key value:value];
|
|
888
|
+
}
|
|
469
889
|
|
|
470
|
-
|
|
890
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentIntUserProfile:(NSString *)key value:(NSInteger)value)
|
|
891
|
+
{
|
|
892
|
+
[_reproImpl onlySetIfAbsentIntUserProfile:key value:value];
|
|
893
|
+
}
|
|
471
894
|
|
|
472
|
-
RCT_EXPORT_METHOD(
|
|
895
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentDoubleUserProfile:(NSString *)key value:(double)value)
|
|
473
896
|
{
|
|
474
|
-
[
|
|
897
|
+
[_reproImpl onlySetIfAbsentDoubleUserProfile:key value:value];
|
|
475
898
|
}
|
|
476
899
|
|
|
900
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentDateUserProfile:(NSString *)key value:(NSDate *)value)
|
|
901
|
+
{
|
|
902
|
+
[_reproImpl onlySetIfAbsentDateUserProfile:key value:value];
|
|
903
|
+
}
|
|
477
904
|
|
|
905
|
+
RCT_EXPORT_METHOD(incrementIntUserProfileBy:(NSString *)key value:(NSInteger)value)
|
|
906
|
+
{
|
|
907
|
+
[_reproImpl incrementIntUserProfileBy:key value:value];
|
|
908
|
+
}
|
|
478
909
|
|
|
479
|
-
|
|
910
|
+
RCT_EXPORT_METHOD(decrementIntUserProfileBy:(NSString *)key value:(NSInteger)value)
|
|
911
|
+
{
|
|
912
|
+
[_reproImpl decrementIntUserProfileBy:key value:value];
|
|
913
|
+
}
|
|
480
914
|
|
|
481
|
-
RCT_EXPORT_METHOD(
|
|
915
|
+
RCT_EXPORT_METHOD(incrementDoubleUserProfileBy:(NSString *)key value:(double)value)
|
|
482
916
|
{
|
|
483
|
-
|
|
917
|
+
[_reproImpl incrementDoubleUserProfileBy:key value:value];
|
|
918
|
+
}
|
|
484
919
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
490
|
-
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
|
+
}
|
|
491
924
|
|
|
492
|
-
|
|
925
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserGender:(RPRUserProfileGender)value)
|
|
926
|
+
{
|
|
927
|
+
[_reproImpl onlySetIfAbsentUserGender:value];
|
|
493
928
|
}
|
|
494
929
|
|
|
495
|
-
RCT_EXPORT_METHOD(
|
|
930
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserEmailAddress:(NSString *)value)
|
|
496
931
|
{
|
|
497
|
-
|
|
932
|
+
[_reproImpl onlySetIfAbsentUserEmailAddress:value];
|
|
933
|
+
}
|
|
498
934
|
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
504
|
-
if ((val = props[@"search_string"])) { properties.searchString = [RCTConvert NSString:val]; }
|
|
505
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
935
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserResidencePrefecture:(RPRUserProfilePrefecture)value)
|
|
936
|
+
{
|
|
937
|
+
[_reproImpl onlySetIfAbsentUserResidencePrefecture:value];
|
|
938
|
+
}
|
|
506
939
|
|
|
507
|
-
|
|
940
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserDateOfBirth:(NSDate *)value)
|
|
941
|
+
{
|
|
942
|
+
[_reproImpl onlySetIfAbsentUserDateOfBirth:value];
|
|
508
943
|
}
|
|
509
944
|
|
|
945
|
+
RCT_EXPORT_METHOD(onlySetIfAbsentUserAge:(NSInteger)value)
|
|
946
|
+
{
|
|
947
|
+
[_reproImpl onlySetIfAbsentUserAge:value];
|
|
948
|
+
}
|
|
510
949
|
|
|
950
|
+
RCT_EXPORT_METHOD(incrementUserAgeBy:(NSInteger)value)
|
|
951
|
+
{
|
|
952
|
+
[_reproImpl incrementUserAgeBy:value];
|
|
953
|
+
}
|
|
511
954
|
|
|
512
|
-
RCT_EXPORT_METHOD(
|
|
955
|
+
RCT_EXPORT_METHOD(decrementUserAgeBy:(NSInteger)value)
|
|
513
956
|
{
|
|
514
|
-
|
|
957
|
+
[_reproImpl decrementUserAgeBy:value];
|
|
958
|
+
}
|
|
515
959
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
521
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
960
|
+
RCT_EXPORT_METHOD(deleteUserProfile:(NSString *)key)
|
|
961
|
+
{
|
|
962
|
+
[_reproImpl deleteUserProfile:key];
|
|
963
|
+
}
|
|
522
964
|
|
|
523
|
-
|
|
965
|
+
RCT_EXPORT_METHOD(deleteUserGender)
|
|
966
|
+
{
|
|
967
|
+
[_reproImpl deleteUserGender];
|
|
524
968
|
}
|
|
525
969
|
|
|
970
|
+
RCT_EXPORT_METHOD(deleteUserEmailAddress)
|
|
971
|
+
{
|
|
972
|
+
[_reproImpl deleteUserEmailAddress];
|
|
973
|
+
}
|
|
526
974
|
|
|
527
|
-
RCT_EXPORT_METHOD(
|
|
975
|
+
RCT_EXPORT_METHOD(deleteUserResidencePrefecture)
|
|
528
976
|
{
|
|
529
|
-
|
|
977
|
+
[_reproImpl deleteUserResidencePrefecture];
|
|
978
|
+
}
|
|
530
979
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
536
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
537
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
980
|
+
RCT_EXPORT_METHOD(deleteUserDateOfBirth)
|
|
981
|
+
{
|
|
982
|
+
[_reproImpl deleteUserDateOfBirth];
|
|
983
|
+
}
|
|
538
984
|
|
|
539
|
-
|
|
985
|
+
RCT_EXPORT_METHOD(deleteUserAge)
|
|
986
|
+
{
|
|
987
|
+
[_reproImpl deleteUserAge];
|
|
540
988
|
}
|
|
541
989
|
|
|
542
|
-
|
|
990
|
+
// Custom event tracking
|
|
991
|
+
|
|
992
|
+
RCT_EXPORT_METHOD(track:(NSString *)eventName properties:(NSDictionary *)props)
|
|
543
993
|
{
|
|
544
|
-
|
|
994
|
+
[_reproImpl track:eventName properties:props];
|
|
995
|
+
}
|
|
545
996
|
|
|
546
|
-
|
|
547
|
-
if ((val = props[@"value"])) { properties.value = [RCTConvert double:val]; }
|
|
548
|
-
if ((val = props[@"currency"])) { properties.currency = [RCTConvert NSString:val]; }
|
|
549
|
-
if ((val = props[@"content_category"])) { properties.contentCategory = [RCTConvert NSString:val]; }
|
|
550
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
551
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
552
|
-
if ((val = props[@"num_items"])) { properties.numItems = [RCTConvert NSInteger:val]; }
|
|
553
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
997
|
+
// Standard event tracking
|
|
554
998
|
|
|
555
|
-
|
|
999
|
+
RCT_EXPORT_METHOD(trackViewContent:(NSString *)contentID properties:(NSDictionary *)props)
|
|
1000
|
+
{
|
|
1001
|
+
[_reproImpl trackViewContent:contentID properties:props];
|
|
556
1002
|
}
|
|
557
1003
|
|
|
558
|
-
RCT_EXPORT_METHOD(
|
|
1004
|
+
RCT_EXPORT_METHOD(trackSearch:(NSDictionary *)props)
|
|
559
1005
|
{
|
|
560
|
-
|
|
1006
|
+
[_reproImpl trackSearch:props];
|
|
1007
|
+
}
|
|
561
1008
|
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
567
|
-
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
|
+
}
|
|
568
1013
|
|
|
569
|
-
|
|
1014
|
+
RCT_EXPORT_METHOD(trackAddToWishlist:(NSDictionary *)props)
|
|
1015
|
+
{
|
|
1016
|
+
[_reproImpl trackAddToWishlist:props];
|
|
570
1017
|
}
|
|
571
1018
|
|
|
572
|
-
RCT_EXPORT_METHOD(
|
|
1019
|
+
RCT_EXPORT_METHOD(trackInitiateCheckout:(NSDictionary *)props)
|
|
573
1020
|
{
|
|
574
|
-
|
|
1021
|
+
[_reproImpl trackInitiateCheckout:props];
|
|
1022
|
+
}
|
|
575
1023
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
1024
|
+
RCT_EXPORT_METHOD(trackAddPaymentInfo:(NSDictionary *)props)
|
|
1025
|
+
{
|
|
1026
|
+
[_reproImpl trackAddPaymentInfo:props];
|
|
1027
|
+
}
|
|
581
1028
|
|
|
582
|
-
|
|
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];
|
|
583
1032
|
}
|
|
584
1033
|
|
|
585
1034
|
RCT_EXPORT_METHOD(trackShare:(NSDictionary *)props)
|
|
586
1035
|
{
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
NSObject *val = nil;
|
|
590
|
-
if ((val = props[@"service_name"])) { properties.serviceName = [RCTConvert NSString:val]; }
|
|
591
|
-
if ((val = props[@"content_category"])) { properties.contentCategory = [RCTConvert NSString:val]; }
|
|
592
|
-
if ((val = props[@"content_id"])) { properties.contentID = [RCTConvert NSString:val]; }
|
|
593
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
594
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
595
|
-
|
|
596
|
-
[Repro trackShare:properties];
|
|
1036
|
+
[_reproImpl trackShare:props];
|
|
597
1037
|
}
|
|
598
1038
|
|
|
599
1039
|
RCT_EXPORT_METHOD(trackLead:(NSDictionary *)props)
|
|
600
1040
|
{
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
NSObject *val = nil;
|
|
604
|
-
if ((val = props[@"value"])) { properties.value = [RCTConvert double:val]; }
|
|
605
|
-
if ((val = props[@"currency"])) { properties.currency = [RCTConvert NSString:val]; }
|
|
606
|
-
if ((val = props[@"content_category"])) { properties.contentCategory = [RCTConvert NSString:val]; }
|
|
607
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
608
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
609
|
-
|
|
610
|
-
[Repro trackLead:properties];
|
|
1041
|
+
[_reproImpl trackLead:props];
|
|
611
1042
|
}
|
|
612
1043
|
|
|
613
1044
|
RCT_EXPORT_METHOD(trackCompleteRegistration:(NSDictionary *)props)
|
|
614
1045
|
{
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
NSObject *val = nil;
|
|
618
|
-
if ((val = props[@"value"])) { properties.value = [RCTConvert double:val]; }
|
|
619
|
-
if ((val = props[@"currency"])) { properties.currency = [RCTConvert NSString:val]; }
|
|
620
|
-
if ((val = props[@"status"])) { properties.status = [RCTConvert NSString:val]; }
|
|
621
|
-
if ((val = props[@"content_name"])) { properties.contentName = [RCTConvert NSString:val]; }
|
|
622
|
-
if ((val = props[@"extras"])) { properties.extras = [RCTConvert NSDictionary:val]; }
|
|
623
|
-
|
|
1046
|
+
[_reproImpl trackCompleteRegistration:props];
|
|
1047
|
+
}
|
|
624
1048
|
|
|
625
|
-
|
|
1049
|
+
RCT_EXPORT_METHOD(trackNotificationOpened:(NSString *)notificationId)
|
|
1050
|
+
{
|
|
1051
|
+
[_reproImpl trackNotificationOpened:notificationId];
|
|
626
1052
|
}
|
|
627
1053
|
|
|
628
1054
|
// Other
|
|
629
1055
|
|
|
1056
|
+
RCT_EXPORT_METHOD(setLogLevel:(RPRLogLevel)level)
|
|
1057
|
+
{
|
|
1058
|
+
[_reproImpl setLogLevel:level];
|
|
1059
|
+
}
|
|
630
1060
|
|
|
631
|
-
RCT_EXPORT_METHOD(
|
|
1061
|
+
RCT_EXPORT_METHOD(setPushDeviceTokenString:(NSString *)deviceTokenHexString)
|
|
632
1062
|
{
|
|
633
|
-
|
|
634
|
-
[Repro _webviewJavaScriptOpenUrlHandler:webViewRequestUrl];
|
|
1063
|
+
[_reproImpl setPushDeviceTokenString:deviceTokenHexString];
|
|
635
1064
|
}
|
|
636
1065
|
|
|
637
|
-
RCT_EXPORT_METHOD(
|
|
1066
|
+
RCT_EXPORT_METHOD(setPushRegistrationID:(NSString *)pushRegId)
|
|
638
1067
|
{
|
|
639
|
-
[
|
|
1068
|
+
[_reproImpl setPushDeviceTokenString:pushRegId];
|
|
640
1069
|
}
|
|
641
1070
|
|
|
642
|
-
RCT_EXPORT_METHOD(
|
|
1071
|
+
RCT_EXPORT_METHOD(setPushToken:(NSString *)token)
|
|
643
1072
|
{
|
|
644
|
-
[
|
|
1073
|
+
[_reproImpl setPushDeviceTokenString:token];
|
|
645
1074
|
}
|
|
646
1075
|
|
|
647
|
-
RCT_EXPORT_METHOD(
|
|
1076
|
+
RCT_EXPORT_METHOD(enablePushNotification)
|
|
648
1077
|
{
|
|
649
|
-
[
|
|
1078
|
+
[_reproImpl enablePushNotification];
|
|
650
1079
|
}
|
|
651
1080
|
|
|
652
1081
|
// NOTE: Should better be called native from AppDelegate::didFinishLaunchingWithOptions
|
|
653
1082
|
RCT_EXPORT_METHOD(setup:(NSString *)token)
|
|
654
1083
|
{
|
|
655
|
-
[
|
|
1084
|
+
[_reproImpl setup:token];
|
|
656
1085
|
}
|
|
657
1086
|
|
|
658
1087
|
RCT_EXPORT_METHOD(enableInAppMessagesOnForegroundTransition)
|
|
659
1088
|
{
|
|
660
|
-
[
|
|
1089
|
+
[_reproImpl enableInAppMessagesOnForegroundTransition];
|
|
661
1090
|
}
|
|
662
1091
|
|
|
663
1092
|
// NOTE: Should better be called native from AppDelegate::didFinishLaunchingWithOptions if needed
|
|
664
1093
|
RCT_EXPORT_METHOD(disableInAppMessagesOnForegroundTransition)
|
|
665
1094
|
{
|
|
666
|
-
[
|
|
1095
|
+
[_reproImpl disableInAppMessagesOnForegroundTransition];
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
RCT_EXPORT_METHOD(getNewsFeeds:(double)limit callback:(RCTResponseSenderBlock)callback)
|
|
1099
|
+
{
|
|
1100
|
+
// Only New Architecture method
|
|
667
1101
|
}
|
|
668
1102
|
|
|
669
|
-
RCT_EXPORT_METHOD(
|
|
1103
|
+
RCT_EXPORT_METHOD(oldArchGetNewsFeeds:(uint64_t)limit campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
|
|
670
1104
|
{
|
|
671
1105
|
NSError *error = nil;
|
|
672
1106
|
RPRCampaignType campaignType = RPRCampaignTypeUnknown;
|
|
@@ -699,7 +1133,7 @@ RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit campaignType:(nonnull NSNumber *)
|
|
|
699
1133
|
|
|
700
1134
|
NSMutableArray *entryJsons = [NSMutableArray.alloc initWithCapacity:entries.count];
|
|
701
1135
|
|
|
702
|
-
for(RPRNewsFeedEntry *entry in entries) {
|
|
1136
|
+
for (RPRNewsFeedEntry *entry in entries) {
|
|
703
1137
|
|
|
704
1138
|
NSString *formattedDateString = [formatter stringFromDate:entry.deliveredAt];
|
|
705
1139
|
|
|
@@ -725,7 +1159,12 @@ RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit campaignType:(nonnull NSNumber *)
|
|
|
725
1159
|
callback(@[[NSNull null], safe_value(entryJsons)]);
|
|
726
1160
|
}
|
|
727
1161
|
|
|
728
|
-
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)
|
|
729
1168
|
{
|
|
730
1169
|
NSError *error = nil;
|
|
731
1170
|
RPRCampaignType campaignType = RPRCampaignTypeUnknown;
|
|
@@ -758,7 +1197,7 @@ RCT_EXPORT_METHOD(getNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID ca
|
|
|
758
1197
|
|
|
759
1198
|
NSMutableArray *entryJsons = [NSMutableArray.alloc initWithCapacity:entries.count];
|
|
760
1199
|
|
|
761
|
-
for(RPRNewsFeedEntry *entry in entries) {
|
|
1200
|
+
for (RPRNewsFeedEntry *entry in entries) {
|
|
762
1201
|
|
|
763
1202
|
NSString *formattedDateString = [formatter stringFromDate:entry.deliveredAt];
|
|
764
1203
|
|
|
@@ -784,11 +1223,26 @@ RCT_EXPORT_METHOD(getNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID ca
|
|
|
784
1223
|
callback(@[[NSNull null], safe_value(entryJsons)]);
|
|
785
1224
|
}
|
|
786
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
|
+
|
|
787
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)
|
|
788
1242
|
{
|
|
789
1243
|
NSMutableArray<RPRNewsFeedEntry *> *entries = [NSMutableArray.alloc initWithCapacity:entryJsons.count];
|
|
790
1244
|
|
|
791
|
-
for(NSDictionary *entryJson in entryJsons) {
|
|
1245
|
+
for (NSDictionary *entryJson in entryJsons) {
|
|
792
1246
|
RPRNewsFeedEntry *entry = [RPRNewsFeedEntry.alloc initWithDictionary: entryJson];
|
|
793
1247
|
[entries addObject:entry];
|
|
794
1248
|
}
|
|
@@ -807,32 +1261,38 @@ RCT_EXPORT_METHOD(updateNewsFeeds:(NSArray<NSDictionary *> *)entryJsons callback
|
|
|
807
1261
|
|
|
808
1262
|
RCT_EXPORT_METHOD(setSilverEggProdKey:(NSString *)silverEggProdKey)
|
|
809
1263
|
{
|
|
810
|
-
|
|
811
|
-
return;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
[Repro setSilverEggProdKey:silverEggProdKey];
|
|
1264
|
+
[_reproImpl setSilverEggProdKey:silverEggProdKey];
|
|
815
1265
|
}
|
|
816
1266
|
|
|
817
|
-
|
|
818
1267
|
RCT_EXPORT_METHOD(setSilverEggCookie:(NSString *)silverEggCookie)
|
|
819
1268
|
{
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
1269
|
+
[_reproImpl setSilverEggCookie:silverEggCookie];
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
RCT_EXPORT_METHOD(linkLineID:(NSString *)lineUserId lineChannelId:(NSString *)lineChannelId)
|
|
1273
|
+
{
|
|
1274
|
+
[_reproImpl linkLineID:lineUserId lineChannelID:lineChannelId];
|
|
1275
|
+
}
|
|
823
1276
|
|
|
824
|
-
|
|
1277
|
+
RCT_EXPORT_METHOD(unlinkLineID:(NSString *)lineUserId lineChannelId:(NSString *)lineChannelId)
|
|
1278
|
+
{
|
|
1279
|
+
[_reproImpl unlinkLineID:lineUserId lineChannelID:lineChannelId];
|
|
825
1280
|
}
|
|
826
1281
|
|
|
827
|
-
RCT_EXPORT_METHOD(
|
|
1282
|
+
RCT_EXPORT_METHOD(_handleWebViewUrl:(NSString *)webViewRequestUrl)
|
|
828
1283
|
{
|
|
829
|
-
[
|
|
1284
|
+
[_reproImpl _webviewJavaScriptOpenUrlHandler:webViewRequestUrl];
|
|
830
1285
|
}
|
|
831
1286
|
|
|
832
|
-
|
|
1287
|
+
#endif
|
|
1288
|
+
|
|
1289
|
+
#if RCT_NEW_ARCH_ENABLED
|
|
1290
|
+
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
1291
|
+
(const facebook::react::ObjCTurboModule::InitParams &)params
|
|
833
1292
|
{
|
|
834
|
-
|
|
1293
|
+
return std::make_shared<facebook::react::NativeReproReactBridgeSpecJSI>(params);
|
|
835
1294
|
}
|
|
1295
|
+
#endif
|
|
836
1296
|
|
|
837
1297
|
@end
|
|
838
1298
|
|
|
@@ -840,7 +1300,7 @@ RCT_EXPORT_METHOD(unlinkLineID:(NSString *)lineUserId lineChannelID:(NSString *)
|
|
|
840
1300
|
|
|
841
1301
|
@implementation RPREventEmitterOpenUrl
|
|
842
1302
|
|
|
843
|
-
RCT_EXPORT_MODULE()
|
|
1303
|
+
RCT_EXPORT_MODULE(ReproEventEmitterOpenUrl)
|
|
844
1304
|
|
|
845
1305
|
- (NSArray<NSString*> *)supportedEvents
|
|
846
1306
|
{
|
|
@@ -859,7 +1319,14 @@ RCT_EXPORT_MODULE()
|
|
|
859
1319
|
[Repro setOpenUrlCallback:nil];
|
|
860
1320
|
}
|
|
861
1321
|
|
|
862
|
-
|
|
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
|
|
863
1329
|
|
|
1330
|
+
@end
|
|
864
1331
|
|
|
865
1332
|
|