@selligent-marketing-cloud/selligent-react-native 2.7.0 → 2.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 (81) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +122 -7
  3. package/RNSelligent.podspec +2 -1
  4. package/android/build/generated/source/buildConfig/debug/com/selligent/BuildConfig.java +12 -0
  5. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +9 -0
  6. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +16 -0
  7. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +2 -0
  8. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
  9. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  10. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  11. package/android/build/intermediates/compile_symbol_list/debug/R.txt +6408 -0
  12. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  13. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  14. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  15. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -0
  16. package/android/build/intermediates/incremental/packageDebugResources/merger.xml +2 -0
  17. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastDataFactory$1.class +0 -0
  18. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastDataFactory.class +0 -0
  19. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventDataParser.class +0 -0
  20. package/android/build/intermediates/javac/debug/classes/com/selligent/BroadcastEventType.class +0 -0
  21. package/android/build/intermediates/javac/debug/classes/com/selligent/BuildConfig.class +0 -0
  22. package/android/build/intermediates/javac/debug/classes/com/selligent/ButtonBroadcastEventDataParser.class +0 -0
  23. package/android/build/intermediates/javac/debug/classes/com/selligent/ClearCacheIntervalValue.class +0 -0
  24. package/android/build/intermediates/javac/debug/classes/com/selligent/Event.class +0 -0
  25. package/android/build/intermediates/javac/debug/classes/com/selligent/EventReceiver.class +0 -0
  26. package/android/build/intermediates/javac/debug/classes/com/selligent/EventType.class +0 -0
  27. package/android/build/intermediates/javac/debug/classes/com/selligent/GCMTokenBroadcastEventDataParser.class +0 -0
  28. package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageBroadcastEventDataParser.class +0 -0
  29. package/android/build/intermediates/javac/debug/classes/com/selligent/InAppMessageRefreshType.class +0 -0
  30. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$1.class +0 -0
  31. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$2.class +0 -0
  32. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$3.class +0 -0
  33. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$4.class +0 -0
  34. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent$5.class +0 -0
  35. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligent.class +0 -0
  36. package/android/build/intermediates/javac/debug/classes/com/selligent/RNSelligentPackage.class +0 -0
  37. package/android/build/intermediates/javac/debug/classes/com/selligent/RemoteMessageDisplayType.class +0 -0
  38. package/android/build/intermediates/javac/debug/classes/com/selligent/SMEventFactory$1.class +0 -0
  39. package/android/build/intermediates/javac/debug/classes/com/selligent/SMEventFactory.class +0 -0
  40. package/android/build/intermediates/javac/debug/classes/com/selligent/SMSettingsFactory.class +0 -0
  41. package/android/build/intermediates/javac/debug/classes/com/selligent/Settings.class +0 -0
  42. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +2 -0
  43. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +11 -0
  44. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +9 -0
  45. package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
  46. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +16 -0
  47. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  48. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +4798 -0
  49. package/android/build/outputs/logs/manifest-merger-debug-report.txt +25 -0
  50. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  51. package/android/build/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +43 -0
  52. package/android/build.gradle +9 -13
  53. package/android/libs/sdk-release.aar +0 -0
  54. package/android/src/main/java/com/selligent/RNSelligent.java +15 -0
  55. package/android/src/main/java/com/selligent/SMSettingsFactory.java +1 -0
  56. package/android/src/main/java/com/selligent/Settings.java +9 -0
  57. package/constants.d.ts +12 -0
  58. package/constants.js +24 -0
  59. package/index.d.ts +6 -0
  60. package/index.js +32 -0
  61. package/ios/ClientSettings.h +1 -0
  62. package/ios/ClientSettings.m +2 -0
  63. package/ios/EnumMapper.h +2 -0
  64. package/ios/EnumMapper.m +2 -0
  65. package/ios/LocationAuthorisationStatus.h +6 -0
  66. package/ios/LocationAuthorisationType.h +4 -0
  67. package/ios/RNSelligent.m +14 -0
  68. package/ios/SMManagerSetting+ClientSettings.m +5 -0
  69. package/ios/include/SMEvent.h +1 -1
  70. package/ios/include/SMHelper.h +6 -3
  71. package/ios/include/SMManager+InAppMessage.h +2 -2
  72. package/ios/include/SMManager+Location.h +41 -0
  73. package/ios/include/SMManager+UserNotification.h +2 -2
  74. package/ios/include/SMManager.h +1 -1
  75. package/ios/include/SMManagerInAppMessageDelegate.h +2 -2
  76. package/ios/include/SMManagerSetting+Location.h +27 -0
  77. package/ios/include/SMManagerSetting.h +2 -2
  78. package/ios/include/SMNSNotification.h +4 -10
  79. package/ios/include/SMRemoteMessageDisplayType.h +2 -2
  80. package/ios/libSelligentMobile.a +0 -0
  81. package/package.json +2 -2
