react-native-repro 3.5.0 → 3.8.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.
Files changed (39) hide show
  1. package/React-Repro.podspec +4 -6
  2. package/android/src/main/java/io/repro/android/reactbridge/ReproReactBridgeModule.java +89 -4
  3. package/index.js +41 -3
  4. package/ios/RPRReproReactBridge.h +5 -0
  5. package/ios/RPRReproReactBridge.m +126 -6
  6. package/package.json +2 -2
  7. package/repro-version.json +3 -3
  8. package/sdk-android/io/repro/repro-android-sdk/6f405c6587220d5bebed9ae377d69cd272338679/repro-android-sdk-5.6.3.aar +0 -0
  9. package/sdk-android/io/repro/repro-android-sdk/6f405c6587220d5bebed9ae377d69cd272338679/repro-android-sdk-5.6.3.aar.md5 +1 -0
  10. package/sdk-android/io/repro/repro-android-sdk/6f405c6587220d5bebed9ae377d69cd272338679/repro-android-sdk-5.6.3.aar.sha1 +1 -0
  11. package/sdk-android/io/repro/repro-android-sdk/{5.5.1/repro-android-sdk-5.5.1.pom → 6f405c6587220d5bebed9ae377d69cd272338679/repro-android-sdk-5.6.3.pom} +1 -1
  12. package/sdk-android/io/repro/repro-android-sdk/6f405c6587220d5bebed9ae377d69cd272338679/repro-android-sdk-5.6.3.pom.md5 +1 -0
  13. package/sdk-android/io/repro/repro-android-sdk/6f405c6587220d5bebed9ae377d69cd272338679/repro-android-sdk-5.6.3.pom.sha1 +1 -0
  14. package/sdk-android/io/repro/repro-android-sdk/maven-metadata.xml +3 -3
  15. package/sdk-android/io/repro/repro-android-sdk/maven-metadata.xml.md5 +1 -1
  16. package/sdk-android/io/repro/repro-android-sdk/maven-metadata.xml.sha1 +1 -1
  17. package/sdk-ios/Repro.xcframework/Info.plist +43 -0
  18. package/sdk-ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPREventProperties.h +0 -0
  19. package/sdk-ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPRNewsFeedEntry.h +11 -0
  20. package/sdk-ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPRRemoteConfig.h +2 -2
  21. package/sdk-ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPRUserProfileGender.h +0 -0
  22. package/sdk-ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/Repro.h +11 -0
  23. package/sdk-ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Info.plist +0 -0
  24. package/sdk-ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Modules/module.modulemap +0 -0
  25. package/sdk-ios/Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework/Repro +0 -0
  26. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPREventProperties.h +90 -0
  27. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPRNewsFeedEntry.h +40 -0
  28. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPRRemoteConfig.h +119 -0
  29. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPRUserProfileGender.h +14 -0
  30. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/Repro.h +166 -0
  31. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Info.plist +0 -0
  32. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Modules/module.modulemap +6 -0
  33. package/sdk-ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Repro +0 -0
  34. package/sdk-android/io/repro/repro-android-sdk/5.5.1/repro-android-sdk-5.5.1.aar +0 -0
  35. package/sdk-android/io/repro/repro-android-sdk/5.5.1/repro-android-sdk-5.5.1.aar.md5 +0 -1
  36. package/sdk-android/io/repro/repro-android-sdk/5.5.1/repro-android-sdk-5.5.1.aar.sha1 +0 -1
  37. package/sdk-android/io/repro/repro-android-sdk/5.5.1/repro-android-sdk-5.5.1.pom.md5 +0 -1
  38. package/sdk-android/io/repro/repro-android-sdk/5.5.1/repro-android-sdk-5.5.1.pom.sha1 +0 -1
  39. package/sdk-ios/Repro.framework/Repro +0 -0
@@ -10,16 +10,14 @@ Pod::Spec.new do |s|
10
10
  s.license = "See ./LICENSE"
11
11
 
12
12
  s.author = { package["author"]["name"] => package["author"]["email"] }
13
- s.platforms = { :ios => "9.0", :tvos => "9.0" }
13
+ s.platforms = { :ios => "10.0" }
14
14
  s.source = { :git => "https://github.com/reproio/repro-ios-sdk", :tag => "local_link_only" }
15
15
 
16
- s.public_header_files = "sdk-ios/Repro.framework/Headers/*.h"
17
- s.source_files = "sdk-ios/Repro.framework/Headers/*.h", "ios/*.{h,m}"
16
+ s.source_files = "ios/*.{h,m}"
18
17
 
19
- s.vendored_frameworks = "sdk-ios/Repro.framework"
18
+ s.vendored_frameworks = "sdk-ios/Repro.xcframework"
20
19
 
21
- s.frameworks = 'CoreTelephony', 'MobileCoreServices', 'Security', 'SystemConfiguration', 'WebKit'
22
- s.libraries = 'z'
20
+ s.frameworks = 'UIKit', 'CoreGraphics', 'QuartzCore', 'SystemConfiguration', 'WebKit', 'UserNotifications'
23
21
 
24
22
  s.dependency "React"
25
23
  end
@@ -14,8 +14,12 @@ import com.facebook.react.bridge.WritableArray;
14
14
  import com.facebook.react.bridge.WritableNativeArray;
15
15
  import com.facebook.react.bridge.ReadableArray;
16
16
  import com.facebook.react.bridge.Arguments;
17
+ import com.facebook.react.modules.systeminfo.ReactNativeVersion;
17
18
 
19
+ import java.lang.reflect.Method;
20
+ import java.util.EnumSet;
18
21
  import java.util.HashMap;
22
+ import java.util.Iterator;
19
23
  import java.util.Map;
20
24
  import java.util.ArrayList;
21
25
  import java.util.List;
@@ -26,6 +30,7 @@ import java.util.Date;
26
30
  import org.json.JSONObject;
27
31
 
28
32
  import io.repro.android.Repro;
33
+ import io.repro.android.newsfeed.NewsFeedCampaignType;
29
34
  import io.repro.android.tracking.AddPaymentInfoProperties;
30
35
  import io.repro.android.tracking.AddToCartProperties;
31
36
  import io.repro.android.tracking.AddToWishlistProperties;
