cordova-plugin-repro 6.5.0 → 6.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 (26) hide show
  1. package/package.json +1 -1
  2. package/plugin.xml +6 -2
  3. package/repro-version.json +3 -3
  4. package/src/android/CordovaPlugin.java +92 -4
  5. package/src/android/repro-android-sdk.aar +0 -0
  6. package/src/android/repro-android-sdk.gradle +0 -13
  7. package/src/ios/CDVRepro.m +116 -0
  8. package/src/ios/Repro.xcframework/Info.plist +43 -0
  9. package/src/ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPREventProperties.h +0 -0
  10. package/src/ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPRNewsFeedEntry.h +11 -0
  11. package/src/ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPRRemoteConfig.h +2 -2
  12. package/src/ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/RPRUserProfileGender.h +0 -0
  13. package/src/ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Headers/Repro.h +11 -0
  14. package/src/ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Info.plist +0 -0
  15. package/src/ios/{Repro.framework → Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework}/Modules/module.modulemap +0 -0
  16. package/src/ios/Repro.xcframework/ios-arm64_armv7_armv7s/Repro.framework/Repro +0 -0
  17. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPREventProperties.h +90 -0
  18. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPRNewsFeedEntry.h +40 -0
  19. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPRRemoteConfig.h +119 -0
  20. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/RPRUserProfileGender.h +14 -0
  21. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Headers/Repro.h +166 -0
  22. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Info.plist +0 -0
  23. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Modules/module.modulemap +6 -0
  24. package/src/ios/Repro.xcframework/ios-arm64_i386_x86_64-simulator/Repro.framework/Repro +0 -0
  25. package/www/Repro.js +52 -35
  26. package/src/ios/Repro.framework/Repro +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordova-plugin-repro",
3
- "version": "6.5.0",
3
+ "version": "6.8.0",
4
4
  "description": "Repro Cordova Plugin",