@@ -0,0 +1,25 @@
1
+ -- Merging decision tree log ---
2
+ manifest
3
+ ADDED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml:2:1-5:12
4
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml:2:1-5:12
5
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml:2:1-5:12
6
+ package
7
+ ADDED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml:3:11-34
8
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
9
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
10
+ xmlns:android
11
+ ADDED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml:2:11-69
12
+ uses-sdk
13
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml reason: use-sdk injection requested
14
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
15
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
16
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
17
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
18
+ android:targetSdkVersion
19
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
20
+ ADDED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
21
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
22
+ android:minSdkVersion
23
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
24
+ ADDED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
25
+ INJECTED from /Users/ben/Documents/code/appfoundry/selligent/af-selligent-react-native-module-dev-env/node_modules/selligent-react-native/android/src/main/AndroidManifest.xml
@@ -0,0 +1,43 @@
1
+ com/selligent/EventReceiver.java
2
+ com.selligent.EventReceiver
3
+ com/selligent/RemoteMessageDisplayType.java
4
+ com.selligent.RemoteMessageDisplayType
5
+ com/selligent/SMEventFactory.java
6
+ com.selligent.SMEventFactory
7
+ com.selligent.SMEventFactory$1
8
+ com/selligent/BroadcastEventType.java
9
+ com.selligent.BroadcastEventType
10
+ com/selligent/RNSelligentPackage.java
11
+ com.selligent.RNSelligentPackage
12
+ com/selligent/ButtonBroadcastEventDataParser.java
13
+ com.selligent.ButtonBroadcastEventDataParser
14
+ com/selligent/GCMTokenBroadcastEventDataParser.java
15
+ com.selligent.GCMTokenBroadcastEventDataParser
16
+ com/selligent/InAppMessageRefreshType.java
17
+ com.selligent.InAppMessageRefreshType
18
+ com/selligent/EventType.java
19
+ com.selligent.EventType
20
+ com/selligent/RNSelligent.java
21
+ com.selligent.RNSelligent
22
+ com.selligent.RNSelligent$1
23
+ com.selligent.RNSelligent$2
24
+ com.selligent.RNSelligent$3
25
+ com.selligent.RNSelligent$4
26
+ com.selligent.RNSelligent$5
27
+ com/selligent/BuildConfig.java
28
+ com.selligent.BuildConfig
29
+ com/selligent/InAppMessageBroadcastEventDataParser.java
30
+ com.selligent.InAppMessageBroadcastEventDataParser
31
+ com/selligent/Event.java
32
+ com.selligent.Event
33
+ com/selligent/BroadcastEventDataParser.java
34
+ com.selligent.BroadcastEventDataParser
35
+ com/selligent/ClearCacheIntervalValue.java
36
+ com.selligent.ClearCacheIntervalValue
37
+ com/selligent/SMSettingsFactory.java
38
+ com.selligent.SMSettingsFactory
39
+ com/selligent/BroadcastDataFactory.java
40
+ com.selligent.BroadcastDataFactory
41
+ com.selligent.BroadcastDataFactory$1
42
+ com/selligent/Settings.java
43
+ com.selligent.Settings
@@ -10,7 +10,7 @@ buildscript {
10
10
  }
11
11
 
12
12
  apply plugin: 'com.android.library'
13
- apply plugin: 'maven'
13
+ apply plugin: 'maven-publish'
14
14
 
15
15
  android {
16
16
  compileSdkVersion 30
@@ -54,6 +54,7 @@ dependencies {
54
54
 
55
55
  implementation 'com.facebook.react:react-native:+'
56
56
  implementation 'com.android.support:cardview-v7:27.1.1'
57
+ implementation 'com.plotprojects:plot-android:3.13.1'
57
58
  implementation 'com.google.code.gson:gson:2.8.5'
58
59
  implementation 'com.google.firebase:firebase-messaging:21.0.0'
59
60
  implementation 'androidx.work:work-runtime:2.4.0'
@@ -92,7 +93,7 @@ afterEvaluate { project ->
92
93
  }
93
94
 
94
95
  task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
95
- classifier = 'javadoc'
96
+ archiveClassifier = 'javadoc'
96
97
  from androidJavadoc.destinationDir
97
98
  }
98
99
 
@@ -109,17 +110,12 @@ afterEvaluate { project ->
109
110
  }
110
111
  }