@@ -46,11 +51,51 @@ public class ReproReactBridgeModule extends ReactContextBaseJavaModule {
46
51
  public static final int GENDER_MALE = 1;
47
52
  public static final int GENDER_FEMALE = 2;
48
53
 
54
+ public static final int CAMPAIGN_TYPE_UNKNOWN = 0;
55
+ public static final int CAMPAIGN_TYPE_PUSH_NOTIFICATION = (1 << 0);
56
+ public static final int CAMPAIGN_TYPE_IN_APP_MESSAGE = (1 << 1);
57
+ public static final int CAMPAIGN_TYPE_WEB_MESSAGE = (1 << 2);
58
+ public static final int CAMPAIGN_TYPE_ALL = (1 << 3);
59
+
49
60
  private final ReactApplicationContext reactContext;
50
61
 
62
+ private static final String REPRO_REACT_NATIVE_BRIDGE_VERSION = "3.8.0";
63
+
51
64
  public ReproReactBridgeModule(ReactApplicationContext reactContext) {
52
65
  super(reactContext);
53
66
  this.reactContext = reactContext;
67
+ this.versionPassing();
68
+ }
69
+
70
+ private String getReactNativeVersion() {
71
+ try {
72
+ return String.format(Locale.US, "%d.%d.%d",
73
+ ReactNativeVersion.VERSION.get("major"),
74
+ ReactNativeVersion.VERSION.get("minor"),
75
+ ReactNativeVersion.VERSION.get("patch")
76
+ );
77
+ } catch (Throwable t) {
78
+ return null;
79
+ }
80
+ }
81
+
82
+ private void versionPassing() {
83
+ final Map<String, Object> platformValues = new HashMap<>();
84
+ platformValues.put("sub_sdk_platform", "react_native");
85
+ platformValues.put("sub_sdk_bridge_version", REPRO_REACT_NATIVE_BRIDGE_VERSION);
86
+
87
+ String rnVerString = getReactNativeVersion();
88
+ if (rnVerString != null) {
89
+ platformValues.put("sub_sdk_platform_version", rnVerString);
90
+ }
91
+
92
+ try {
93
+ Method method = Repro.class.getDeclaredMethod("_passRuntimeValues", Map.class);
94
+ method.setAccessible(true);
95
+ method.invoke(null, platformValues);
96
+ } catch (Throwable t) {
97
+ t.printStackTrace();
98
+ }
54
99
  }
55
100
 
56
101
  @Override
@@ -71,6 +116,12 @@ public class ReproReactBridgeModule extends ReactContextBaseJavaModule {
71
116
  constants.put("LOGLEVEL_WARN", Log.WARN);
72
117
  constants.put("LOGLEVEL_ERROR", Log.ERROR);
73
118
 
119
+ constants.put("CAMPAIGN_TYPE_UNKNOWN", CAMPAIGN_TYPE_UNKNOWN);
120
+ constants.put("CAMPAIGN_TYPE_PUSH_NOTIFICATION", CAMPAIGN_TYPE_PUSH_NOTIFICATION);
121
+ constants.put("CAMPAIGN_TYPE_IN_APP_MESSAGE", CAMPAIGN_TYPE_IN_APP_MESSAGE);
122
+ constants.put("CAMPAIGN_TYPE_WEB_MESSAGE", CAMPAIGN_TYPE_WEB_MESSAGE);
123
+ constants.put("CAMPAIGN_TYPE_ALL", CAMPAIGN_TYPE_ALL);
124
+
74
125
  return constants;
75
126
  }
76
127
 
@@ -347,6 +398,7 @@ public class ReproReactBridgeModule extends ReactContextBaseJavaModule {
347
398
  entryMap.putString("title", entry.title);
348
399
  entryMap.putString("summary", entry.summary);
349
400
  entryMap.putString("body", entry.body);
401
+ entryMap.putInt("campaign_type", convertCampaignTypeToInt(entry.campaignType));
350
402
 
351
403
  entryMap.putBoolean("shown", entry.shown);
352
404
  entryMap.putBoolean("read", entry.read);
@@ -363,9 +415,11 @@ public class ReproReactBridgeModule extends ReactContextBaseJavaModule {
363
415
  }
364
416
 
365
417
  @ReactMethod
366
- public void getNewsFeeds(final int limit, Callback callback) {
418
+ public void getNewsFeeds(final int limit, final int campaignType, Callback callback) {
419
+ NewsFeedCampaignType type = convertCampaignTypeFromInt(campaignType);
420
+
367
421
  try {
368
- callback.invoke(null, toWritableArray(Repro.getNewsFeeds(limit)));
422
+ callback.invoke(null, toWritableArray(Repro.getNewsFeeds(limit, type)));
369
423
  } catch (Exception e) {
370
424
  WritableMap entryMap = Arguments.createMap();
371
425
  entryMap.putString("message", e.getMessage());
@@ -374,9 +428,11 @@ public class ReproReactBridgeModule extends ReactContextBaseJavaModule {
374
428
  }
375
429
 
376
430
  @ReactMethod
377
- public void getNewsFeedsFor(final int limit, final int offsetID, Callback callback) {
431
+ public void getNewsFeedsFor(final int limit, final int offsetID, final int campaignType, Callback callback) {
432
+ NewsFeedCampaignType type = convertCampaignTypeFromInt(campaignType);
433
+
378
434
  try {
379
- callback.invoke(null, toWritableArray(Repro.getNewsFeeds(limit, offsetID)));
435
+ callback.invoke(null, toWritableArray(Repro.getNewsFeeds(limit, offsetID, type)));
380
436
  } catch (Exception e) {
381
437
  WritableMap entryMap = Arguments.createMap();
382
438
  entryMap.putString("message", e.getMessage());
@@ -402,6 +458,35 @@ public class ReproReactBridgeModule extends ReactContextBaseJavaModule {
402
458
  callback.invoke(error);
403
459
  }
404
460
  }
461
+
462
+ private NewsFeedCampaignType convertCampaignTypeFromInt(int type) {
463
+ switch (type) {
464
+ case CAMPAIGN_TYPE_PUSH_NOTIFICATION:
465
+ return NewsFeedCampaignType.PushNotification;
466
+ case CAMPAIGN_TYPE_IN_APP_MESSAGE:
467
+ return NewsFeedCampaignType.InAppMessage;
468
+ case CAMPAIGN_TYPE_WEB_MESSAGE:
469
+ return NewsFeedCampaignType.WebMessage;
470
+ case CAMPAIGN_TYPE_ALL:
471
+ return NewsFeedCampaignType.All;
472
+ }
473
+
474
+ return NewsFeedCampaignType.Unknown;
475
+ }
476
+ private int convertCampaignTypeToInt(NewsFeedCampaignType type) {
477
+ switch (type.toString()) {
478
+ case "push_notification":
479
+ return CAMPAIGN_TYPE_PUSH_NOTIFICATION;
480
+ case "in_app_message":
481
+ return CAMPAIGN_TYPE_IN_APP_MESSAGE;
482
+ case "web_message":
483
+ return CAMPAIGN_TYPE_WEB_MESSAGE;
484
+ case "all":
485
+ return CAMPAIGN_TYPE_ALL;
486
+ }
487
+
488
+ return CAMPAIGN_TYPE_UNKNOWN;
489
+ }
405
490
  }
406
491
 
407
492
 
package/index.js CHANGED
@@ -15,6 +15,7 @@ class NewsFeedEntry {
15
15
  this.title = value["title"];
16
16
  this.summary = value["summary"];
17
17
  this.body = safeString(value["body"]);
18
+ this.campaignType = value["campaign_type"];
18
19
  this.shown = value["shown"];
19
20
  this.read = value["read"];
20
21
 
@@ -27,10 +28,11 @@ class NewsFeedEntry {
27
28
  toJson() {
28
29
  return {
29
30
  "newsfeed_id": this.id,
30
- "deviceID": this.deviceID,
31
+ "device_id": this.deviceID,
31
32
  "title": this.title,
32
33
  "summary": this.summary,
33
34
  "body": this.body,
35
+ "campaign_type": this.campaignType,
34
36
  "shown": this.shown,
35
37
  "read": this.read,
36
38
  "delivered_at": this.deliveredAt,
@@ -42,7 +44,25 @@ class NewsFeedEntry {
42
44
 
43
45
  const NewsFeedModule = {
44
46
  getNewsFeeds: (limit, callback) => {
45
- NativeModules.Repro.getNewsFeeds(limit, (error, items) => {
47
+ NativeModules.Repro.getNewsFeeds(limit, NativeModules.Repro.CAMPAIGN_TYPE_PUSH_NOTIFICATION, (error, items) => {
48
+ if (!callback) return;
49
+ if (!items) {
50
+ callback(null, []);
51
+ return;
52
+ }
53
+
54
+ const newsFeeds = [];
55
+
56
+ for (const item of items) {
57
+ newsFeeds.push(new NewsFeedEntry(item));
58
+ }
59
+
60
+ callback(error, newsFeeds);
61
+ })
62
+ },
63
+
64
+ getNewsFeedsWithCampaignType: (limit, campaignType, callback) => {
65
+ NativeModules.Repro.getNewsFeeds(limit, campaignType, (error, items) => {
46
66
  if (!callback) return;
47
67
  if (!items) {
48
68
  callback(null, []);
@@ -60,7 +80,25 @@ const NewsFeedModule = {
60
80
  },
61
81
 
62
82
  getNewsFeedsFor: (limit, offsetID, callback) => {
63
- NativeModules.Repro.getNewsFeedsFor(limit, offsetID, (error, items) => {
83
+ NativeModules.Repro.getNewsFeedsFor(limit, offsetID, NativeModules.Repro.CAMPAIGN_TYPE_PUSH_NOTIFICATION, (error, items) => {
84
+ if (!callback) return;
85
+ if (!items) {
86
+ callback(null, []);
87
+ return;
88
+ }
89
+
90
+ const newsFeeds = [];
91
+
92
+ for (const item of items) {
93
+ newsFeeds.push(new NewsFeedEntry(item));
94
+ }
95
+
96
+ callback(error, newsFeeds);
97
+ })
98
+ },
99
+
100
+ getNewsFeedsWithCampaignTypeFor: (limit, offsetID, campaignType, callback) => {
101
+ NativeModules.Repro.getNewsFeedsFor(limit, offsetID, campaignType, (error, items) => {
64
102
  if (!callback) return;
65
103
  if (!items) {
66
104
  callback(null, []);
@@ -25,6 +25,11 @@
25
25
  #error "Can't find RCTBridgeModule.h anywhere."
26
26
  #endif
27
27
 
28
+
29
+ #define REPRO_REACT_NATIVE_BRIDGE_VERSION "3.8.0"
30
+
31
+
32
+
28
33
  @interface RPRRemoteConfigBridge: NSObject <RCTBridgeModule>
29
34
 
30
35
  @end
@@ -29,6 +29,31 @@
29
29
  #error "Can't find RCTConvert.h anywhere."
30
30
  #endif
31
31
 
32
+
33
+
34
+
35
+ // ReactNative Version >= 0.41
36
+ #if __has_include(<React/RCTVersion.h>)
37
+ #import <React/RCTVersion.h>
38
+
39
+ // ReactNative Version < 0.41
40
+ #elif __has_include("RCTVersion.h")
41
+ #import "RCTVersion.h"
42
+
43
+ // if ReactNative is a cocoapod and the project has swift enabled
44
+ #elif __has_include("React/RCTVersion.h")
45
+ #import "React/RCTVersion.h"
46
+
47
+ #else
48
+ #define RPR_CANT_DETERMINE_RN_VERSION 1
49
+ #endif
50
+
51
+
52
+
53
+
54
+
55
+
56
+
32
57
  static NSObject*
33
58
  safe_value(id value)
34
59
  {
@@ -61,6 +86,15 @@ safe_value(id value)
61
86
  RPRRemoteConfigFetchStatusTimeoutReached, integerValue)
62
87
  @end
63
88
 
89
+ @implementation RCTConvert (RPRCampaignType)
90
+ RCT_ENUM_CONVERTER(RPRCampaignType, (@{
91
+ @"CAMPAIGN_TYPE_UNKNOWN" : @(RPRCampaignTypeUnknown),
92
+ @"CAMPAIGN_TYPE_PUSH_NOTIFICATION" : @(RPRCampaignTypePushNotification),
93
+ @"CAMPAIGN_TYPE_IN_APP_MESSAGE" : @(RPRCampaignTypeInAppMessage),
94
+ @"CAMPAIGN_TYPE_WEB_MESSAGE" : @(RPRCampaignTypeWebMessage)}),
95
+ RPRCampaignTypePushNotification, integerValue)
96
+ @end
97
+
64
98
  @interface RPRRemoteConfigBridge ()
65
99
 
66
100
  @property (nonatomic) RPRRemoteConfig* remoteConfig;
@@ -177,8 +211,58 @@ RCT_EXPORT_METHOD(forceReset)
177
211
  @end
178
212
 
179
213
 
214
+
215
+
216
+ @interface Repro (NonPublicApi)
217
+ + (void)_passRuntimeValues:(nonnull NSDictionary<NSString *, NSString *> *)values;
218
+ @end
219
+
220
+
221
+
222
+
223
+ #ifndef RPR_CANT_DETERMINE_RN_VERSION
224
+ static NSString *get_react_native_version()
225
+ {
226
+ // see: https://github.com/facebook/react-native/commit/30469ed00170a74743d2ba5aadce61aae742715c#
227
+ #ifdef RCT_REACT_NATIVE_VERSION
228
+ NSDictionary *vermap = RCT_REACT_NATIVE_VERSION;
229
+ return [NSString stringWithFormat:@"%@.%@.%@",
230
+ vermap[@"major"],
231
+ vermap[@"minor"],
232
+ vermap[@"patch"]];
233
+
234
+ #else
235
+ NSDictionary *vermap = RCTGetReactNativeVersion();
236
+ return [NSString stringWithFormat:@"%@.%@.%@",
237
+ vermap[RCTVersionMajor],
238
+ vermap[RCTVersionMinor],
239
+ vermap[RCTVersionPatch]];
240
+
241
+ #endif
242
+ }
243
+ #endif
244
+
245
+
180
246
  @implementation RPRReproReactBridge
181
247
 
248
+ - (instancetype)init
249
+ {
250
+ self = [super init];
251
+
252
+ if ([Repro respondsToSelector:@selector(_passRuntimeValues:)]) {
253
+ [Repro _passRuntimeValues:@{
254
+ @"sub_sdk_platform": @"react_native",
255
+ #ifndef RPR_CANT_DETERMINE_RN_VERSION
256
+ @"sub_sdk_platform_version": get_react_native_version(),
257
+ #endif
258
+ @"sub_sdk_bridge_version": [NSString stringWithUTF8String:REPRO_REACT_NATIVE_BRIDGE_VERSION],
259
+ }];
260
+ }
261
+
262
+ return self;
263
+ }
264
+
265
+
182
266
  RCT_EXPORT_MODULE(Repro)
183
267
 
184
268
  - (NSDictionary *)constantsToExport
@@ -197,6 +281,12 @@ RCT_EXPORT_MODULE(Repro)
197
281
  @"REMOTE_CONFIG_SUCCESS" : @(RPRRemoteConfigFetchStatusSuccess),
198
282
  @"REMOTE_CONFIG_TIMEOUT_REACHED" : @(RPRRemoteConfigFetchStatusTimeoutReached),
199
283
  @"REMOTE_CONFIG_ALREADY_FETCHED" : @(RPRRemoteConfigFetchStatusAlreadyFetched),
284
+
285
+ @"CAMPAIGN_TYPE_UNKNOWN" : @(RPRCampaignTypeUnknown),
286
+ @"CAMPAIGN_TYPE_PUSH_NOTIFICATION" : @(RPRCampaignTypePushNotification),
287
+ @"CAMPAIGN_TYPE_IN_APP_MESSAGE" : @(RPRCampaignTypeInAppMessage),
288
+ @"CAMPAIGN_TYPE_WEB_MESSAGE" : @(RPRCampaignTypeWebMessage),
289
+ @"CAMPAIGN_TYPE_ALL" : @(RPRCampaignTypeAll),
200
290
  };
201
291
  };
202
292
 
@@ -452,10 +542,24 @@ RCT_EXPORT_METHOD(disableInAppMessagesOnForegroundTransition)
452
542
  [Repro disableInAppMessagesOnForegroundTransition];
453
543
  }
454
544
 
455
- RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit callback:(RCTResponseSenderBlock)callback)
545
+ RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
456
546
  {
457
547
  NSError *error = nil;
458
- NSArray<RPRNewsFeedEntry *> * entries = [Repro getNewsFeeds:limit error:&error];
548
+ RPRCampaignType campaignType = RPRCampaignTypeUnknown;
549
+
550
+ if (type) {
551
+ if ([type isEqualToNumber:@(RPRCampaignTypePushNotification)]) {
552
+ campaignType = RPRCampaignTypePushNotification;
553
+ } else if ([type isEqualToNumber:@(RPRCampaignTypeInAppMessage)]) {
554
+ campaignType = RPRCampaignTypeInAppMessage;
555
+ } else if ([type isEqualToNumber:@(RPRCampaignTypeWebMessage)]) {
556
+ campaignType = RPRCampaignTypeWebMessage;
557
+ } else if ([type isEqualToNumber:@(RPRCampaignTypeAll)]) {
558
+ campaignType = RPRCampaignTypeAll;
559
+ }
560
+ }
561
+
562
+ NSArray<RPRNewsFeedEntry *> * entries = [Repro getNewsFeeds:limit campaignType:campaignType error:&error];
459
563
 
460
564
  if (error) {
461
565
  NSString *errString = [error localizedDescription];
@@ -481,11 +585,12 @@ RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit callback:(RCTResponseSenderBlock)
481
585
  @"title": entry.title,
482
586
  @"summary": entry.summary,
483
587
  @"body": entry.body,
588
+ @"campaign_type": @(entry.campaignType),
484
589
  @"shown": @(entry.shown),
485
590
  @"read": @(entry.read),
486
591
  @"delivered_at": formattedDateString,
487
592
  @"link_url": entry.linkUrl ? [entry.linkUrl absoluteString] : @"",
488
- @"image_url": entry.imageUrl ? [entry.imageUrl absoluteString] : @""
593
+ @"image_url": entry.imageUrl ? [entry.imageUrl absoluteString] : @"",
489
594
  };
490
595
 
491
596
  [entryJsons addObject:entryJson];
@@ -494,10 +599,24 @@ RCT_EXPORT_METHOD(getNewsFeeds:(uint64_t)limit callback:(RCTResponseSenderBlock)
494
599
  callback(@[[NSNull null], safe_value(entryJsons)]);
495
600
  }
496
601
 
497
- RCT_EXPORT_METHOD(getNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID callback:(RCTResponseSenderBlock)callback)
602
+ RCT_EXPORT_METHOD(getNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID campaignType:(nonnull NSNumber *)type callback:(RCTResponseSenderBlock)callback)
498
603
  {
499
604
  NSError *error = nil;
500
- NSArray<RPRNewsFeedEntry *> *entries = [Repro getNewsFeeds:limit offsetID:offsetID error:&error];
605
+ RPRCampaignType campaignType = RPRCampaignTypeUnknown;
606
+
607
+ if (type) {
608
+ if ([type isEqualToNumber:@(RPRCampaignTypePushNotification)]) {
609
+ campaignType = RPRCampaignTypePushNotification;
610
+ } else if ([type isEqualToNumber:@(RPRCampaignTypeInAppMessage)]) {
611
+ campaignType = RPRCampaignTypeInAppMessage;
612
+ } else if ([type isEqualToNumber:@(RPRCampaignTypeWebMessage)]) {
613
+ campaignType = RPRCampaignTypeWebMessage;
614
+ } else if ([type isEqualToNumber:@(RPRCampaignTypeAll)]) {
615
+ campaignType = RPRCampaignTypeAll;
616
+ }
617
+ }
618
+
619
+ NSArray<RPRNewsFeedEntry *> *entries = [Repro getNewsFeeds:limit offsetID:offsetID campaignType:campaignType error:&error];
501
620
 
502
621
  if (error) {
503
622
  NSString *errString = [error localizedDescription];
@@ -523,11 +642,12 @@ RCT_EXPORT_METHOD(getNewsFeedsFor:(uint64_t)limit offsetID:(uint64_t)offsetID ca
523
642
  @"title": entry.title,
524
643
  @"summary": entry.summary,
525
644
  @"body": entry.body,
645
+ @"campaign_type": @(entry.campaignType),
526
646
  @"shown": @(entry.shown),
527
647
  @"read": @(entry.read),
528
648
  @"delivered_at": formattedDateString,
529
649
  @"link_url": entry.linkUrl ? [entry.linkUrl absoluteString] : @"",
530
- @"image_url": entry.imageUrl ? [entry.imageUrl absoluteString] : @""
650
+ @"image_url": entry.imageUrl ? [entry.imageUrl absoluteString] : @"",
531
651
  };
532
652
 
533
653
  [entryJsons addObject:entryJson];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-repro",
3
- "version": "3.5.0",
4
- "description": "Repro is a mobile analytics tool that lets you have much deeper understanding of mobile app users with play-by-play videos.",
3
+ "version": "3.8.0",
4
+ "description": "Repro is a mobile analytics tool that lets you have much deeper understanding of mobile app users.",
5
5
  "main": "index.js",
6
6
  "keywords": [
7
7
  "repro",
@@ -1,5 +1,5 @@
1
1
  {
2
- "ios-sdk": "5.6.0",
3
- "android-sdk": "5.5.1",
4
- "bridge": "3.5.0"
2
+ "ios-sdk": "5.8.3",
3
+ "android-sdk": "5.6.3",
4
+ "bridge": "3.8.0"
5
5
  }
@@ -4,6 +4,6 @@
4
4
  <modelVersion>4.0.0</modelVersion>
5
5
  <groupId>io.repro</groupId>
6
6
  <artifactId>repro-android-sdk</artifactId>
7
- <version>5.5.1</version>
7
+ <version>5.6.3</version>
8
8
  <packaging>aar</packaging>
9
9
  </project>
@@ -3,10 +3,10 @@
3
3
  <groupId>io.repro</groupId>
4
4
  <artifactId>repro-android-sdk</artifactId>
5
5
  <versioning>
6
- <release>5.5.1</release>
6
+ <release>5.6.3</release>
7
7
  <versions>
8
- <version>5.5.1</version>
8
+ <version>5.6.3</version>
9
9
  </versions>
10
- <lastUpdated>20210807030612</lastUpdated>
10
+ <lastUpdated>20220414164029</lastUpdated>
11
11
  </versioning>
12
12
  </metadata>
@@ -1 +1 @@
1
- 4c6c642dd52d014fd0923584beb3113a
1
+ fe6f633c59c1db674bb5cb71b6612974
@@ -1 +1 @@
1
- 79c9b67e709e5154afb95f3c3bcf90c8dbd33311
1
+ 6ba3c4d64b8431c1c6702c5126880ac4c6575b55
@@ -0,0 +1,43 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>AvailableLibraries</key>
6
+ <array>
7
+ <dict>
8
+ <key>LibraryIdentifier</key>
9
+ <string>ios-arm64_armv7_armv7s</string>
10
+ <key>LibraryPath</key>
11
+ <string>Repro.framework</string>
12
+ <key>SupportedArchitectures</key>
13
+ <array>
14
+ <string>arm64</string>
15
+ <string>armv7</string>
16
+ <string>armv7s</string>
17
+ </array>
18
+ <key>SupportedPlatform</key>
19
+ <string>ios</string>
20
+ </dict>
21
+ <dict>
22
+ <key>LibraryIdentifier</key>
23
+ <string>ios-arm64_i386_x86_64-simulator</string>
24
+ <key>LibraryPath</key>
25
+ <string>Repro.framework</string>
26
+ <key>SupportedArchitectures</key>
27
+ <array>
28
+ <string>arm64</string>
29
+ <string>i386</string>
30
+ <string>x86_64</string>
31
+ </array>
32
+ <key>SupportedPlatform</key>
33
+ <string>ios</string>
34
+ <key>SupportedPlatformVariant</key>
35
+ <string>simulator</string>
36
+ </dict>
37
+ </array>
38
+ <key>CFBundlePackageType</key>
39
+ <string>XFWK</string>
40
+ <key>XCFrameworkFormatVersion</key>
41
+ <string>1.0</string>
42
+ </dict>
43
+ </plist>
@@ -6,6 +6,16 @@
6
6
 
7
7
  #import <Foundation/Foundation.h>
8
8
 
9
+
10
+ typedef NS_ENUM(NSUInteger, RPRCampaignType) {
11
+ RPRCampaignTypeUnknown NS_SWIFT_NAME(unknown) = 0,
12
+
13
+ RPRCampaignTypePushNotification NS_SWIFT_NAME(pushNotification) = (1 << 0),
14
+ RPRCampaignTypeInAppMessage NS_SWIFT_NAME(inAppMessage) = (1 << 1),
15
+ RPRCampaignTypeWebMessage NS_SWIFT_NAME(webMessage) = (1 << 2),
16
+ RPRCampaignTypeAll NS_SWIFT_NAME(all) = (1 << 3),
17
+ };
18
+
9
19
  NS_ASSUME_NONNULL_BEGIN
10
20
 
11
21
  @interface RPRNewsFeedEntry : NSObject
@@ -15,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
15
25
  @property (nonatomic, readonly) NSString *title;
16
26
  @property (nonatomic, readonly) NSString *summary;
17
27
  @property (nonatomic, readonly) NSString *body;
28
+ @property (nonatomic, readonly) RPRCampaignType campaignType;
18
29
  @property (nonatomic, readonly, nullable) NSURL *linkUrl;
19
30
  @property (nonatomic, readonly, nullable) NSURL *imageUrl;
20
31
  @property (nonatomic, readonly) NSDate *deliveredAt;
@@ -98,11 +98,11 @@ NS_SWIFT_NAME(value(forKey:));
98
98
  /// Access to remote config values via subscript syntax.
99
99
  - (nonnull RPRRemoteConfigValue *)objectForKeyedSubscript:(nonnull NSString *)key;
100
100
 
101
- /// Return a dictonary with all key value pairs.
101
+ /// Return a dictionary with all key value pairs.
102
102
  - (nonnull NSDictionary<NSString *, RPRRemoteConfigValue *> *)allValues
103
103
  NS_SWIFT_NAME(allValues());
104
104
 
105
- /// Return a dictonary with all key value pairs for a given prefix. Pass `nil` or an empty string to get all values.
105
+ /// Return a dictionary with all key value pairs for a given prefix. Pass `nil` or an empty string to get all values.
106
106
  - (nonnull NSDictionary<NSString *, RPRRemoteConfigValue *> *)allValuesWithPrefix:(nullable NSString *)prefix
107
107
  NS_SWIFT_NAME(allValues(withPrefix:));
108
108
 
@@ -144,11 +144,22 @@ NS_SWIFT_NAME(set(silverEggProdKey:));
144
144
  error:(NSError * _Nullable * _Nullable)error
145
145
  NS_SWIFT_NAME(getNewsFeeds(_:));
146
146
 
147
+ + (nullable NSArray<RPRNewsFeedEntry *> *)getNewsFeeds:(uint64_t)limit
148
+ campaignType:(RPRCampaignType)campaignType
149
+ error:(NSError * _Nullable * _Nullable)error
150
+ NS_SWIFT_NAME(getNewsFeeds(_:campaignType:));
151
+
147
152
  + (nullable NSArray<RPRNewsFeedEntry *> *)getNewsFeeds:(uint64_t)limit
148
153
  offsetID:(uint64_t)offsetID
149
154
  error:(NSError * _Nullable * _Nullable)error
150
155
  NS_SWIFT_NAME(getNewsFeeds(_:offsetID:));
151
156
 
157
+ + (nullable NSArray<RPRNewsFeedEntry *> *)getNewsFeeds:(uint64_t)limit
158
+ offsetID:(uint64_t)offsetID
159
+ campaignType:(RPRCampaignType)campaignType
160
+ error:(NSError * _Nullable * _Nullable)error
161
+ NS_SWIFT_NAME(getNewsFeeds(_:offsetID:campaignType:));
162
+
152
163
  + (BOOL)updateNewsFeeds:(nonnull NSArray<RPRNewsFeedEntry *> *)newsFeeds error:(NSError * _Nullable * _Nullable)error
153
164
  NS_SWIFT_NAME(updateNewsFeeds(_:));
154
165
 
@@ -0,0 +1,90 @@
1
+ //
2
+ // Repro iOS SDK
3
+ //
4
+ // Copyright (c) 2014 Repro Inc. All rights reserved.
5
+ //
6
+
7
+ #import <Foundation/Foundation.h>
8
+
9
+ @interface RPRViewContentProperties : NSObject
10
+ @property (nonatomic, readwrite) double value;
11
+ @property (nonatomic, readwrite, copy) NSString *currency;
12
+ @property (nonatomic, readwrite, copy) NSString *contentName;
13
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
14
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
15
+ @end
16
+
17
+ @interface RPRSearchProperties : NSObject
18
+ @property (nonatomic, readwrite) double value;
19
+ @property (nonatomic, readwrite, copy) NSString *currency;
20
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
21
+ @property (nonatomic, readwrite, copy) NSString *contentID;
22
+ @property (nonatomic, readwrite, copy) NSString *searchString;
23
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
24
+ @end
25
+
26
+ @interface RPRAddToCartProperties : NSObject
27
+ @property (nonatomic, readwrite) double value;
28
+ @property (nonatomic, readwrite, copy) NSString *currency;
29
+ @property (nonatomic, readwrite, copy) NSString *contentName;
30
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
31
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
32
+ @end
33
+
34
+ @interface RPRAddToWishlistProperties : NSObject
35
+ @property (nonatomic, readwrite) double value;
36
+ @property (nonatomic, readwrite, copy) NSString *currency;
37
+ @property (nonatomic, readwrite, copy) NSString *contentName;
38
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
39
+ @property (nonatomic, readwrite, copy) NSString *contentID;
40
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
41
+ @end
42
+
43
+ @interface RPRInitiateCheckoutProperties : NSObject
44
+ @property (nonatomic, readwrite) double value;
45
+ @property (nonatomic, readwrite, copy) NSString *currency;
46
+ @property (nonatomic, readwrite, copy) NSString *contentName;
47
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
48
+ @property (nonatomic, readwrite, copy) NSString *contentID;
49
+ @property (nonatomic, readwrite) NSInteger numItems;
50
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
51
+ @end
52
+
53
+ @interface RPRAddPaymentInfoProperties : NSObject
54
+ @property (nonatomic, readwrite) double value;
55
+ @property (nonatomic, readwrite, copy) NSString *currency;
56
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
57
+ @property (nonatomic, readwrite, copy) NSString *contentID;
58
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
59
+ @end
60
+
61
+ @interface RPRPurchaseProperties : NSObject
62
+ @property (nonatomic, readwrite, copy) NSString *contentName;
63
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
64
+ @property (nonatomic, readwrite) NSInteger numItems;
65
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
66
+ @end
67
+
68
+ @interface RPRShareProperties : NSObject
69
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
70
+ @property (nonatomic, readwrite, copy) NSString *contentID;
71
+ @property (nonatomic, readwrite, copy) NSString *contentName;
72
+ @property (nonatomic, readwrite, copy) NSString *serviceName;
73
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
74
+ @end
75
+
76
+ @interface RPRLeadProperties : NSObject
77
+ @property (nonatomic, readwrite) double value;
78
+ @property (nonatomic, readwrite, copy) NSString *currency;
79
+ @property (nonatomic, readwrite, copy) NSString *contentName;
80
+ @property (nonatomic, readwrite, copy) NSString *contentCategory;
81
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
82
+ @end
83
+
84
+ @interface RPRCompleteRegistrationProperties : NSObject
85
+ @property (nonatomic, readwrite) double value;
86
+ @property (nonatomic, readwrite, copy) NSString *currency;
87
+ @property (nonatomic, readwrite, copy) NSString *contentName;
88
+ @property (nonatomic, readwrite, copy) NSString *status;
89
+ @property (nonatomic, readwrite, copy) NSDictionary *extras;
90
+ @end
@@ -0,0 +1,40 @@
1
+ //
2
+ // Repro iOS SDK
3
+ //
4
+ // Copyright (c) 2014 Repro Inc. All rights reserved.
5
+ //
6
+
7
+ #import <Foundation/Foundation.h>
8
+
9
+
10
+ typedef NS_ENUM(NSUInteger, RPRCampaignType) {
11
+ RPRCampaignTypeUnknown NS_SWIFT_NAME(unknown) = 0,
12
+
13
+ RPRCampaignTypePushNotification NS_SWIFT_NAME(pushNotification) = (1 << 0),
14
+ RPRCampaignTypeInAppMessage NS_SWIFT_NAME(inAppMessage) = (1 << 1),
15
+ RPRCampaignTypeWebMessage NS_SWIFT_NAME(webMessage) = (1 << 2),
16
+ RPRCampaignTypeAll NS_SWIFT_NAME(all) = (1 << 3),
17
+ };
18
+
19
+ NS_ASSUME_NONNULL_BEGIN
20
+
21
+ @interface RPRNewsFeedEntry : NSObject
22
+
23
+ @property (nonatomic, readonly) uint64_t ID;
24
+ @property (nonatomic, readonly) NSString *deviceID;
25
+ @property (nonatomic, readonly) NSString *title;
26
+ @property (nonatomic, readonly) NSString *summary;
27
+ @property (nonatomic, readonly) NSString *body;
28
+ @property (nonatomic, readonly) RPRCampaignType campaignType;
29
+ @property (nonatomic, readonly, nullable) NSURL *linkUrl;
30
+ @property (nonatomic, readonly, nullable) NSURL *imageUrl;
31
+ @property (nonatomic, readonly) NSDate *deliveredAt;
32
+ @property (nonatomic) BOOL shown;
33
+ @property (nonatomic) BOOL read;
34
+
35
+ - (instancetype)init NS_UNAVAILABLE;
36
+ - (instancetype)initWithDictionary:(NSDictionary *)dictionary;
37
+
38
+ @end
39
+
40
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,119 @@
1
+ //
2
+ // Repro iOS SDK
3
+ //
4
+ // Copyright (c) 2014 Repro Inc. All rights reserved.
5
+ //
6
+
7
+ #import <Foundation/Foundation.h>
8
+
9
+
10
+ /// Wrapper class around remote config values.
11
+ @interface RPRRemoteConfigValue : NSObject
12
+ // Will be `nil` if both remote config and local config did not contain a value.
13
+ @property(nonatomic, readonly, nullable) NSString *stringValue;
14
+ @end
15
+
16
+ /// Status reported via fetch callback.
17
+ typedef NS_ENUM(NSInteger, RPRRemoteConfigFetchStatus) {
18
+ RPRRemoteConfigFetchStatusSuccess NS_SWIFT_NAME(success) = 0,
19
+ RPRRemoteConfigFetchStatusTimeoutReached NS_SWIFT_NAME(timeoutReached),
20
+ RPRRemoteConfigFetchStatusAlreadyFetched NS_SWIFT_NAME(alreadyFetched)
21
+ } NS_SWIFT_NAME(RPRRemoteConfigFetchStatus);
22
+
23
+
24
+
25
+
26
+ /// Remote config fetch result will be passed with this completion handler.
27
+ typedef void (^RPRRemoteConfigFetchCompletion)(RPRRemoteConfigFetchStatus status)
28
+ NS_SWIFT_NAME(RPRRemoteConfigFetchCompletion);
29
+
30
+
31
+
32
+
33
+
34
+ @interface RPRRemoteConfig : NSObject
35
+
36
+ /// Access remote config via `Repro.remoteConfig` instead of initializing this class.
37
+ - (nonnull instancetype)init NS_UNAVAILABLE;
38
+
39
+ #pragma mark - Remote Config Setup
40
+
41
+ /// You may not need this method because the default behavior is:
42
+ /// - After a call to `Repro.setup()`, automatically fetch every time the app will enter foreground
43
+ /// - Run `activateFetched` as soon as a response was received.
44
+ ///
45
+ /// If you need a completionHandler to ensure the remoteConfig gets activated at a certain point in time
46
+ /// or want to validate remote config functionality while development, you should use this method. You can
47
+ /// only set one completionHandler at a time. Also only one fetch per app foreground/background cycle is
48
+ /// permitted. Therefore you should call this when your app comes to foreground, preferably
49
+ /// from `applicationWillEnterForeground`.
50
+ ///
51
+ /// If the completionHandler handler is called with status `RPRRemoteConfigFetchStatusSuccess`, you should
52
+ /// proceed with calling `activateFetched` in the completionHandler or after the completionHandler has
53
+ /// been executed.
54
+ ///
55
+ /// After `activateFetched` has been called, new remote config values are available. This completionHandler
56
+ /// is always guaranteed to be called on the main thread. The callback will be invalidated and not executed
57
+ /// if the app goes to background or the end-user OptsOut via the OptIn/OptOut API.
58
+ - (void)fetchWithTimeout:(NSTimeInterval)timeout
59
+ completionHandler:(nonnull RPRRemoteConfigFetchCompletion)completionHandler
60
+ NS_SWIFT_NAME(fetch(withTimeout:completionHandler:));
61
+
62
+
63
+ /// This is only needed if you use `fetchWithTimeout:completionHandler:`. See above.
64
+ /// Returns YES if a previously fetched remote config has replaced the current remote config.
65
+ - (BOOL)activateFetched
66
+ NS_SWIFT_NAME(activateFetched());
67
+
68
+
69
+
70
+
71
+
72
+
73
+ #pragma mark - Local Default Settings
74
+
75
+ /// Set local defaults for remote config queries via dictionary.
76
+ - (BOOL)setDefaultsFromDictionary:(nonnull NSDictionary<NSString *, id> *)defaults
77
+ NS_SWIFT_NAME(setDefaults(fromDictionary:));
78
+
79
+ /// Set local defaults for remote config queries via a json file.
80
+ - (BOOL)setDefaultsFromJsonFile:(nonnull NSURL *)fileNameURL
81
+ NS_SWIFT_NAME(setDefaults(fromJsonFile:));
82
+
83
+ /// Set local defaults for remote config queries via a json string.
84
+ - (BOOL)setDefaultsFromJsonString:(nonnull NSString *)string
85
+ NS_SWIFT_NAME(setDefaults(fromJsonString:));
86
+
87
+
88
+
89
+
90
+
91
+
92
+ #pragma mark - Query Remote Config
93
+
94
+ /// Access to remote config values.
95
+ - (nonnull RPRRemoteConfigValue *)valueForKey:(nonnull NSString *)key
96
+ NS_SWIFT_NAME(value(forKey:));
97
+
98
+ /// Access to remote config values via subscript syntax.
99
+ - (nonnull RPRRemoteConfigValue *)objectForKeyedSubscript:(nonnull NSString *)key;
100
+
101
+ /// Return a dictionary with all key value pairs.
102
+ - (nonnull NSDictionary<NSString *, RPRRemoteConfigValue *> *)allValues
103
+ NS_SWIFT_NAME(allValues());
104
+
105
+ /// Return a dictionary with all key value pairs for a given prefix. Pass `nil` or an empty string to get all values.
106
+ - (nonnull NSDictionary<NSString *, RPRRemoteConfigValue *> *)allValuesWithPrefix:(nullable NSString *)prefix
107
+ NS_SWIFT_NAME(allValues(withPrefix:));
108
+
109
+ /// Returns the local default value for a key.
110
+ - (nonnull RPRRemoteConfigValue *)localDefaultValueForKey:(nonnull NSString *)key
111
+ NS_SWIFT_NAME(localDefaultValue(forKey:));
112
+
113
+ /// Reset all data. Local config & remote Config. Should only be used while in development.
114
+ - (void)forceReset
115
+ NS_SWIFT_NAME(forceReset());
116
+
117
+
118
+ @end
119
+
@@ -0,0 +1,14 @@
1
+ //
2
+ // Repro iOS SDK
3
+ //
4
+ // Copyright (c) 2014 Repro Inc. All rights reserved.
5
+ //
6
+
7
+ #import <Foundation/Foundation.h>
8
+
9
+ typedef NS_ENUM(NSInteger, RPRUserProfileGender) {
10
+ RPRUserProfileGenderOther NS_SWIFT_NAME(other) = 0,
11
+ RPRUserProfileGenderMale NS_SWIFT_NAME(male),
12
+ RPRUserProfileGenderFemale NS_SWIFT_NAME(female)
13
+ };
14
+
@@ -0,0 +1,166 @@
1
+ //
2
+ // Repro iOS SDK
3
+ //
4
+ // Copyright (c) 2014 Repro Inc. All rights reserved.
5
+ //
6
+
7
+ #import <Foundation/Foundation.h>
8
+
9
+ #import <Repro/RPREventProperties.h>
10
+ #import <Repro/RPRUserProfileGender.h>
11
+ #import <Repro/RPRRemoteConfig.h>
12
+ #import <Repro/RPRNewsFeedEntry.h>
13
+
14
+ @protocol WKNavigationDelegate;
15
+
16
+ //! Project version number for Repro.
17
+ FOUNDATION_EXPORT double ReproVersionNumber;
18
+
19
+ //! Project version string for Repro.
20
+ FOUNDATION_EXPORT const unsigned char ReproVersionString[];
21
+
22
+ typedef NS_ENUM(NSInteger, RPRLogLevel) {
23
+ RPRLogLevelDebug NS_SWIFT_NAME(debug),
24
+ RPRLogLevelInfo NS_SWIFT_NAME(info),
25
+ RPRLogLevelWarn NS_SWIFT_NAME(warn),
26
+ RPRLogLevelError NS_SWIFT_NAME(error),
27
+ RPRLogLevelNone NS_SWIFT_NAME(none)
28
+ };
29
+
30
+ @interface Repro : NSObject
31
+
32
+ // Session (Initialization)
33
+ + (void)setup:(nonnull NSString *)token
34
+ NS_SWIFT_NAME(setup(token:));
35
+
36
+
37
+ // OptIn / OptOut
38
+ + (void)optIn:(BOOL)endUserOptedIn
39
+ NS_SWIFT_NAME(optIn(endUserOptedIn:));
40
+
41
+
42
+ // User profile
43
+ + (void)setUserID:(nonnull NSString *)userID
44
+ NS_SWIFT_NAME(set(userID:));
45
+
46
+ + (nonnull NSString *)getUserID
47
+ NS_SWIFT_NAME(userID());
48
+
49
+ + (nullable NSString *)getDeviceID
50
+ NS_SWIFT_NAME(deviceID());
51
+
52
+ + (void)setStringUserProfile:(nonnull NSString *)value forKey:(nonnull NSString *)key
53
+ NS_SWIFT_NAME(setUserProfile(stringValue:forKey:));
54
+
55
+ + (void)setIntUserProfile:(NSInteger)value forKey:(nonnull NSString *)key
56
+ NS_SWIFT_NAME(setUserProfile(integerValue:forKey:));
57
+
58
+ + (void)setDoubleUserProfile:(double)value forKey:(nonnull NSString *)key
59
+ NS_SWIFT_NAME(setUserProfile(doubleValue:forKey:));
60
+
61
+ + (void)setDateUserProfile:(nonnull NSDate *)value forKey:(nonnull NSString *)key
62
+ NS_SWIFT_NAME(setUserProfile(dateValue:forKey:));
63
+
64
+ + (void)setUserGender:(RPRUserProfileGender)value
65
+ NS_SWIFT_NAME(setUserProfile(gender:));
66
+
67
+ + (void)setUserEmailAddress:(nonnull NSString *)value
68
+ NS_SWIFT_NAME(setUserProfile(emailAddress:));
69
+
70
+
71
+ // Event tracking
72
+ + (void)track:(nonnull NSString *)name properties:(nullable NSDictionary *)properties
73
+ NS_SWIFT_NAME(track(event:properties:));
74
+
75
+ + (void)startWebViewTracking:(nonnull id<WKNavigationDelegate>)delegate
76
+ NS_SWIFT_NAME(startWebViewTracking(delegate:));
77
+
78
+
79
+ // Standard event tracking
80
+ + (void)trackViewContent:(nonnull NSString *)contentID properties:(nullable RPRViewContentProperties *)properties
81
+ NS_SWIFT_NAME(trackViewContentEvent(contentID:properties:));
82
+
83
+ + (void)trackSearch:(nullable RPRSearchProperties *)properties
84
+ NS_SWIFT_NAME(trackSearchEvent(properties:));
85
+
86
+ + (void)trackAddToCart:(nonnull NSString *)contentID properties:(nullable RPRAddToCartProperties *)properties
87
+ NS_SWIFT_NAME(trackAddToCartEvent(contentID:properties:));
88
+
89
+ + (void)trackAddToWishlist:(nullable RPRAddToWishlistProperties *)properties
90
+ NS_SWIFT_NAME(trackAddToWishlistEvent(properties:));
91
+
92
+ + (void)trackInitiateCheckout:(nullable RPRInitiateCheckoutProperties *)properties
93
+ NS_SWIFT_NAME(trackInitiateCheckoutEvent(properties:));
94
+
95
+ + (void)trackAddPaymentInfo:(nullable RPRAddPaymentInfoProperties *)properties
96
+ NS_SWIFT_NAME(trackAddPaymentInfoEvent(properties:));
97
+
98
+ + (void)trackPurchase:(nonnull NSString *)contentID value:(double)value currency:(nonnull NSString *)currency properties:(nullable RPRPurchaseProperties *)properties
99
+ NS_SWIFT_NAME(trackPurchaseEvent(contentID:value:currency:properties:));
100
+
101
+ + (void)trackShare:(nullable RPRShareProperties *)properties
102
+ NS_SWIFT_NAME(trackShareEvent(properties:));
103
+
104
+ + (void)trackCompleteRegistration:(nullable RPRCompleteRegistrationProperties *)properties
105
+ NS_SWIFT_NAME(trackCompleteRegistrationEvent(properties:));
106
+
107
+ + (void)trackLead:(nullable RPRLeadProperties *)properties
108
+ NS_SWIFT_NAME(trackLeadEvent(properties:));
109
+
110
+
111
+ // Log
112
+ + (void)setLogLevel:(RPRLogLevel)level
113
+ NS_SWIFT_NAME(set(logLevel:));
114
+
115
+
116
+ // Push Notification
117
+ + (void)setPushDeviceToken:(nonnull NSData *)pushDeviceToken
118
+ NS_SWIFT_NAME(setPushDeviceToken(data:));
119
+
120
+ + (void)setPushDeviceTokenString:(nonnull NSString *)pushDeviceToken
121
+ NS_SWIFT_NAME(setPushDeviceToken(string:));
122
+
123
+
124
+ // In App Message
125
+
126
+ + (void)enableInAppMessagesOnForegroundTransition
127
+ NS_SWIFT_NAME(enableInAppMessagesOnForegroundTransition());
128
+
129
+ + (void)disableInAppMessagesOnForegroundTransition
130
+ NS_SWIFT_NAME(disableInAppMessagesOnForegroundTransition());
131
+
132
+ // Silver Egg In-app
133
+ + (void)setSilverEggCookie:(nonnull NSString *)silverEggCookie
134
+ NS_SWIFT_NAME(set(silverEggCookie:));
135
+
136
+ + (void)setSilverEggProdKey:(nonnull NSString *)silverEggProdKey
137
+ NS_SWIFT_NAME(set(silverEggProdKey:));
138
+
139
+ // Remote Configuration
140
+ @property (class, nonatomic, readonly, nonnull) RPRRemoteConfig *remoteConfig;
141
+
142
+ // NewsFeed
143
+ + (nullable NSArray<RPRNewsFeedEntry *> *)getNewsFeeds:(uint64_t)limit
144
+ error:(NSError * _Nullable * _Nullable)error
145
+ NS_SWIFT_NAME(getNewsFeeds(_:));
146
+
147
+ + (nullable NSArray<RPRNewsFeedEntry *> *)getNewsFeeds:(uint64_t)limit
148
+ campaignType:(RPRCampaignType)campaignType
149
+ error:(NSError * _Nullable * _Nullable)error
150
+ NS_SWIFT_NAME(getNewsFeeds(_:campaignType:));
151
+
152
+ + (nullable NSArray<RPRNewsFeedEntry *> *)getNewsFeeds:(uint64_t)limit
153
+ offsetID:(uint64_t)offsetID
154
+ error:(NSError * _Nullable * _Nullable)error
155
+ NS_SWIFT_NAME(getNewsFeeds(_:offsetID:));
156
+
157
+ + (nullable NSArray<RPRNewsFeedEntry *> *)getNewsFeeds:(uint64_t)limit
158
+ offsetID:(uint64_t)offsetID
159
+ campaignType:(RPRCampaignType)campaignType
160
+ error:(NSError * _Nullable * _Nullable)error
161
+ NS_SWIFT_NAME(getNewsFeeds(_:offsetID:campaignType:));
162
+
163
+ + (BOOL)updateNewsFeeds:(nonnull NSArray<RPRNewsFeedEntry *> *)newsFeeds error:(NSError * _Nullable * _Nullable)error
164
+ NS_SWIFT_NAME(updateNewsFeeds(_:));
165
+
166
+ @end
@@ -0,0 +1,6 @@
1
+ framework module Repro {
2
+ umbrella header "Repro.h"
3
+
4
+ export *
5
+ module * { export * }
6
+ }
@@ -1 +0,0 @@
1
- eaf8eff60f355a6f4e4d662f6f25e292
@@ -1 +0,0 @@
1
- 6e27a0567367e9e0687a5cf0ebb3f4719357b904
@@ -1 +0,0 @@
1
- a4ec51d6719ac6f1c0a43cdf183f21cb
@@ -1 +0,0 @@
1
- 6cb1f80c4db1e63fc067dc1cca7c4f201748d2cf
Binary file