5
5
  "cordova": {
6
6
  "id": "cordova-plugin-repro",
package/plugin.xml CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version='1.0' encoding='UTF-8'?>
2
2
 
3
- <plugin xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-repro" version="6.5.0" xmlns="http://apache.org/cordova/ns/plugins/1.0">
3
+ <plugin xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-repro" version="6.8.0" xmlns="http://apache.org/cordova/ns/plugins/1.0">
4
4
  <name>Repro</name>
5
5
  <description>Repro Cordova Plugin</description>
6
6
  <license>Commercial</license>
@@ -31,8 +31,9 @@
31
31
 
32
32
  <framework src="SystemConfiguration.framework"/>
33
33
  <framework src="WebKit.framework"/>
34
+ <framework src="UserNotifications.framework"/>
34
35
 
35
- <framework custom="true" src="src/ios/Repro.framework"/>
36
+ <framework custom="true" src="src/ios/Repro.xcframework"/>
36
37
  </platform>
37
38
 
38
39
  <!-- android -->
@@ -71,3 +72,6 @@
71
72
 
72
73
 
73
74
 
75
+
76
+
77
+
@@ -1,5 +1,5 @@
1
1
  {
2
- "ios-sdk": "5.6.0",
3
- "android-sdk": "5.5.1",
4
- "bridge": "6.5.0"
2
+ "ios-sdk": "5.8.1",
3
+ "android-sdk": "5.6.2",
4
+ "bridge": "6.8.0"
5
5
  }
@@ -7,6 +7,7 @@ import android.view.Display;
7
7
  import android.view.WindowManager;
8
8
 
9
9
  import java.text.SimpleDateFormat;
10
+ import java.util.EnumSet;
10
11
  import java.util.Date;
11
12
  import java.util.HashMap;
12
13
  import java.util.Iterator;
@@ -26,6 +27,7 @@ import org.json.JSONObject;
26
27
  import io.repro.android.Repro;
27
28
  import io.repro.android.CordovaBridge;
28
29
  import io.repro.android.newsfeed.NewsFeedEntry;
30
+ import io.repro.android.newsfeed.NewsFeedCampaignType;
29
31
 
30
32
  /**
31
33
  * Created by nekoe on 1/15/16.
@@ -137,6 +139,12 @@ public final class CordovaPlugin extends org.apache.cordova.CordovaPlugin {
137
139
  else if ("getNewsFeedsWithLimitAndOffsetId".equals(action)) {
138
140
  return getNewsFeedsWithLimitAndOffsetId(args, callbackContext);
139
141
  }
142
+ else if ("getNewsFeedsWithLimitAndCampaignType".equals(action)) {
143
+ return getNewsFeedsWithLimitAndCampaignType(args, callbackContext);
144
+ }
145
+ else if ("getNewsFeedsWithLimitAndOffsetIdAndCampaignType".equals(action)) {
146
+ return getNewsFeedsWithLimitAndOffsetIdAndCampaignType(args, callbackContext);
147
+ }
140
148
  else if ("updateNewsFeeds".equals(action)) {
141
149
  return updateNewsFeeds(args, callbackContext);
142
150
  }
@@ -145,6 +153,7 @@ public final class CordovaPlugin extends org.apache.cordova.CordovaPlugin {
145
153
  }
146
154
 
147
155
  // API implementation
156
+ // CordovaArgs: https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/CordovaArgs.java
148
157
 
149
158
  private boolean setup(final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
150
159
  final String token = args.getString(0);
@@ -623,7 +632,7 @@ public final class CordovaPlugin extends org.apache.cordova.CordovaPlugin {
623
632
 
624
633
  private boolean getNewsFeedsWithLimit(final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
625
634
  final Object limit = args.opt(0);
626
- if (!isValidNewsFeedRequestParam(limit)) {
635
+ if (!isValidNewsFeedRequestNumericParam(limit)) {
627
636
  android.util.Log.e("Repro", "Didn't get NewsFeed: limit should be Number and more than 0.");
628
637
  return true;
629
638
  }
@@ -649,13 +658,13 @@ public final class CordovaPlugin extends org.apache.cordova.CordovaPlugin {
649
658
 
650
659
  private boolean getNewsFeedsWithLimitAndOffsetId(final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
651
660
  final Object limit = args.opt(0);
652
- if (!isValidNewsFeedRequestParam(limit)) {
661
+ if (!isValidNewsFeedRequestNumericParam(limit)) {
653
662
  android.util.Log.e("Repro", "Didn't get NewsFeed: limit should be Number and more than 0.");
654
663
  return true;
655
664
  }
656
665
 
657
666
  final Object offsetId = args.opt(1);
658
- if (!isValidNewsFeedRequestParam(offsetId)) {
667
+ if (!isValidNewsFeedRequestNumericParam(offsetId)) {
659
668
  android.util.Log.e("Repro", "Didn't get NewsFeed: offset id should be Number and more than 0.");
660
669
  return true;
661
670
  }
@@ -679,7 +688,85 @@ public final class CordovaPlugin extends org.apache.cordova.CordovaPlugin {
679
688
  return true;
680
689
  }
681
690
 
682
- private boolean isValidNewsFeedRequestParam(Object param) {
691
+ private boolean getNewsFeedsWithLimitAndCampaignType(final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
692
+ final Object limit = args.opt(0);
693
+ if (!isValidNewsFeedRequestNumericParam(limit)) {
694
+ android.util.Log.e("Repro", "Cannot get NewsFeed: limit should be Number and more than 0.");
695
+ return true;
696
+ }
697
+
698
+ final NewsFeedCampaignType mappedCampaignType = mapToCampaignTypes(args.optString(1));
699
+ cordova.getThreadPool().execute(new Runnable() {
700
+ @Override
701
+ public void run() {
702
+ JSONArray arr = new JSONArray();
703
+ try {
704
+ List<NewsFeedEntry> newsFeedEntries = Repro.getNewsFeeds(((Number) limit).intValue(), mappedCampaignType);
705
+ for (NewsFeedEntry newsFeedEntry : newsFeedEntries) {
706
+ arr.put(newsFeedEntryToJSONObject(newsFeedEntry));
707
+ }
708
+ callbackContext.success(arr);
709
+ } catch (Exception e) {
710
+ callbackContext.error("Failed to get NewsFeeds: " + e.getMessage());
711
+ }
712
+ }
713
+ });
714
+
715
+ return true;
716
+ }
717
+
718
+ private boolean getNewsFeedsWithLimitAndOffsetIdAndCampaignType(final CordovaArgs args, final CallbackContext callbackContext) throws JSONException {
719
+ final Object limit = args.opt(0);
720
+ if (!isValidNewsFeedRequestNumericParam(limit)) {
721
+ android.util.Log.e("Repro", "Cannot get NewsFeed: limit should be Number and more than 0.");
722
+ return true;
723
+ }
724
+
725
+ final Object offsetId = args.opt(1);
726
+ if (!isValidNewsFeedRequestNumericParam(offsetId)) {
727
+ android.util.Log.e("Repro", "Cannot get NewsFeed: offset id should be Number and more than 0.");
728
+ return true;
729
+ }
730
+
731
+ final NewsFeedCampaignType mappedCampaignType = mapToCampaignTypes(args.optString(2));
732
+ cordova.getThreadPool().execute(new Runnable() {
733
+ @Override
734
+ public void run() {
735
+ JSONArray arr = new JSONArray();
736
+ try {
737
+ List<NewsFeedEntry> newsFeedEntries = Repro.getNewsFeeds(((Number) limit).intValue(), ((Number) offsetId).intValue(), mappedCampaignType);
738
+ for (NewsFeedEntry newsFeedEntry : newsFeedEntries) {
739
+ arr.put(newsFeedEntryToJSONObject(newsFeedEntry));
740
+ }
741
+ callbackContext.success(arr);
742
+ } catch (Exception e) {
743
+ callbackContext.error("Failed to get NewsFeeds: " + e.getMessage());
744
+ }
745
+ }
746
+ });
747
+
748
+ return true;
749
+ }
750
+
751
+ private NewsFeedCampaignType mapToCampaignTypes(final String campaignType) {
752
+ if (campaignType == null) {
753
+ return NewsFeedCampaignType.Unknown;
754
+ }
755
+
756
+ if (campaignType.equals(NewsFeedCampaignType.PushNotification.getValue())) {
757
+ return NewsFeedCampaignType.PushNotification;
758
+ } else if (campaignType.equals(NewsFeedCampaignType.InAppMessage.getValue())) {
759
+ return NewsFeedCampaignType.InAppMessage;
760
+ } else if (campaignType.equals(NewsFeedCampaignType.WebMessage.getValue())) {
761
+ return NewsFeedCampaignType.WebMessage;
762
+ } else if (campaignType.equals(NewsFeedCampaignType.All.getValue())) {
763
+ return NewsFeedCampaignType.All;
764
+ } else {
765
+ return NewsFeedCampaignType.Unknown;
766
+ }
767
+ }
768
+
769
+ private boolean isValidNewsFeedRequestNumericParam(Object param) {
683
770
  return param instanceof Number && ((Number) param).intValue() > 0;
684
771
  }
685
772
 
@@ -696,6 +783,7 @@ public final class CordovaPlugin extends org.apache.cordova.CordovaPlugin {
696
783
  entryObject.put("link_url", linkUrl);
697
784
  entryObject.put("image_url", imageUrl);
698
785
  entryObject.put("delivered_at", sDateFormat.format(entry.deliveredAt));
786
+ entryObject.put("campaign_type", entry.campaignType.getValue());
699
787
  entryObject.put("shown", entry.shown);
700
788
  entryObject.put("read", entry.read);
701
789
 
Binary file
@@ -26,18 +26,5 @@ buildscript {
26
26
 
27
27
  dependencies {
28
28
  classpath 'com.android.tools.build:gradle:+'
29
- classpath 'com.google.gms:google-services:4.0.2'
30
29
  }
31
30
  }
32
-
33
- cdvPluginPostBuildExtras.add({
34
- def skipGoogleServicesPluginApply = false
35
- project.rootDir.eachDir { dir ->
36
- if (dir.getName() == "cordova-support-google-services" || dir.getName() == "phonegap-plugin-push") {
37
- skipGoogleServicesPluginApply = true
38
- }
39
- }
40
- if(!skipGoogleServicesPluginApply && project.plugins.findPlugin("com.google.gms.google-services") == null) {
41
- apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
42
- }
43
- })
@@ -418,6 +418,104 @@ static NSDictionary* convertNSStringJSONToNSDictionary(NSString* json) {
418
418
  }];
419
419
  }
420
420
 
421
+ - (void)getNewsFeedsWithLimitAndCampaignType:(CDVInvokedUrlCommand*)command
422
+ {
423
+ NSNumber* limit = [command.arguments objectAtIndex:0];
424
+ if (![self isValidNewsFeedRequestParam:limit]) {
425
+ NSLog(@"ERROR: Repro Didn't get NewsFeed: limit should be Number and more than 0.");
426
+ return;
427
+ }
428
+
429
+ NSString* rawCampaignType = [command.arguments objectAtIndex:1];
430
+ RPRCampaignType convertedCampaigntype = [self getNewsFeedCampaignType:rawCampaignType];
431
+
432
+ [self.commandDelegate runInBackground:^{
433
+ NSError *error = nil;
434
+ NSArray<RPRNewsFeedEntry *> *entries = [Repro getNewsFeeds:[limit unsignedLongLongValue] campaignType:convertedCampaigntype error:&error];
435
+
436
+ if (error)
437
+ {
438
+ NSString *errString = [error localizedDescription];
439
+ NSString *errMessage = [NSString.alloc initWithFormat:@"Failed to get NewsFeeds: %@", errString];
440
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:errMessage];
441
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
442
+ return;
443
+ }
444
+
445
+ NSMutableArray<NSDictionary *> *arr = [NSMutableArray.alloc initWithCapacity:entries.count];
446
+ for (RPRNewsFeedEntry *entry in entries) {
447
+ [arr addObject:[self newsFeedEntryToDictionary:entry]];
448
+ }
449
+
450
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:arr];
451
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
452
+ }];
453
+ }
454
+
455
+ - (void)getNewsFeedsWithLimitAndOffsetIdAndCampaignType:(CDVInvokedUrlCommand*)command
456
+ {
457
+ NSNumber* limit = [command.arguments objectAtIndex:0];
458
+ if (![self isValidNewsFeedRequestParam:limit]) {
459
+ NSLog(@"ERROR: Repro Didn't get NewsFeed: limit should be Number and more than 0.");
460
+ return;
461
+ }
462
+
463
+ NSNumber* offsetId = [command.arguments objectAtIndex:1];
464
+ if (![self isValidNewsFeedRequestParam:offsetId])
465
+ {
466
+ NSLog(@"ERROR: Repro Didn't get NewsFeed: offset id should be Number and more than 0.");
467
+ return;
468
+ }
469
+
470
+ NSString* rawCampaignType = [command.arguments objectAtIndex:2];
471
+ RPRCampaignType convertedCampaigntype = [self getNewsFeedCampaignType:rawCampaignType];
472
+
473
+ [self.commandDelegate runInBackground:^{
474
+ NSError *error = nil;
475
+ NSArray<RPRNewsFeedEntry *> *entries = [Repro getNewsFeeds:[limit unsignedLongLongValue] offsetID:[offsetId unsignedLongLongValue] campaignType:convertedCampaigntype error:&error];
476
+
477
+ if (error)
478
+ {
479
+ NSString *errString = [error localizedDescription];
480
+ NSString *errMessage = [NSString.alloc initWithFormat:@"Failed to get NewsFeeds: %@", errString];
481
+ CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:errMessage];
482
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
483
+ return;
484
+ }
485
+
486
+ NSMutableArray<NSDictionary *> *arr = [NSMutableArray.alloc initWithCapacity:entries.count];
487
+ for (RPRNewsFeedEntry *entry in entries) {
488
+ [arr addObject:[self newsFeedEntryToDictionary:entry]];
489
+ }
490
+
491
+ CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:arr];
492
+ [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
493
+ }];
494
+ }
495
+
496
+ - (RPRCampaignType)getNewsFeedCampaignType:(nullable NSString *)rawCampaignType
497
+ {
498
+ if (![rawCampaignType isKindOfClass:NSString.class]) {
499
+ return RPRCampaignTypeUnknown;
500
+ }
501
+
502
+ if ([rawCampaignType isEqualToString:@"push_notification"]) {
503
+ return RPRCampaignTypePushNotification;
504
+ }
505
+ else if ([rawCampaignType isEqualToString:@"in_app_message"]) {
506
+ return RPRCampaignTypeInAppMessage;
507
+ }
508
+ else if ([rawCampaignType isEqualToString:@"web_message"]) {
509
+ return RPRCampaignTypeWebMessage;
510
+ }
511
+ else if ([rawCampaignType isEqualToString:@"all"]) {
512
+ return RPRCampaignTypeAll;
513
+ }
514
+ else {
515
+ return RPRCampaignTypeUnknown;
516
+ }
517
+ }
518
+
421
519
  - (NSDictionary*)newsFeedEntryToDictionary:(RPRNewsFeedEntry *)entry
422
520
  {
423
521
  NSDictionary *entryJson = @{
@@ -429,6 +527,7 @@ static NSDictionary* convertNSStringJSONToNSDictionary(NSString* json) {
429
527
  @"shown": @(entry.shown),
430
528
  @"read": @(entry.read),
431
529
  @"delivered_at": [[self dateFormatter] stringFromDate:entry.deliveredAt],
530
+ @"campaign_type": [self convertCampaignTypeToString:entry.campaignType],
432
531
  @"link_url": entry.linkUrl ? [entry.linkUrl absoluteString] : @"",
433
532
  @"image_url": entry.imageUrl ? [entry.imageUrl absoluteString] : @""
434
533
  };
@@ -486,4 +585,21 @@ static NSDictionary* convertNSStringJSONToNSDictionary(NSString* json) {
486
585
  }];
487
586
  }
488
587
 
588
+ - (NSString *)convertCampaignTypeToString:(RPRCampaignType)campaignType
589
+ {
590
+ switch (campaignType) {
591
+ case RPRCampaignTypePushNotification:
592
+ return @"push_notification";
593
+ case RPRCampaignTypeInAppMessage:
594
+ return @"in_app_message";
595
+ case RPRCampaignTypeWebMessage:
596
+ return @"web_message";
597
+ case RPRCampaignTypeAll:
598
+ return @"all";
599
+
600
+ default:
601
+ return @"unknown";
602
+ }
603
+ }
604
+
489
605
  @end
@@ -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
+ }
package/www/Repro.js CHANGED
@@ -1,141 +1,158 @@
1
1
  var exec = require('cordova/exec');
2
2
 
3
- function Repro(){};
3
+ function Repro() { };
4
4
 
5
- Repro.prototype.setup = function(key, successCallback, errorCallback) {
5
+ Repro.prototype.setup = function (key, successCallback, errorCallback) {
6
6
  exec(successCallback, errorCallback, "Repro", "setup", [key]);
7
7
  };
8
8
 
9
- Repro.prototype.optIn = function(endUserOptedIn, successCallback, errorCallback) {
9
+ Repro.prototype.optIn = function (endUserOptedIn, successCallback, errorCallback) {
10
10
  exec(successCallback, errorCallback, "Repro", "optIn", [endUserOptedIn]);
11
11
  };
12
12
 
13
- Repro.prototype.setLogLevel = function(logLevel, successCallback, errorCallback) {
13
+ Repro.prototype.setLogLevel = function (logLevel, successCallback, errorCallback) {
14
14
  exec(successCallback, errorCallback, "Repro", "setLogLevel", [logLevel]);
15
15
  };
16
16
 
17
- Repro.prototype.setUserID = function(userId, successCallback, errorCallback) {
17
+ Repro.prototype.setUserID = function (userId, successCallback, errorCallback) {
18
18
  exec(successCallback, errorCallback, "Repro", "setUserID", [userId]);
19
19
  };
20
20
 
21
- Repro.prototype.setStringUserProfile = function(key, value, successCallback, errorCallback) {
21
+ Repro.prototype.setStringUserProfile = function (key, value, successCallback, errorCallback) {
22
22
  exec(successCallback, errorCallback, "Repro", "setStringUserProfile", [key, value]);
23
23
  };
24
24
 
25
- Repro.prototype.setIntUserProfile = function(key, value, successCallback, errorCallback) {
25
+ Repro.prototype.setIntUserProfile = function (key, value, successCallback, errorCallback) {
26
26
  exec(successCallback, errorCallback, "Repro", "setIntUserProfile", [key, value]);
27
27
  };
28
28
 
29
- Repro.prototype.setDoubleUserProfile = function(key, value, successCallback, errorCallback) {
29
+ Repro.prototype.setDoubleUserProfile = function (key, value, successCallback, errorCallback) {
30
30
  exec(successCallback, errorCallback, "Repro", "setDoubleUserProfile", [key, value]);
31
31
  };
32
32
 
33
- Repro.prototype.setDateUserProfile = function(key, value, successCallback, errorCallback) {
33
+ Repro.prototype.setDateUserProfile = function (key, value, successCallback, errorCallback) {
34
34
  exec(successCallback, errorCallback, "Repro", "setDateUserProfile", [key, value.getTime()]);
35
35
  };
36
36
 
37
- Repro.prototype.track = function(eventName, successCallback, errorCallback) {
37
+ Repro.prototype.track = function (eventName, successCallback, errorCallback) {
38
38
  exec(successCallback, errorCallback, "Repro", "track", [eventName]);
39
39
  };
40
40
 
41
- Repro.prototype.trackWithProperties = function(eventName, properties, successCallback, errorCallback) {
41
+ Repro.prototype.trackWithProperties = function (eventName, properties, successCallback, errorCallback) {
42
42
  exec(successCallback, errorCallback, "Repro", "trackWithProperties", [eventName, properties]);
43
43
  };
44
44
 
45
- Repro.prototype.trackViewContent = function(contentID, properties, successCallback, errorCallback) {
45
+ Repro.prototype.trackViewContent = function (contentID, properties, successCallback, errorCallback) {
46
46
  exec(successCallback, errorCallback, "Repro", "trackViewContent", [contentID, properties]);
47
47
  };
48
48
 
49
- Repro.prototype.trackSearch = function(properties, successCallback, errorCallback) {
49
+ Repro.prototype.trackSearch = function (properties, successCallback, errorCallback) {
50
50
  exec(successCallback, errorCallback, "Repro", "trackSearch", [properties]);
51
51
  };
52
52
 
53
- Repro.prototype.trackAddToCart = function(contentID, properties, successCallback, errorCallback) {
53
+ Repro.prototype.trackAddToCart = function (contentID, properties, successCallback, errorCallback) {
54
54
  exec(successCallback, errorCallback, "Repro", "trackAddToCart", [contentID, properties]);
55
55
  };
56
56
 
57
- Repro.prototype.trackAddToWishlist = function(properties, successCallback, errorCallback) {
57
+ Repro.prototype.trackAddToWishlist = function (properties, successCallback, errorCallback) {
58
58
  exec(successCallback, errorCallback, "Repro", "trackAddToWishlist", [properties]);
59
59
  };
60
60
 
61
- Repro.prototype.trackInitiateCheckout = function(properties, successCallback, errorCallback) {
61
+ Repro.prototype.trackInitiateCheckout = function (properties, successCallback, errorCallback) {
62
62
  exec(successCallback, errorCallback, "Repro", "trackInitiateCheckout", [properties]);
63
63
  };
64
64
 
65
- Repro.prototype.trackAddPaymentInfo = function(properties, successCallback, errorCallback) {
65
+ Repro.prototype.trackAddPaymentInfo = function (properties, successCallback, errorCallback) {
66
66
  exec(successCallback, errorCallback, "Repro", "trackAddPaymentInfo", [properties]);
67
67
  };
68
68
 
69
- Repro.prototype.trackPurchase = function(contentID, value, currency, properties, successCallback, errorCallback) {
69
+ Repro.prototype.trackPurchase = function (contentID, value, currency, properties, successCallback, errorCallback) {
70
70
  exec(successCallback, errorCallback, "Repro", "trackPurchase", [contentID, value, currency, properties]);
71
71
  };
72
72
 
73
- Repro.prototype.trackShare = function(properties, successCallback, errorCallback) {
73
+ Repro.prototype.trackShare = function (properties, successCallback, errorCallback) {
74
74
  exec(successCallback, errorCallback, "Repro", "trackShare", [properties]);
75
75
  };
76
76
 
77
- Repro.prototype.trackLead = function(properties, successCallback, errorCallback) {
77
+ Repro.prototype.trackLead = function (properties, successCallback, errorCallback) {
78
78
  exec(successCallback, errorCallback, "Repro", "trackLead", [properties]);
79
79
  };
80
80
 
81
- Repro.prototype.trackCompleteRegistration = function(properties, successCallback, errorCallback) {
81
+ Repro.prototype.trackCompleteRegistration = function (properties, successCallback, errorCallback) {
82
82
  exec(successCallback, errorCallback, "Repro", "trackCompleteRegistration", [properties]);
83
83
  };
84
84
 
85
- Repro.prototype.setPushDeviceToken = function(deviceToken, successCallback, errorCallback) {
85
+ Repro.prototype.setPushDeviceToken = function (deviceToken, successCallback, errorCallback) {
86
86
  // Deprecated
87
87
  };
88
88
 
89
- Repro.prototype.enablePushNotification = function(successCallback, errorCallback) {
89
+ Repro.prototype.enablePushNotification = function (successCallback, errorCallback) {
90
90
  exec(successCallback, errorCallback, "Repro", "enablePushNotification");
91
91
  };
92
92
 
93
- Repro.prototype.enablePushNotificationForAndroid = function(successCallback, errorCallback) {
93
+ Repro.prototype.enablePushNotificationForAndroid = function (successCallback, errorCallback) {
94
94
  exec(successCallback, errorCallback, "Repro", "enablePushNotification");
95
95
  };
96
96
 
97
- Repro.prototype.enablePushNotificationForIOS= function(successCallback, errorCallback) {
97
+ Repro.prototype.enablePushNotificationForIOS = function (successCallback, errorCallback) {
98
98
  exec(successCallback, errorCallback, "Repro", "enablePushNotificationForIOS", []);
99
99
  };
100
100
 
101
- Repro.prototype.enableInAppMessagesOnForegroundTransition = function(successCallback, errorCallback) {
101
+ Repro.prototype.enableInAppMessagesOnForegroundTransition = function (successCallback, errorCallback) {
102
102
  exec(successCallback, errorCallback, "Repro", "enableInAppMessagesOnForegroundTransition", []);
103
103
  };
104
104
 
105
- Repro.prototype.disableInAppMessagesOnForegroundTransition = function(successCallback, errorCallback) {
105
+ Repro.prototype.disableInAppMessagesOnForegroundTransition = function (successCallback, errorCallback) {
106
106
  exec(successCallback, errorCallback, "Repro", "disableInAppMessagesOnForegroundTransition", []);
107
107
  };
108
108
 
109
- Repro.prototype.getUserID = function(successCallback, errorCallback) {
109
+ Repro.prototype.getUserID = function (successCallback, errorCallback) {
110
110
  exec(successCallback, errorCallback, "Repro", "getUserID", []);
111
111
  };
112
112
 
113
- Repro.prototype.getDeviceID = function(successCallback, errorCallback) {
113
+ Repro.prototype.getDeviceID = function (successCallback, errorCallback) {
114
114
  exec(successCallback, errorCallback, "Repro", "getDeviceID", []);
115
115
  };
116
116
 
117
- Repro.prototype.trackNotificationOpened = function(notificationId, successCallback, errorCallback) {
117
+ Repro.prototype.trackNotificationOpened = function (notificationId, successCallback, errorCallback) {
118
118
  exec(successCallback, errorCallback, "Repro", "trackNotificationOpened", [notificationId]);
119
119
  };
120
120
 
121
- Repro.prototype.setSilverEggCookie = function(cookie, successCallback, errorCallback) {
121
+ Repro.prototype.setSilverEggCookie = function (cookie, successCallback, errorCallback) {
122
122
  exec(successCallback, errorCallback, "Repro", "setSilverEggCookie", [cookie]);
123
123
  };
124
124
 
125
- Repro.prototype.setSilverEggProdKey = function(prodKey, successCallback, errorCallback) {
125
+ Repro.prototype.setSilverEggProdKey = function (prodKey, successCallback, errorCallback) {
126
126
  exec(successCallback, errorCallback, "Repro", "setSilverEggProdKey", [prodKey]);
127
127
  };
128
128
 
129
- Repro.prototype.getNewsFeedsWithLimit = function(limit, successCallback, errorCallback) {
129
+ Repro.prototype.getNewsFeedsWithLimit = function (limit, successCallback, errorCallback) {
130
130
  exec(successCallback, errorCallback, "Repro", "getNewsFeedsWithLimit", [limit]);
131
131
  };
132
132
 
133
- Repro.prototype.getNewsFeedsWithLimitAndOffsetId = function(limit, offsetId, successCallback, errorCallback) {
133
+ Repro.prototype.getNewsFeedsWithLimitAndOffsetId = function (limit, offsetId, successCallback, errorCallback) {
134
134
  exec(successCallback, errorCallback, "Repro", "getNewsFeedsWithLimitAndOffsetId", [limit, offsetId]);
135
135
  };
136
136
 
137
- Repro.prototype.updateNewsFeeds = function(newsFeeds, successCallback, errorCallback) {
137
+ Repro.prototype.getNewsFeedsWithLimitAndCampaignType = function (limit, campaignType, successCallback, errorCallback) {
138
+ exec(successCallback, errorCallback, "Repro", "getNewsFeedsWithLimitAndCampaignType", [limit, campaignType]);
139
+ };
140
+
141
+ Repro.prototype.getNewsFeedsWithLimitAndOffsetIdAndCampaignType = function (limit, offsetId, campaignType, successCallback, errorCallback) {
142
+ exec(successCallback, errorCallback, "Repro", "getNewsFeedsWithLimitAndOffsetIdAndCampaignType", [limit, offsetId, campaignType]);
143
+ };
144
+
145
+ Repro.prototype.updateNewsFeeds = function (newsFeeds, successCallback, errorCallback) {
138
146
  exec(successCallback, errorCallback, "Repro", "updateNewsFeeds", [newsFeeds]);
139
147
  };
140
148
 
149
+ Repro.prototype.CampaignType = Object.freeze(
150
+ {
151
+ InAppMessage: "in_app_message",
152
+ PushNotification: "push_notification",
153
+ WebMessage: "web_message",
154
+ All: "all"
155
+ }
156
+ )
157
+
141
158
  module.exports = new Repro();
Binary file