111
112
 
112
- artifacts {
113
- archives androidSourcesJar
114
- archives androidJavadocJar
115
- }
116
-
117
- task installArchives(type: Upload) {
118
- configuration = configurations.archives
119
- repositories.mavenDeployer {
120
- repository url: "file://${projectDir}/../android/maven"
121
-
122
- configureReactNativePom pom
113
+ publishing {
114
+ publications {
115
+ maven(MavenPublication) {
116
+ artifact androidSourcesJar
117
+ artifact androidJavadocJar
118
+ }
123
119
  }
124
120
  }
125
121
  }
Binary file
@@ -249,6 +249,21 @@ public class RNSelligent extends ReactContextBaseJavaModule implements Lifecycle
249
249
  SMManager.DEBUG = enable;
250
250
  }
251
251
 
252
+ @ReactMethod
253
+ public void enableGeolocation(Boolean enable) {
254
+ if (enable) {
255
+ smManager.enableGeolocation();
256
+ } else {
257
+ smManager.disableGeolocation();
258
+ }
259
+ }
260
+
261
+ @ReactMethod
262
+ public void isGeolocationEnabled(Callback successCallback) {
263
+ final Boolean isGeolocationEnabled = smManager.isGeolocationEnabled();
264
+ successCallback.invoke(isGeolocationEnabled);
265
+ }
266
+
252
267
  @ReactMethod
