@selligent-marketing-cloud/selligent-react-native 2.5.0 → 2.6.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 (71) hide show
  1. package/README.md +215 -205
  2. package/RNSelligent.podspec +2 -2
  3. package/android/build.gradle +7 -7
  4. package/android/libs/sdk-release.aar +0 -0
  5. package/android/src/main/java/com/selligent/RNSelligent.java +0 -1
  6. package/constants.d.ts +6 -0
  7. package/constants.js +14 -2
  8. package/index.d.ts +3 -0
  9. package/index.ios.js +12 -0
  10. package/ios/ClientSettings.h +1 -0
  11. package/ios/ClientSettings.m +2 -0
  12. package/ios/EnumMapper.h +4 -0
  13. package/ios/EnumMapper.m +10 -0
  14. package/ios/RNSelligent.m +7 -1
  15. package/ios/RemoteMessageDisplayType.h +5 -0
  16. package/ios/SMManagerSetting+ClientSettings.m +10 -4
  17. package/ios/include/SMBaseMessage.h +8 -12
  18. package/ios/include/SMBlock.h +2 -2
  19. package/ios/include/SMClearCache.h +0 -2
  20. package/ios/include/SMContentAlignment.h +1 -2
  21. package/ios/include/SMDeviceInfos.h +9 -7
  22. package/ios/include/SMDisplayMode.h +1 -2
  23. package/ios/include/SMEvent.h +20 -16
  24. package/ios/include/SMEventUser.h +0 -1
  25. package/ios/include/SMEventUserLogin.h +11 -16
  26. package/ios/include/SMEventUserLogout.h +12 -16
  27. package/ios/include/SMEventUserRegistration.h +12 -17
  28. package/ios/include/SMEventUserUnregistration.h +12 -16
  29. package/ios/include/SMFailure.h +1 -6
  30. package/ios/include/SMHelper.h +9 -5
  31. package/ios/include/SMInAppContentHTMLViewController.h +11 -9
  32. package/ios/include/SMInAppContentImageViewController.h +6 -5
  33. package/ios/include/SMInAppContentMessage.h +12 -12
  34. package/ios/include/SMInAppContentStyleOptions.h +91 -79
  35. package/ios/include/SMInAppContentType.h +2 -3
  36. package/ios/include/SMInAppContentURLViewController.h +10 -9
  37. package/ios/include/SMInAppContentViewController.h +3 -5
  38. package/ios/include/SMInAppMessage.h +22 -14
  39. package/ios/include/SMInAppMessageType.h +1 -5
  40. package/ios/include/SMInAppRefreshType.h +1 -1
  41. package/ios/include/SMLink.h +7 -11
  42. package/ios/include/SMLog.h +1 -1
  43. package/ios/include/SMManager+DataTransaction.h +6 -13
  44. package/ios/include/SMManager+InAppContent.h +20 -23
  45. package/ios/include/SMManager+InAppMessage.h +22 -21
  46. package/ios/include/SMManager+Location.h +5 -8
  47. package/ios/include/SMManager+Log.h +3 -14
  48. package/ios/include/SMManager+RemoteNotification.h +38 -34
  49. package/ios/include/SMManager+SMEvent.h +10 -10
  50. package/ios/include/SMManager+SMLink.h +44 -0
  51. package/ios/include/SMManager+SilentPush.h +5 -22
  52. package/ios/include/SMManager+StyleOptions.h +5 -8
  53. package/ios/include/SMManager+UserNotification.h +44 -32
  54. package/ios/include/SMManager+ViewController.h +45 -0
  55. package/ios/include/SMManager.h +11 -26
  56. package/ios/include/SMManagerInAppMessageDelegate.h +4 -5
  57. package/ios/include/SMManagerSetting+Location.h +27 -0
  58. package/ios/include/SMManagerSetting.h +53 -35
  59. package/ios/include/SMManagerSettingIAC.h +6 -17
  60. package/ios/include/SMManagerSettingIAM.h +7 -16
  61. package/ios/include/SMManagerUniversalLinksDelegate.h +23 -0
  62. package/ios/include/SMMessage.h +1 -3
  63. package/ios/include/SMNSNotification.h +2 -2
  64. package/ios/include/SMNotificationAnnotationData.h +4 -8
  65. package/ios/include/SMNotificationButtonData.h +1 -6
  66. package/ios/include/SMNotificationButtonType.h +1 -2
  67. package/ios/include/SMNotificationMessage.h +31 -0
  68. package/ios/include/SMRemoteMessageDisplayType.h +32 -0
  69. package/ios/include/SMSuccess.h +1 -4
  70. package/ios/{libSelligentMobile2.6.1.a → libSelligentMobile2.7.a} +0 -0
  71. package/package.json +1 -1
