@sentiance-react-native/core 6.9.1-rc.1 → 6.10.0-alpha.1

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.
@@ -5,7 +5,7 @@ sentiance_sdk_env_var_version = ENV["SENTIANCE_RN_IOS_SDK_VERSION"]
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = "RNSentianceCore"
8
- s.version = "6.9.1-rc.1"
8
+ s.version = "6.10.0-alpha.1"
9
9
  s.summary = "RNSentianceCore"
10
10
  s.description = <<-DESC
11
11
  RNSentianceCore
@@ -222,6 +222,10 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
222
222
  if (event.distanceInMeters != nil) {
223
223
  dict[@"distance"] = event.distanceInMeters;
224
224
  }
225
+
226
+ if (event.tags != nil) {
227
+ dict[@"transportTags"] = event.tags;
228
+ }
225
229
  }
226
230
 
227
231
  - (NSDictionary*)convertWaypoint:(SENTWaypoint*)waypoint {
@@ -1144,9 +1148,7 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1144
1148
  NSMutableDictionary *transportEventDict = [[NSMutableDictionary alloc] init];
1145
1149
  NSMutableDictionary *safetyScoresDict = [[NSMutableDictionary alloc] init];
1146
1150
 
1147
- [self _addBaseEventFields:transportEventDict event:drivingInsights.transportEvent];
1148
- [self addTransportEventInfoToDict:transportEventDict event:drivingInsights.transportEvent];
1149
- dict[@"transportEvent"] = transportEventDict;
1151
+ dict[@"transportEvent"] = [self convertEvent:drivingInsights.transportEvent];
1150
1152
 
1151
1153
  NSNumber* smoothScore = drivingInsights.safetyScores.smoothScore;
1152
1154
  if (smoothScore != nil) {
@@ -8,9 +8,9 @@
8
8
  #import "RNSentianceSubscriptionsManager.h"
9
9
 
10
10
  #define REJECT_IF_SDK_NOT_INITIALIZED(reject) if ([self isSdkNotInitialized]) { \
11
- reject(ESDKNotInitialized, @"Sdk not initialized", nil); \
12
- return; \
13
- }
11
+ reject(ESDKNotInitialized, @"Sdk not initialized", nil); \
12
+ return; \
13
+ }
14
14
 
15
15
  @interface RNSentianceCore()
16
16
 
@@ -135,11 +135,11 @@ RCT_EXPORT_MODULE(SentianceCore)
135
135
  }
136
136
 
137
137
  - (BOOL) initSDKIfUserLinkingCompleted:(NSString *)appId
138
- secret:(NSString *)secret
139
- baseURL:(nullable NSString *)baseURL
140
- shouldStart:(BOOL)shouldStart
141
- resolver:(RCTPromiseResolveBlock)resolve
142
- rejecter:(RCTPromiseRejectBlock)reject
138
+ secret:(NSString *)secret
139
+ baseURL:(nullable NSString *)baseURL
140
+ shouldStart:(BOOL)shouldStart
141
+ resolver:(RCTPromiseResolveBlock)resolve
142
+ rejecter:(RCTPromiseRejectBlock)reject
143
143
  {
144
144
  BOOL isThirdPartyLinked = [self isThirdPartyLinked];
145
145
  if (isThirdPartyLinked) {
@@ -303,8 +303,8 @@ RCT_EXPORT_METHOD(startWithStopDate:(nonnull NSNumber *)stopEpochTimeMs
303
303
  }
304
304
 
305
305
  RCT_EXPORT_METHOD(enableDetectionsWithExpiryDate:(nonnull NSNumber *)expiryEpochTimeMs
306
- resolver:(RCTPromiseResolveBlock)resolve
307
- rejecter:(RCTPromiseRejectBlock)reject)
306
+ resolver:(RCTPromiseResolveBlock)resolve
307
+ rejecter:(RCTPromiseRejectBlock)reject)
308
308
  {
309
309
  REJECT_IF_SDK_NOT_INITIALIZED(reject);
310
310
 
@@ -1198,6 +1198,25 @@ RCT_EXPORT_METHOD(getDetectionMode:(RCTPromiseResolveBlock)resolve rejecter:(RCT
1198
1198
  }
1199
1199
  }
1200
1200
 
1201
+ RCT_EXPORT_METHOD(setTransportTags:(NSDictionary *)tags
1202
+ resolver:(RCTPromiseResolveBlock)resolve
1203
+ rejecter:(RCTPromiseRejectBlock)reject) {
1204
+ REJECT_IF_SDK_NOT_INITIALIZED(reject);
1205
+ NSError *error = nil;
1206
+
1207
+ [[Sentiance sharedInstance] setTransportTags:tags error:&error];
1208
+
1209
+ if (error != nil) {
1210
+ if ([error.domain isEqualToString:@"SENTTransportTaggingDomain"]) {
1211
+ reject(ESDKTransportTaggingError, error.localizedDescription, nil);
1212
+ } else {
1213
+ reject(@"E_SDK_SET_TRANSPORT_TAGS", @"Unexpected error while attempting to set transport tags", error);
1214
+ }
1215
+ } else {
1216
+ resolve(nil);
1217
+ }
1218
+ }
1219
+
1201
1220
  - (void)didUpdateUserContext:(SENTUserContext *)userContext
1202
1221
  forCriteriaMask:(SENTUserContextUpdateCriteria)criteriaMask {
1203
1222
  NSDictionary *dict = @{
@@ -19,3 +19,4 @@ extern NSString * const ESDKCreateUserError;
19
19
  extern NSString * const ESDKResetError;
20
20
  extern NSString * const ESDKRequestUserContextError;
21
21
  extern NSString * const ESDKSmartGeofencesRefreshError;
22
+ extern NSString * const ESDKTransportTaggingError;
@@ -21,3 +21,4 @@ NSString * const ESDKCreateUserError = @"E_SDK_CREATE_USER_ERROR";
21
21
  NSString * const ESDKResetError = @"E_SDK_RESET_ERROR";
22
22
  NSString * const ESDKRequestUserContextError = @"E_SDK_REQUEST_USER_CONTEXT_ERROR";
23
23
  NSString * const ESDKSmartGeofencesRefreshError = @"E_SDK_SMART_GEOFENCES_REFRESH_ERROR";
24
+ NSString * const ESDKTransportTaggingError = @"E_TRANSPORT_TAG_ERROR";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentiance-react-native/core",
3
- "version": "6.9.1-rc.1",
3
+ "version": "6.10.0-alpha.1",
4
4
  "description": "The Sentiance Core library",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -29,10 +29,10 @@
29
29
  "targetSdk": 34,
30
30
  "compileSdk": 34,
31
31
  "buildTools": "34.0.0",
32
- "sentiance": "6.9.1-rc1"
32
+ "sentiance": "6.10.0-alpha1"
33
33
  },
34
34
  "ios": {
35
- "sentiance": "6.9.1-rc1"
35
+ "sentiance": "6.10.0-alpha1"
36
36
  }
37
37
  }
38
38
  }