253
268
  public void sendEvent(ReadableMap eventMap, final Callback successCallback, final Callback errorCallback) {
254
269
  final Event event = Event.fromHashMap(eventMap.toHashMap());
@@ -10,6 +10,7 @@ class SMSettingsFactory {
10
10
  smSettings.ClientId = settings.getClientId();
11
11
  smSettings.PrivateKey = settings.getPrivateKey();
12
12
  smSettings.GoogleApplicationId = settings.getGoogleApplicationId();
13
+ smSettings.ConfigureGeolocation = settings.getConfigureLocationServices();
13
14
  smSettings.AddInAppMessageFromPushToInAppMessageList = settings.getAddInAppMessageFromPushToInAppMessageList();
14
15
  smSettings.DoNotFetchTheToken = settings.getDoNotFetchTheToken();
15
16
  smSettings.DoNotListenToThePush = settings.getDoNotListenToThePush();
@@ -17,6 +17,7 @@ class Settings {
17
17
  private Boolean doNotFetchTheToken = false;
18
18
  private Boolean doNotListenToThePush = false;
19
19
  private Boolean loadCacheAsynchronously = false;
20
+ private Boolean configureLocationServices = false;
20
21
  private ClearCacheIntervalValue clearCacheIntervalValue;
21
22
  private InAppMessageRefreshType inAppMessageRefreshType;
22
23
  private RemoteMessageDisplayType remoteMessageDisplayType;
@@ -55,6 +56,10 @@ class Settings {
55
56
  return notificationIconColor;
56
57
  }
57
58
 
59
+ public Boolean getConfigureLocationServices() {
60
+ return configureLocationServices;
61
+ }
62
+
58
63
  public Boolean getDoNotListenToThePush() { return doNotListenToThePush; }
59
64
 
60
65
  public Boolean getAddInAppMessageFromPushToInAppMessageList() { return addInAppMessageFromPushToInAppMessageList; }
@@ -84,6 +89,10 @@ class Settings {
84
89
  if (settingsHashMap.containsKey("googleApplicationId")) {
85
90
  settings.googleApplicationId = (String) settingsHashMap.get("googleApplicationId");
86
91
  }
92
+ if (settingsHashMap.containsKey("configureLocationServices")) {
93
+ settings.configureLocationServices = (Boolean) settingsHashMap.get("configureLocationServices");
94
+
95
+ }
87
96
  settings.activityName = (String) settingsHashMap.get("fullyQualifiedNotificationActivityClassName");
88
97
 
89
98
  if (settingsHashMap.containsKey("notificationSmallIcon")) {
package/constants.d.ts CHANGED
@@ -53,6 +53,18 @@ export namespace iOSBackgroundFetchResult {
53
53
  const FAILED = 62;
54
54
  }
55
55
 
56
+ export namespace iOSLocationAuthorisationStatus {
57
+ const UNKNOWN = 70;
58
+ const REFUSED = 71;
59
+ const GRANTED_IN_USE = 72;
60
+ const GRANTED_ALWAYS = 73;
61
+ }
62
+
63
+ export namespace iOSLocationAuthorisationType {
64
+ const IN_USE = 80;
65
+ const ALWAYS = 81;
66
+ }
67
+
56
68
  export namespace EventType {
57
69
  const USER_REGISTER = 90;
58
70
  const USER_UNREGISTER = 91;
package/constants.js CHANGED
@@ -102,6 +102,30 @@ var SelligentConstants = {
102
102
  /** Background fetch failed */
103
103
  FAILED: 62
104
104
  },
105
+ /**
106
+ * @description
107
+ * Description of the possible status of use of location services on a device.
108
+ */
109
+ iOSLocationAuthorisationStatus: {
110
+ /** Status of use of location services is unknown */
111
+ UNKNOWN: 70,
112
+ /** Use of location services is refused */
113
+ REFUSED: 71,
114
+ /** Use of location services is granted when in use */
115
+ GRANTED_IN_USE: 72,
116
+ /** Use of location services is always granted */
117
+ GRANTED_ALWAYS: 73
118
+ },
119
+ /**
120
+ * @description
121
+ * Defines the level of request for the authorisation of usage of location services on a device.
122
+ */
123
+ iOSLocationAuthorisationType: {
124
+ /** Request authorisation when in location services are in use */
125
+ IN_USE: 80,
126
+ /** Always request the authorisation of the location services */
127
+ ALWAYS: 81
128
+ },
105
129
  /**
106
130
  * @description
107
131
  * Defines the type of an event.
package/index.d.ts CHANGED
@@ -11,6 +11,12 @@ export function executeButtonAction(
11
11
  buttonId: string,
12
12
  messageId: string
13
13
  ): void;
14
+ export function enableGeolocation(
15
+ successCallback: Function,
16
+ errorCallback: Function,
17
+ enabled: boolean
18
+ ): void;
19
+ export function isGeolocationEnabled(successCallback: Function): void;
14
20
  export function sendEvent(
15
21
  successCallback: Function,
16
22
  errorCallback: Function,
package/index.js CHANGED
@@ -98,6 +98,38 @@ export default Object.assign(
98
98
  return
99
99
  },
100
100
 
101
+ // Location
102
+
103
+ /**
104
+ * Enable/disable geolocation.
105
+ *
106
+ * @param {function} successCallback Callback function on success.
107
+ * @param {function} errorCallback Callback function on error.
108
+ * @param {boolean} enabled Boolean to enable or disable geolocation.
109
+ */
110
+ enableGeolocation: function (successCallback, errorCallback, enabled) {
111
+ // check if required options are valid
112
+ if (!SelligentHelpers.typeMatches(enabled, 'boolean')) {
113
+ errorCallback(SelligentHelpers.wrongArgumentError('Expected a boolean.'))
114
+ return
115
+ }
116
+
117
+ // continue if options are valid
118
+ successCallback(SelligentHelpers.SUCCESS)
119
+ RNSelligent.enableGeolocation(enabled)
120
+ return
121
+ },
122
+
123
+ /**
124
+ * Check if geolocation is enabled or disabled.
125
+ *
126
+ * @param {function} successCallback Callback function on success.
127
+ */
128
+ isGeolocationEnabled: function (successCallback) {
129
+ RNSelligent.isGeolocationEnabled(successCallback)
130
+ return
131
+ },
132
+
101
133
  // Event
102
134
 
103
135
  /**
@@ -11,6 +11,7 @@
11
11
  @property (nonatomic, strong, readonly) NSNumber *shouldAddInAppMessageFromPushToInAppMessageList;
12
12
  @property (nonatomic, strong, readonly) NSNumber *shouldClearBadge;
13
13
  @property (nonatomic, strong, readonly) NSNumber *shouldDisplayRemoteNotification;
14
+ @property (nonatomic, strong, readonly) NSNumber *configureLocationServices;
14
15
  @property (nonatomic, strong, readonly) NSNumber *clearCacheIntervalValue;
15
16
  @property (nonatomic, strong, readonly) NSNumber *remoteMessageDisplayType;
16
17
  @property (nonatomic, strong, readonly) InAppMessageSettings *inAppMessageSettings;
@@ -11,6 +11,7 @@
11
11
  @property (nonatomic, strong) NSNumber *shouldAddInAppMessageFromPushToInAppMessageList;
12
12
  @property (nonatomic, strong) NSNumber *shouldClearBadge;
13
13
  @property (nonatomic, strong) NSNumber *shouldDisplayRemoteNotification;
14
+ @property (nonatomic, strong) NSNumber *configureLocationServices;
14
15
  @property (nonatomic, strong) NSNumber *clearCacheIntervalValue;
15
16
  @property (nonatomic, strong) NSNumber *remoteMessageDisplayType;
16
17
  @property (nonatomic, strong) InAppMessageSettings *inAppMessageSettings;
@@ -28,6 +29,7 @@
28
29
  clientSettings.shouldAddInAppMessageFromPushToInAppMessageList = dictionary[@"addInAppMessageFromPushToInAppMessageList"];
29
30
  clientSettings.shouldClearBadge = dictionary[@"shouldClearBadge"];
30
31
  clientSettings.shouldDisplayRemoteNotification = dictionary[@"shouldDisplayRemoteNotification"];
32
+ clientSettings.configureLocationServices = dictionary[@"configureLocationServices"];
31
33
  clientSettings.clearCacheIntervalValue = dictionary[@"clearCacheIntervalValue"];
32
34
  clientSettings.remoteMessageDisplayType = dictionary[@"remoteMessageDisplayType"];
33
35
  clientSettings.inAppMessageSettings = [InAppMessageSettings fromDictionary:dictionary];
package/ios/EnumMapper.h CHANGED
@@ -2,6 +2,8 @@
2
2
  #import "LogLevel.h"
3
3
  #import "InAppMessageRefreshType.h"
4
4
  #import "RemoteMessageDisplayType.h"
5
+ #import "LocationAuthorisationStatus.h"
6
+ #import "LocationAuthorisationType.h"
5
7
  #import "ClearCacheInterval.h"
6
8
  #import "SMLog.h"
7
9
  #import "SMClearCache.h"
package/ios/EnumMapper.m CHANGED
@@ -5,6 +5,8 @@
5
5
  NSDictionary *_clearCacheIntervalEnumMapping;
6
6
  NSDictionary *_inAppRefreshTypeEnumMapping;
7
7
  NSDictionary *_remoteMessageDisplayTypeEnumMapping;
8
+ NSDictionary *_locationAuthorisationStatusMapping;
9
+ NSDictionary *_locationAuthorisationTypeMapping;
8
10
  NSDictionary *_backgroundFetchResult;
9
11
  NSDictionary *_notificationButtonTypeMapping;
10
12
  }
@@ -0,0 +1,6 @@
1
+ typedef enum LocationAuthorisationStatus : NSInteger {
2
+ ilasUnknown = 70,
3
+ ilasRefused = 71,
4
+ ilasGrantedInUse = 72,
5
+ ilasGrantedAlways = 73
6
+ } LocationAuthorisationStatus;
@@ -0,0 +1,4 @@
1
+ typedef enum LocationAuthorisationType : NSInteger {
2
+ ilatInUse = 80,
3
+ ilatAlways = 81
4
+ } LocationAuthorisationType;
package/ios/RNSelligent.m CHANGED
@@ -3,6 +3,7 @@
3
3
  #import "SMNSNotification.h"
4
4
  #import "SMManager+DataTransaction.h"
5
5
  #import "SMManagerSetting+ClientSettings.h"
6
+ #import "SMManager+Location.h"
6
7
  #import "SMManager+Log.h"
7
8
  #import "SMManager+SMEvent.h"
8
9
  #import "SMManager+RemoteNotification.h"
@@ -188,6 +189,11 @@ RCT_EXPORT_METHOD(applyLogLevel:(NSArray<NSNumber *> *)logLevels) {
188
189
  [[SMManager sharedInstance] applyLogLevel:(SMLogLevel) requestedBitShiftedLogLevel];
189
190
  }
190
191
 
192
+ RCT_EXPORT_METHOD(isGeolocationEnabled:(RCTResponseSenderBlock)callback) {
193
+ BOOL enabled = [[SMManager sharedInstance] isGeoLocationEnabled];
194
+ callback(@[@(enabled), [NSNull null]]);
195
+ }
196
+
191
197
  RCT_EXPORT_METHOD(sendEvent:(NSDictionary *)data successCallback:(RCTResponseSenderBlock)successCallback errorCallback:(RCTResponseSenderBlock)errorCallback) {
192
198
  Event *event = [Event fromDictionary:data];
193
199
  SMEvent *smEvent = [event smEventWithBlockSuccess:^(SMSuccess *success) {
@@ -198,6 +204,14 @@ RCT_EXPORT_METHOD(sendEvent:(NSDictionary *)data successCallback:(RCTResponseSen
198
204
  [[SMManager sharedInstance] sendSMEvent:smEvent];
199
205
  }
200
206
 
207
+ RCT_EXPORT_METHOD(enableGeolocation:(BOOL)enable) {
208
+ if (enable) {
209
+ [[SMManager sharedInstance] enableGeoLocation];
210
+ } else {
211
+ [[SMManager sharedInstance] disableGeoLocation];
212
+ }
213
+ }
214
+
201
215
  RCT_EXPORT_METHOD(forceRemoteNotificationBackgroundFetchResult:(nonnull NSNumber *)remoteNotificationBackgroundFetchResult) {
202
216
  self.requestedForcedRemoteNotificationBackgroundFetchResult = @([[EnumMapper sharedEnumMapper] uiBackgroundFetchResultForBackgroundFetchResult:remoteNotificationBackgroundFetchResult.integerValue]);
203
217
  }
@@ -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"
@@ -34,6 +35,10 @@
34
35
  if(shouldClearBadgeAsNumber) {
35
36
  settings.shouldClearBadge = shouldClearBadgeAsNumber.boolValue;
36
37
  }
38
+
39
+ if(clientSettings.configureLocationServices.boolValue) {
40
+ [settings configureLocationService];
41
+ }
37
42
 
38
43
  NSNumber *shouldDisplayRemoteNotificationAsNumber = clientSettings.shouldDisplayRemoteNotification;
39
44
  if(shouldDisplayRemoteNotificationAsNumber) {
@@ -34,7 +34,7 @@
34
34
  + (instancetype _Nonnull) eventWithDictionary:(NSDictionary* _Nullable)dict;
35
35
 
36
36
  /*!
37
- * Allow to initialise a success block and/or a failure block that will be triggered after an event is sent to the platform
37
+ * Allow to initialize a success block and/or a failure block that will be triggered after an event is sent to the platform
38
38
  *
39
39
  * @param blockSuccess An SMCompletionBlockSuccess block that will be triggered if the send to the platform is successfull
40
40
  * @param blockFailure An SMCompletionBlockFailure block that will be triggered if the send to the platform has failed
@@ -1,11 +1,14 @@
1
1
  //
2
- // SMHelper.h
2
+ // SMHelper+Location.h
3
3
  // MobileSDK
4
4
  //
5
- // Created by Samy Ziat on 29/09/15.
6
- // Copyright (c) 2015 Selligent. All rights reserved.
5
+ // Created by Marc Biosca on 6/29/21.
6
+ // Copyright © 2021 Selligent. All rights reserved.
7
7
  //
8
8
 
9
+ #import "SMManager+Location.h"
10
+ #import "SMManagerSetting+Location.h"
11
+
9
12
  #import "SMManagerHelper.h"
10
13
 
11
14
  #import "SMNSNotification.h"
@@ -161,8 +161,8 @@
161
161
  - (void) removeViewController;
162
162
 
163
163
  /**
164
- * Used to let the app display the inapp message linked to a remote notification
165
- * @abstract this setting will allow you to manage on app side the display of the inapp message linked to a push remote notification
164
+ * Used to let the app display the in-app message linked to a remote notification
165
+ * @abstract this setting will allow you to manage on app side the display of the in-app message linked to a push remote notification
166
166
  * In order to display it in your side the delegate object should implement [SMManagerInAppMessageDelegate displayInAppMessage:] method it will provide tha app with a SMInAppMessage object
167
167
  * @param delegate an object implementing SMManagerInAppMessageDelegate methods
168
168
  * @see SMManagerInAppMessageDelegate
@@ -0,0 +1,41 @@
1
+ //
2
+ // SMManager+Location.h
3
+ // MobileSDK
4
+ //
5
+ // Created by Samy Ziat on 02/12/15.
6
+ // Copyright © 2015 Selligent. All rights reserved.
7
+ //
8
+
9
+ #import "SMManager.h"
10
+
11
+ /*!
12
+ * In order to use the location services features provided by the sdk you will mandatory need to use the lsdk library supporting the plotproject framework .
13
+ * Otherwise calling the method in this SMManager category will have no effect and no ios api related to geofencing will be called (as this is all done by the plot project framework)
14
+ */
15
+ @interface SMManager (Location)
16
+
17
+ /**
18
+ * Enable geolocation services
19
+ *
20
+ * @discussion This optional call will enable geolocation services at sdk level. it is independent of iOS location authorisation
21
+ * If you use plotproject for geolocation it will be mandatory to call it if you have set enableOnFirstRun to false in the plotconfig.json
22
+ * Call this API according to your application's need.
23
+ */
24
+ - (void) enableGeoLocation;
25
+
26
+ /**
27
+ * Disable geolocation services
28
+ *
29
+ * @discussion This optional call will disable geolocation services at sdk level. it is independent of iOS location authorisation
30
+ * Call this API according to your application's need.
31
+ */
32
+ - (void) disableGeoLocation;
33
+
34
+ /**
35
+ * Check the geolocation services status
36
+ *
37
+ * @discussion This optional call will inform you if geolocation services at sdk level are enabled. it is independent of iOS location authorisation
38
+ */
39
+ - (BOOL) isGeoLocationEnabled;
40
+
41
+ @end
@@ -103,9 +103,9 @@
103
103
  * Mandatory method which allows sdk initialisation when building against iOS 10+ and using Notification Extensions .
104
104
  * To be included in didReceiveNotification: when implementing Notification content extension and/or in didReceiveNotificationRequest:withContentHandler: when implementing Notification service extension
105
105
  *
106
- * @param setting mandatory SMManagerSetting instance to start-up the library - this setting mus tbe initialised with only url, clienID and privateKet provided by selligent
106
+ * @param setting mandatory SMManagerSetting instance to start-up the library - this setting mus tbe initialized with only url, clienID and privateKet provided by selligent
107
107
  * @see SMManagerSetting
108
- * @discussion This method is mandatory in order to start / initialise the library and should be called in in didReceiveNotification: when implementing Notification content extension and/or in didReceiveNotificationRequest:withContentHandler: when implementing Notification service extension
108
+ * @discussion This method is mandatory in order to start / initialize the library and should be called in in didReceiveNotification: when implementing Notification content extension and/or in didReceiveNotificationRequest:withContentHandler: when implementing Notification service extension
109
109
  * @see SMManagerSetting
110
110
  */
111
111
  - (void) startExtensionWithSetting:(SMManagerSetting*_Nonnull)setting;
@@ -46,7 +46,7 @@
46
46
  * @param launchOptions NSDictionary instance indicating the reason the app was launched (if any). This dictionary is provided by application:didFinishLaunchingWithOptions
47
47
  * @param setting mandatory SMManagerSetting instance to start-up the library
48
48
  * @see SMManagerSetting
49
- * @discussion This method is mandatory in order to start / initialise the library and should be called in application:didFinishLaunchingWithOptions:
49
+ * @discussion This method is mandatory in order to start / initialize the library and should be called in application:didFinishLaunchingWithOptions:
50
50
  */
51
51
  - (void) startWithLaunchOptions:(NSDictionary* _Nullable)launchOptions Setting:(SMManagerSetting* _Null_unspecified)setting;
52
52
 
@@ -10,13 +10,13 @@
10
10
  #import "SMInAppMessage.h"
11
11
 
12
12
  /**
13
- * This protocol will help you intercept the inapp messages and allow you to display them your own way or store them somewhere to be shown later.
13
+ * This protocol will help you intercept the in-app messages and allow you to display them your own way or store them somewhere to be shown later.
14
14
  */
15
15
  @protocol SMManagerInAppMessageDelegate <NSObject>
16
16
  @optional
17
17
 
18
18
  /*!
19
- * @abstract Invoked when an inapp message linked to a remote notification is received by sdk.
19
+ * @abstract Invoked when an in-app message linked to a remote notification is received by sdk.
20
20
  * @param inAppMessage The inAppMessage object containing all necessary datas for you to display content of the message
21
21
  */
22
22
  - (void) displayInAppMessage:(SMInAppMessage*_Nonnull)inAppMessage;
@@ -0,0 +1,27 @@
1
+ //
2
+ // SMManagerSetting+Location.h
3
+ // MobileSDK
4
+ //
5
+ // Created by Marc Biosca on 6/28/21.
6
+ // Copyright © 2021 Selligent. All rights reserved.
7
+ //
8
+
9
+ #import "SMManagerSetting.h"
10
+
11
+ /**
12
+ * This category will help you to enable the geolocation service.
13
+ */
14
+ @interface SMManagerSetting (Location)
15
+
16
+ /**
17
+ * Optional API to enable location services.
18
+ *
19
+ * @discussion This call is useless if the sdk version is not the one associated to the plotproject framework
20
+ * However in the case you are using the sdk version associated to plotproject framework, it is the first step to enable Location service.
21
+ * It is the first step to inform the sdk that geo location services are going to be used by the
22
+ *
23
+ * @warning To use location service you will mandatory need to have PlotProject.framework in your app and the correct version of the selligent sdk library
24
+ */
25
+ - (void) configureLocationService;
26
+
27
+ @end
@@ -68,9 +68,9 @@
68
68
  @property (nonatomic) BOOL shouldDisplayRemoteNotification;
69
69
 
70
70
  /**
71
- * Used to add the inapp message associated to a remote notification to the inapp message list
71
+ * Used to add the in-app message associated to a remote notification to the in-app message list
72
72
  *
73
- * @discussion Once a new remote-notification is received, if it contains in the payload datas for an inapp message, this setting will add the inapp message to the in app messages list . You will need to listen to kSMNotification_Event_DidReceiveInAppMessage NSNotification to be informed that an inapp message is available and you can then retrieve it with [SMManager(InAppMessages) getInAppMessages] helper method and use in an inbox for example
73
+ * @discussion Once a new remote-notification is received, if it contains in the payload datas for an in-app message, this setting will add the in-app message to the in app messages list . You will need to listen to kSMNotification_Event_DidReceiveInAppMessage NSNotification to be informed that an in-app message is available and you can then retrieve it with [SMManager(InAppMessages) getInAppMessages] helper method and use in an inbox for example
74
74
  * by default the in app message will be displayed if you wish to display it by yourself you will need to provide a class by calling [SMManager(InAppMessage) inAppMessageDelegate:] . This class will conform to SMManagerInAppMessageDelegate protocol and implement [SMManagerInAppMessageDelegate displayInAppMessage:] method
75
75
  * Default value is set to FALSE
76
76
  */
@@ -1,8 +1,3 @@
1
-
2
-
3
-
4
-
5
-
6
1
  /**
7
2
  * NSString representing a notification name you can listen to.
8
3
  * An NSNotification with this name is broadcasted when the user interacts with a remote-notification
@@ -35,15 +30,15 @@ extern NSString* kSMNotification_Event_DidReceiveRemoteNotification;
35
30
 
36
31
  /**
37
32
  * NSString representing a notification name you can listen to.
38
- * An NSNotification with this name is broadcasted shortly after receiving InApp messages
39
- * Primary-application may use this notification to manage the received InApp messages
33
+ * An NSNotification with this name is broadcasted shortly after receiving in-app messages
34
+ * Primary-application may use this notification to manage the received in-app messages
40
35
  */
41
36
  extern NSString* kSMNotification_Event_DidReceiveInAppMessage;
42
37
 
43
38
  /**
44
39
  * NSString representing a notification name you can listen to.
45
- * An NSNotification with this name is broadcasted shortly after receiving InApp content
46
- * Primary-application may use this notification to manage the received InApp content
40
+ * An NSNotification with this name is broadcasted shortly after receiving in-app content
41
+ * Primary-application may use this notification to manage the received in-app content
47
42
  */
48
43
  extern NSString* kSMNotification_Event_DidReceiveInAppContent;
49
44
 
@@ -61,7 +56,6 @@ extern NSString* kSMNotification_Event_DidReceiveDeviceId;
61
56
  */
62
57
  extern NSString* kSMNotification_Data_ButtonData;
63
58
 
64
-
65
59
  /**
66
60
  * NSString representing a key to retrieve an object inside NSNotification
67
61
  * Use the key kSMNotification_Data_RemoteNotification to retrieve an NSDictionary instance with push ID and name
@@ -16,7 +16,7 @@ typedef NS_ENUM (NSInteger, SMRemoteMessageDisplayType) {
16
16
  kSMRemoteMessageDisplayType_Unknown = 0,
17
17
 
18
18
  /*!
19
- * No Push nor in-app notifications will be displayed.
19
+ * No Push nor in-app messages will be displayed.
20
20
  */
21
21
  kSMRemoteMessageDisplayType_None = 1,
22
22
 
@@ -26,7 +26,7 @@ typedef NS_ENUM (NSInteger, SMRemoteMessageDisplayType) {
26
26
  kSMRemoteMessageDisplayType_Notification = 2,
27
27
 
28
28
  /*!
29
- * An in-app notification will be displayed (when there is an in-app notification available within the remote-notification payload).
29
+ * An in-app message will be displayed (when there is an in-app message available within the remote-notification payload).
30
30
  */
31
31
  kSMRemoteMessageDisplayType_Automatic = 3
32
32
  };
Binary file