@@ -18,8 +18,8 @@ Pod::Spec.new do |s|
18
18
  s.source_files = "ios/**/*.{h,m}"
19
19
  s.requires_arc = true
20
20
 
21
- s.vendored_libraries = "ios/libSelligentMobile2.6.1.a"
22
- s.libraries = "SelligentMobile2.6.1"
21
+ s.vendored_libraries = "ios/libSelligentMobile2.7.a"
22
+ s.libraries = "SelligentMobile2.7"
23
23
 
24
24
  s.dependency "React"
25
25
  s.dependency 'PlotPlugin'
@@ -1,4 +1,3 @@
1
-
2
1
  buildscript {
3
2
  repositories {
4
3
  jcenter()
@@ -6,7 +5,7 @@ buildscript {
6
5
  }
7
6
 
8
7
  dependencies {
9
- classpath 'com.android.tools.build:gradle:4.1.3'
8
+ classpath 'com.android.tools.build:gradle:4.2.2'
10
9
  }
11
10
  }
12
11
 
@@ -27,17 +26,19 @@ android {
27
26
  lintOptions {
28
27
  abortOnError false
29
28
  }
29
+ }
30
30
 
31
- onVariantProperties { variant ->
31
+ androidComponents {
32
+ onVariants(selector(), { variant ->
32
33
  def selligentSettings = loadSelligentSettings(variant)
33
34
  if (selligentSettings != null) {
34
35
  try {
35
36
  variant.addBuildConfigField("SELLIGENT_SETTINGS", "\"" + selligentSettings + "\"", "Selligent settings")
36
37
  } catch (MissingMethodException ignored) {
37
- throw new Exception("Selligent requires Android Gradle plugin version 4.1.0 or higher.")
38
+ throw new Exception("Selligent requires Android Gradle plugin version 4.2.0 or higher.")
38
39
  }
39
40
  }
40
- }
41
+ })
41
42
  }
42
43
 
43
44
  repositories {
@@ -48,13 +49,12 @@ repositories {
48
49
  }
49
50
 
50
51
  dependencies {
51
- implementation(name:'sdk-release', ext:'aar')
52
+ implementation(name: 'sdk-release', ext: 'aar')
52
53
 
53
54
  implementation 'com.facebook.react:react-native:+'
54
55
  implementation 'com.android.support:cardview-v7:27.1.1'
55
56
  implementation 'com.plotprojects:plot-android:3.13.1'
56
57
  implementation 'com.google.code.gson:gson:2.8.5'
57
- implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
58
58
  implementation 'com.google.firebase:firebase-messaging:21.0.0'
59
59
  implementation 'androidx.work:work-runtime:2.4.0'
60
60
  implementation 'androidx.concurrent:concurrent-futures:1.1.0'
Binary file
@@ -67,7 +67,6 @@ public class RNSelligent extends ReactContextBaseJavaModule implements Lifecycle
67
67
 
68
68
  public static void configure(Application application) {
69
69
  try {
70
- SMManager.DEBUG = true;
71
70
  final HashMap<String, Object> settingsHashMap = new Gson().fromJson(
72
71
  BuildConfig.SELLIGENT_SETTINGS, new TypeToken<HashMap<String, Object>>() {}.getType()
73
72
  );
package/constants.d.ts CHANGED
@@ -25,6 +25,12 @@ export namespace InAppMessageType {
25
25
  const PASSBOOK: 5;
26
26
  }
27
27
 
28
+ export namespace RemoteMessagesDisplayType {
29
+ const AUTOMATIC = 20;
30
+ const NONE = 21;
31
+ const NOTIFICATION = 22;
32
+ }
33
+
28
34
  export namespace AndroidRemoteMessagesDisplayType {
29
35
  const AUTOMATIC = 20;
30
36
  const NONE = 21;
package/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- import {Platform} from 'react-native'
1
+ import { Platform } from 'react-native'
2
2
 
3
3
  /**
4
4
  * @module SelligentConstants
@@ -36,7 +36,7 @@ var SelligentConstants = {
36
36
  * @description
37
37
  * Defines the in-app messages type.
38
38
  */
39
- InAppMessageType: {
39
+ InAppMessageType: {
40
40
  UNKNOWN: -2,
41
41
  HIDDEN: -1,
42
42
  ALERT: 0,
@@ -46,6 +46,18 @@ var SelligentConstants = {
46
46
  MAP: 4,
47
47
  PASSBOOK: 5,
48
48
  },
49
+ /**
50
+ * @description
51
+ * Defines if and how remote messages can be displayed.
52
+ */
53
+ RemoteMessagesDisplayType: {
54
+ /** Display remote messages automatically */
55
+ AUTOMATIC: 20,
56
+ /** Don't display remote messages */
57
+ NONE: 21,
58
+ /** Display remote messages as notification */
59
+ NOTIFICATION: 22
60
+ },
49
61
  /**
50
62
  * @description
51
63
  * Defines if and how remote messages can be displayed on Android.
package/index.d.ts CHANGED
@@ -28,6 +28,9 @@ export function enableNotifications(
28
28
  errorCallback: Function,
29
29
  enabled: boolean
30
30
  ): void;
31
+ export function registerForProvisionalRemoteNotification(
32
+ successCallback: Function
33
+ ): void;
31
34
  export function displayLastReceivedRemotePushNotification(
32
35
  successCallback: Function
33
36
  ): void;
package/index.ios.js CHANGED
@@ -111,6 +111,18 @@ export default {
111
111
  RNSelligent.forceRemoteNotificationBackgroundFetchResult(iOSBackgroundFetchResult)
112
112
  return
113
113
  },
114
+
115
+ /**
116
+ * Register for Provisional Push Notifications.
117
+ *
118
+ * @param {function} successCallback Callback function on success.
119
+ */
120
+ registerForProvisionalRemoteNotification: function (successCallback) {
121
+ successCallback(SelligentHelpers.SUCCESS)
122
+ RNSelligent.registerForProvisionalRemoteNotification()
123
+ return
124
+ },
125
+
114
126
  // Broadcasts Events
115
127
 
116
128
  /**
@@ -13,6 +13,7 @@
13
13
  @property (nonatomic, strong, readonly) NSNumber *shouldDisplayRemoteNotification;
14
14
  @property (nonatomic, strong, readonly) NSNumber *configureLocationServices;
15
15
  @property (nonatomic, strong, readonly) NSNumber *clearCacheIntervalValue;
16
+ @property (nonatomic, strong, readonly) NSNumber *remoteMessageDisplayType;
16
17
  @property (nonatomic, strong, readonly) InAppMessageSettings *inAppMessageSettings;
17
18
 
18
19
  @end
@@ -13,6 +13,7 @@
13
13
  @property (nonatomic, strong) NSNumber *shouldDisplayRemoteNotification;
14
14
  @property (nonatomic, strong) NSNumber *configureLocationServices;
15
15
  @property (nonatomic, strong) NSNumber *clearCacheIntervalValue;
16
+ @property (nonatomic, strong) NSNumber *remoteMessageDisplayType;
16
17
  @property (nonatomic, strong) InAppMessageSettings *inAppMessageSettings;
17
18
 
18
19
  @end
@@ -30,6 +31,7 @@
30
31
  clientSettings.shouldDisplayRemoteNotification = dictionary[@"shouldDisplayRemoteNotification"];
31
32
  clientSettings.configureLocationServices = dictionary[@"configureLocationServices"];
32
33
  clientSettings.clearCacheIntervalValue = dictionary[@"clearCacheIntervalValue"];
34
+ clientSettings.remoteMessageDisplayType = dictionary[@"remoteMessageDisplayType"];
33
35
  clientSettings.inAppMessageSettings = [InAppMessageSettings fromDictionary:dictionary];
34
36
  return clientSettings;
35
37
  }
package/ios/EnumMapper.h CHANGED
@@ -1,12 +1,14 @@
1
1
  #import <UIKit/UIKit.h>
2
2
  #import "LogLevel.h"
3
3
  #import "InAppMessageRefreshType.h"
4
+ #import "RemoteMessageDisplayType.h"
4
5
  #import "LocationAuthorisationStatus.h"
5
6
  #import "LocationAuthorisationType.h"
6
7
  #import "ClearCacheInterval.h"
7
8
  #import "SMLog.h"
8
9
  #import "SMClearCache.h"
9
10
  #import "SMInAppRefreshType.h"
11
+ #import "SMRemoteMessageDisplayType.h"
10
12
  #import "BackgroundFetchResult.h"
11
13
  #import "SMNotificationButtonType.h"
12
14
  #import "NotificationButtonType.h"
@@ -23,6 +25,8 @@
23
25
  - (SMInAppRefreshType)smInAppRefreshTypeForInAppMessageRefreshType:(InAppMessageRefreshType)inAppMessageRefreshType;
24
26
  - (InAppMessageRefreshType)inAppMessageRefreshTypeForSMInAppRefreshType:(SMInAppRefreshType)smInAppRefreshType;
25
27
 
28
+ - (SMRemoteMessageDisplayType)smRemoteMessageDisplayTypeForRemoteMessageDisplayType: (RemoteMessageDisplayType)remoteMessageDisplayType;
29
+
26
30
  - (UIBackgroundFetchResult)uiBackgroundFetchResultForBackgroundFetchResult:(BackgroundFetchResult)backgroundFetchResult;
27
31
  - (BackgroundFetchResult)backgroundFetchResultForUIBackgroundFetchResult:(UIBackgroundFetchResult)uiBackgroundFetchResult;
28
32
 
package/ios/EnumMapper.m CHANGED
@@ -4,6 +4,7 @@
4
4
  NSDictionary *_logLevelEnumMapping;
5
5
  NSDictionary *_clearCacheIntervalEnumMapping;
6
6
  NSDictionary *_inAppRefreshTypeEnumMapping;
7
+ NSDictionary *_remoteMessageDisplayTypeEnumMapping;
7
8
  NSDictionary *_locationAuthorisationStatusMapping;
8
9
  NSDictionary *_locationAuthorisationTypeMapping;
9
10
  NSDictionary *_backgroundFetchResult;
@@ -43,6 +44,11 @@
43
44
  @(iamrtHour) : @(kSMIA_RefreshType_Hourly),
44
45
  @(iamryDay ) : @(kSMIA_RefreshType_Daily),
45
46
  };
47
+ _remoteMessageDisplayTypeEnumMapping = @{
48
+ @(rmdtAutomatic) : @(kSMRemoteMessageDisplayType_Automatic),
49
+ @(rmdtNone) : @(kSMRemoteMessageDisplayType_None),
50
+ @(rmdtNotification) : @(kSMRemoteMessageDisplayType_Notification),
51
+ };
46
52
  _backgroundFetchResult = @{
47
53
  @(bfrNewData) : @(UIBackgroundFetchResultNewData),
48
54
  @(bfrNoData) : @(UIBackgroundFetchResultNoData),
@@ -91,6 +97,10 @@
91
97
  return (InAppMessageRefreshType) ((NSNumber *)[_inAppRefreshTypeEnumMapping allKeysForObject:@(smInAppRefreshType)].firstObject).integerValue;
92
98
  }
93
99
 
100
+ -(SMRemoteMessageDisplayType)smRemoteMessageDisplayTypeForRemoteMessageDisplayType:(RemoteMessageDisplayType)remoteMessageDisplayType {
101
+ return (SMRemoteMessageDisplayType) ((NSNumber *)_remoteMessageDisplayTypeEnumMapping[@(remoteMessageDisplayType)]).integerValue;
102
+ }
103
+
94
104
  - (UIBackgroundFetchResult)uiBackgroundFetchResultForBackgroundFetchResult:(BackgroundFetchResult)backgroundFetchResult {
95
105
  return (UIBackgroundFetchResult) ((NSNumber *)_backgroundFetchResult[@(backgroundFetchResult)]).integerValue;
96
106
  }
package/ios/RNSelligent.m CHANGED
@@ -108,7 +108,7 @@ RCT_EXPORT_MODULE(RNSelligent)
108
108
  [[SMManager sharedInstance] willPresentNotification:notification withCompletionHandler:completionHandler];
109
109
  }
110
110
 
111
- + (void)didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(void))completionHandler {
111
+ + (void)didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void(^)(UNNotificationContentExtensionResponseOption options))completionHandler {
112
112
  [[SMManager sharedInstance] didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
113
113
  }
114
114
 
@@ -229,6 +229,12 @@ RCT_EXPORT_METHOD(enableNotifications:(BOOL)enable) {
229
229
  }
230
230
  }
231
231
 
232
+ RCT_EXPORT_METHOD(registerForProvisionalRemoteNotification) {
233
+ if (@available(iOS 12.0, *)) {
234
+ [[SMManager sharedInstance] registerForProvisionalRemoteNotification];
235
+ }
236
+ }
237
+
232
238
  RCT_EXPORT_METHOD(displayLastReceivedRemotePushNotification) {
233
239
  [[SMManager sharedInstance] displayLastReceivedRemotePushNotification];
234
240
  }
@@ -0,0 +1,5 @@
1
+ typedef enum RemoteMessageDisplayType : NSInteger {
2
+ rmdtAutomatic = 20,
3
+ rmdtNone = 21,
4
+ rmdtNotification = 22,
5
+ } RemoteMessageDisplayType;
@@ -1,4 +1,5 @@
1
1
  #import "SMManagerSetting+ClientSettings.h"
2
+ #import "SMManagerSetting+Location.h"
2
3
  #import "SMManagerSettingIAM.h"
3
4
  #import "ClientSettings.h"
4
5
  #import "EnumMapper.h"
@@ -35,19 +36,24 @@
35
36
  settings.shouldClearBadge = shouldClearBadgeAsNumber.boolValue;
36
37
  }
37
38
 
39
+ if(clientSettings.configureLocationServices.boolValue) {
40
+ [settings configureLocationService];
41
+ }
42
+
38
43
  NSNumber *shouldDisplayRemoteNotificationAsNumber = clientSettings.shouldDisplayRemoteNotification;
39
44
  if(shouldDisplayRemoteNotificationAsNumber) {
40
45
  settings.shouldDisplayRemoteNotification = shouldDisplayRemoteNotificationAsNumber.boolValue;
41
46
  }
42
47
 
43
- if(clientSettings.configureLocationServices.boolValue) {
44
- [settings configureLocationService];
45
- }
46
-
47
48
  NSNumber *clearCacheIntervalValueAsNumber = clientSettings.clearCacheIntervalValue;
48
49
  if(clearCacheIntervalValueAsNumber) {
49
50
  settings.clearCacheIntervalValue = [[EnumMapper sharedEnumMapper] smClearCacheForClearCacheInterval:clearCacheIntervalValueAsNumber.integerValue]; //((SMClearCache) );
50
51
  }
52
+
53
+ NSNumber *remoteMessageDisplayType = clientSettings.remoteMessageDisplayType;
54
+ if(remoteMessageDisplayType) {
55
+ settings.remoteMessageDisplayType = [[EnumMapper sharedEnumMapper] smRemoteMessageDisplayTypeForRemoteMessageDisplayType:remoteMessageDisplayType.integerValue];
56
+ }
51
57
  }
52
58
 
53
59
  + (SMManagerSettingIAM *)_iamManagerSettingsFor:(ClientSettings *)clientSettings {
@@ -10,43 +10,39 @@
10
10
 
11
11
  /*!
12
12
  * @discussion This is the Base class for message (push notif, in app message and in app content)
13
- * #SMBaseMessage :#
14
13
  */
15
14
  @interface SMBaseMessage : NSObject
16
15
 
17
16
  /*!
18
17
  * NSString instance providing the id of the message
19
18
  */
20
- @property (nonatomic) NSString *idMessage;
19
+ @property (readonly, nonatomic) NSString *_Nullable idMessage;
21
20
 
22
21
  /*!
23
22
  * NSDate instance providing the creation date of the message
24
- * @deprecated Deprecated use receptionDate instead
23
+ *
24
+ * @warning Deprecated - use receptionDate instead
25
25
  */
26
- @property (nonatomic) NSDate *dateCreation __deprecated __deprecated_msg("Use receptionDate instead");
26
+ @property (readonly, nonatomic) NSDate *_Nullable dateCreation __deprecated __deprecated_msg("Use receptionDate instead");
27
27
 
28
28
  /*!
29
29
  * NSDate instance providing the reception date on sdk side of the message
30
30
  */
31
- @property (nonatomic) NSDate *receptionDate;
31
+ @property (readonly, nonatomic) NSDate *_Nullable receptionDate;
32
32
 
33
33
  /*!
34
34
  * NSDate instance providing the expiration date of the message
35
35
  */
36
- @property (nonatomic) NSDate *expirationDate;
36
+ @property (readonly, nonatomic) NSDate *_Nullable expirationDate;
37
37
 
38
38
  /*!
39
39
  * NSDate instance providing the creation date of the message
40
40
  */
41
- @property (nonatomic) NSDate *creationDate;
41
+ @property (readonly, nonatomic) NSDate *_Nullable creationDate;
42
42
 
43
43
  /*!
44
44
  * bool instance infiorming if the message has already been displayed and viewed by user
45
45
  */
46
- @property (nonatomic) bool isViewed;
46
+ @property (readonly, nonatomic) bool isViewed;
47
47
 
48
- /*!
49
- * bool instance infiorming if the message has been deleted
50
- */
51
- @property (nonatomic) bool isDeleted;
52
48
  @end
@@ -12,10 +12,10 @@
12
12
  * @typedef type of block that will be triggered when an event has been succesfully sent
13
13
  * @param success a SMSuccess object
14
14
  */
15
- typedef void(^SMCompletionBlockSuccess)(SMSuccess *success);
15
+ typedef void(^SMCompletionBlockSuccess)(SMSuccess *_Nullable success);
16
16
 
17
17
  /**
18
18
  * @typedef type of block that will be triggered when an event has failed to be sent
19
19
  * @param failure a SMFailure failure
20
20
  */
21
- typedef void(^SMCompletionBlockFailure)(SMFailure *failure);
21
+ typedef void(^SMCompletionBlockFailure)(SMFailure *_Nullable failure);
@@ -6,10 +6,8 @@
6
6
  // Copyright (c) 2015 Selligent. All rights reserved.
7
7
  //
8
8
 
9
-
10
9
  /**
11
10
  * Enumeration used to define how often the SDK's cache should automaticaly clear itself
12
- * #SMClearCache :#
13
11
  */
14
12
  typedef NS_ENUM(NSInteger, SMClearCache) {
15
13
  /**
@@ -7,7 +7,7 @@
7
7
  //
8
8
 
9
9
  /**
10
- * #SMContentAlignment :#
10
+ *
11
11
  */
12
12
  typedef NS_ENUM(NSInteger, SMContentAlignment) {
13
13
  /*!
@@ -25,4 +25,3 @@ typedef NS_ENUM(NSInteger, SMContentAlignment) {
25
25
  */
26
26
  kSMAlignCenter
27
27
  };
28
-
@@ -9,28 +9,30 @@
9
9
  #import <Foundation/Foundation.h>
10
10
 
11
11
  /*!
12
- * #SMDeviceInfos :#
13
12
  */
14
13
  @interface SMDeviceInfos : NSObject
15
14
 
16
15
  /*!
17
16
  * Any External Id in your possession that you wish to transmit to the back-end
18
- * @discussion NSString
17
+ *
18
+ * @discussion NSString representing your external, custom identifier.
19
19
  * By default, it is an empty string
20
20
  */
21
21
  @property (nonatomic) NSString* _Nullable externalId;
22
22
 
23
23
  /*!
24
24
  * Create a generic deviceinfos object
25
- * @return a SMDeviceInfos object
25
+ *
26
+ * @return An SMDeviceInfos object
26
27
  */
27
- + (instancetype _Nullable )defaultDeviceInfos;
28
+ + (instancetype _Nullable ) defaultDeviceInfos;
28
29
 
29
30
  /*!
30
31
  * Create a deviceinfos object with an external id property already set with the value provided
31
- * @param externalId a string containing the id you want to provide to the back-end
32
- * @return a SMDeviceInfos object
32
+ *
33
+ * @param externalId An string containing the id you want to provide to the back-end
34
+ * @return An SMDeviceInfos object
33
35
  */
34
- + (instancetype _Nullable )deviceInfosWithExternalId:(NSString*_Nullable) externalId;
36
+ + (instancetype _Nullable ) deviceInfosWithExternalId:(NSString*_Nullable) externalId;
35
37
 
36
38
  @end
@@ -6,9 +6,8 @@
6
6
  // Copyright © 2016 Selligent. All rights reserved.
7
7
  //
8
8
 
9
-
10
9
  /*!
11
- * #SMDisplayMode :#
10
+ *
12
11
  */
13
12
  typedef NS_ENUM(NSInteger, SMDisplayMode) {
14
13
  /*!
@@ -11,15 +11,11 @@
11
11
  #import "SMFailure.h"
12
12
  #import "SMSuccess.h"
13
13
 
14
-
15
-
16
14
  /*!
17
- * @discussion This is the Base class for all type of events
18
- * #SMEvent :#
15
+ * This is the Base class for all type of events
19
16
  */
20
17
  @interface SMEvent : NSObject
21
18
 
22
-
23
19
  /*!
24
20
  * Confirm if the current event should be cached or not
25
21
  * @discussion If the event fail to be delivered to your backend, then by default, it is cached into an internal queue.
@@ -29,36 +25,44 @@
29
25
  */
30
26
  @property (nonatomic) BOOL shouldCache;
31
27
 
32
-
33
-
34
28
  /*!
35
29
  * Create a generic event object that will be sent to platform
36
- * @param dict a Dictionary containing any kind of custom datas that must be stored and managed by platform
37
- * @return a SMEvent object
30
+ *
31
+ * @param dict A Dictionary containing any kind of custom datas that must be stored and managed by platform
32
+ * @return An SMEvent object
38
33
  */
39
- + (instancetype _Nonnull)eventWithDictionary:(NSDictionary* _Nullable)dict;
34
+ + (instancetype _Nonnull) eventWithDictionary:(NSDictionary* _Nullable)dict;
40
35
 
41
36
  /*!
42
37
  * Allow to initialise a success block and/or a failure block that will be triggered after an event is sent to the platform
43
38
  *
44
- * @param blockSuccess a SMCompletionBlockSuccess block that will be triggered if the send to the platform is successfull
45
- * @param blockFailure a SMCompletionBlockFailure block that will be triggered if the send to the platform has failed
39
+ * @param blockSuccess An SMCompletionBlockSuccess block that will be triggered if the send to the platform is successfull
40
+ * @param blockFailure An SMCompletionBlockFailure block that will be triggered if the send to the platform has failed
46
41
  * @discussion This method may be used as follow:
47
42
  *
48
43
  * @code
49
44
  * NSDictionary *dictMyCustomData = @{@"MyKey": @"MyValue"};
45
+ *
50
46
  * SMEvent *event = [SMEvent eventWithDictionary:dictMyCustomData];
51
- * [event applyBlockSuccess:^(SMSuccess *success) {
52
- * // My code for success}
53
- * BlockFailure:^(SMFailure *failure) {
47
+ *
48
+ * [event applyBlockSuccess:^(SMSuccess *success) {
49
+ *
50
+ * // My code for success}
51
+ *
52
+ * BlockFailure:^(SMFailure *failure) {
53
+ *
54
54
  * // My code for failure }];
55
+ *
55
56
  * [[SMManager sharedInstance] sendSMEvent:event];
56
57
  * @endcode
58
+ *
57
59
  * This method is optional. Use it only if you need it.
58
60
  * @warning It is developer's responsability to make sure no strong retrain cycles are added to the completion-blocks.
59
61
  * Make sure to read the following [Apple documentation.](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html#//apple_ref/doc/uid/TP40011210-CH8-SW16)
62
+ * @see SMCompletionBlockSuccess
63
+ * @see SMCompletionBlockFailure
60
64
  */
61
- - (void)applyBlockSuccess:(SMCompletionBlockSuccess _Nullable)blockSuccess BlockFailure:(SMCompletionBlockFailure _Nullable)blockFailure;
65
+ - (void) applyBlockSuccess:(SMCompletionBlockSuccess _Nullable)blockSuccess BlockFailure:(SMCompletionBlockFailure _Nullable)blockFailure;
62
66
 
63
67
  @end
64
68
 
@@ -9,7 +9,6 @@
9
9
  #import "SMEvent.h"
10
10
 
11
11
  /*!
12
- * @inherits SMEvent
13
12
  * @discussion Class representing all User-eventing
14
13
  * Instances of this class should not be directly created.
15
14
  * Please use children classes instead.
@@ -9,38 +9,33 @@
9
9
  #import "SMEventUser.h"
10
10
 
11
11
  /*!
12
- * @class SMEventUserLogin
13
- * @inherits SMEventUser
14
- * @discussion user login event class
15
- * #SMEventUserLogin:#
12
+ * User login event class
16
13
  */
17
14
  @interface SMEventUserLogin : SMEventUser
18
15
 
19
-
20
16
  /*!
21
17
  * Create a UserLogin event object that will be sent to selligent platform when user logged in
22
18
  *
23
- * @param mail the e-mail of the user
24
- * @return a SMEventUserLogin object
19
+ * @param mail The e-mail of the user
20
+ * @return An SMEventUserLogin object
25
21
  */
26
- + (instancetype _Nonnull)eventWithEmail:(NSString*_Null_unspecified)mail;
22
+ + (instancetype _Nonnull) eventWithEmail:(NSString*_Null_unspecified)mail;
27
23
 
28
24
  /*!
29
25
  * Create a UserLogin event object that will be sent to selligent platform when user logged in
30
26
  *
31
- * @param mail the e-mail of the user
32
- * @param dict a Dictionary containing a string as data that must be stored and managed by platform
27
+ * @param mail The e-mail of the user
28
+ * @param dict A Dictionary containing a string as data that must be stored and managed by platform
33
29
  * If email is not provided you can use in the dictionary an alternate key/value field to search for the user
34
- * example: [SMEventUserLogin eventWithEmail @"" Dictionary: @{@"userID": @"1234"}];
35
- * @return a SMEventUserLogin object
30
+ * @return An SMEventUserLogin object
36
31
  */
37
- + (instancetype _Nonnull)eventWithEmail:(NSString*_Null_unspecified)mail Dictionary:(NSDictionary<NSString*,NSString*>*_Nullable)dict;
32
+ + (instancetype _Nonnull) eventWithEmail:(NSString*_Null_unspecified)mail Dictionary:(NSDictionary<NSString*,NSString*>*_Nullable)dict;
38
33
 
39
34
  /*!
40
35
  * Create a UserLogin event object that will be sent to platform
41
- * @param dict a Dictionary containing an alternate key/value field to search for the user
42
- * example: [SMEventUserLogin eventWithDictionary: @{@"userID": @"1234"}];
43
- * @return a SMEventUserLogin object
36
+ *
37
+ * @param dict A Dictionary containing an alternate key/value field to search for the user
38
+ * @return An SMEventUserLogin object
44
39
  */
45
40
  + (instancetype _Nonnull)eventWithDictionary:(NSDictionary* _Nullable)dict;
46
41
 
@@ -9,38 +9,34 @@
9
9
  #import "SMEventUser.h"
10
10
 
11
11
  /*!
12
- * @class SMEventUserLogout
13
- * @inherits SMEventUser
14
- * @discussion user logout event class
15
- * #SMEventUserLogout:#
12
+ * User logout event class
16
13
  */
17
14
  @interface SMEventUserLogout : SMEventUser
18
15
 
19
16
  /*!
20
17
  * Create a UserLogout event object that will be sent to selligent platform when user logged out
21
18
  *
22
- * @param mail the e-mail of the user
23
- * @return a SMEventUserLogout object
19
+ * @param mail The e-mail of the user
20
+ * @return An SMEventUserLogout object
24
21
  */
25
- + (instancetype _Nonnull)eventWithEmail:(NSString*_Null_unspecified)mail;
22
+ + (instancetype _Nonnull) eventWithEmail:(NSString*_Null_unspecified)mail;
26
23
 
27
24
  /*!
28
25
  * Create a UserLogout event object that will be sent to selligent platform when user logged out
29
26
  *
30
- * @param mail the e-mail of the user
31
- * @param dict a Dictionary containing a string as data that must be stored and managed by platform
27
+ * @param mail The e-mail of the user
28
+ * @param dict A Dictionary containing a string as data that must be stored and managed by platform
32
29
  * If email is not provided you can use in the dictionary an alternate key/value field to search for the user
33
- * example: [SMEventUserLogout eventWithEmail @"" Dictionary: @{@"userID": @"1234"}];
34
- * @return a SMEventUserLogout object
30
+ * @return An SMEventUserLogout object
35
31
  */
36
- + (instancetype _Nonnull)eventWithEmail:(NSString*_Null_unspecified)mail Dictionary:(NSDictionary<NSString*,NSString*>*_Nullable)dict;
32
+ + (instancetype _Nonnull) eventWithEmail:(NSString*_Null_unspecified)mail Dictionary:(NSDictionary<NSString*,NSString*>*_Nullable)dict;
37
33
 
38
34
  /*!
39
35
  * Create a UserLogout event object that will be sent to platform
40
- * @param dict a Dictionary containing an alternate key/value field to search for the user
41
- * example: [SMEventUserLogout eventWithDictionary:@{@"userID": @"1234"}];
42
- * @return a SMEventUserLogout object
36
+ *
37
+ * @param dict A Dictionary containing an alternate key/value field to search for the user
38
+ * @return An SMEventUserLogout object
43
39
  */
44
- + (instancetype _Nonnull)eventWithDictionary:(NSDictionary* _Nullable)dict;
40
+ + (instancetype _Nonnull) eventWithDictionary:(NSDictionary* _Nullable)dict;
45
41
 
46
42
  @end