@sentiance-react-native/core 6.10.0-alpha.1 → 6.10.0-rc.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.10.0-alpha.1"
8
+ s.version = "6.10.0-rc.1"
9
9
  s.summary = "RNSentianceCore"
10
10
  s.description = <<-DESC
11
11
  RNSentianceCore
@@ -1143,7 +1143,7 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1143
1143
  return [typesSet copy];
1144
1144
  }
1145
1145
 
1146
- - (NSDictionary<NSString *, NSDictionary<NSString *, NSNumber *> *> *)convertDrivingInsights:(SENTDrivingInsights *)drivingInsights {
1146
+ - (NSDictionary<NSString *, NSDictionary<NSString *, id> *> *)convertDrivingInsights:(SENTDrivingInsights *)drivingInsights {
1147
1147
  NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
1148
1148
  NSMutableDictionary *transportEventDict = [[NSMutableDictionary alloc] init];
1149
1149
  NSMutableDictionary *safetyScoresDict = [[NSMutableDictionary alloc] init];
@@ -1180,7 +1180,7 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1180
1180
  return dict;
1181
1181
  }
1182
1182
 
1183
- - (NSArray<NSDictionary<NSString *, NSNumber *> *> *)convertHarshDrivingEvents:(NSArray<SENTHarshDrivingEvent*> *)harshDrivingEvents {
1183
+ - (NSArray<NSDictionary<NSString *, id> *> *)convertHarshDrivingEvents:(NSArray<SENTHarshDrivingEvent*> *)harshDrivingEvents {
1184
1184
  NSMutableArray <NSDictionary<NSString *, NSNumber *> *> *array = [[NSMutableArray alloc] init];
1185
1185
  for (SENTHarshDrivingEvent *event in harshDrivingEvents) {
1186
1186
  [array addObject:[self convertHarshDrivingEvent:event]];
@@ -1188,13 +1188,15 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1188
1188
  return array;
1189
1189
  }
1190
1190
 
1191
- - (NSDictionary<NSString *, NSNumber *> *)convertHarshDrivingEvent:(SENTHarshDrivingEvent *)harshDrivingEvent {
1192
- NSMutableDictionary<NSString *, NSNumber *> *dict = [self convertDrivingEvent:harshDrivingEvent];
1191
+ - (NSDictionary<NSString *, id> *)convertHarshDrivingEvent:(SENTHarshDrivingEvent *)harshDrivingEvent {
1192
+ NSMutableDictionary<NSString *, id> *dict = [self convertDrivingEvent:harshDrivingEvent];
1193
1193
  dict[@"magnitude"] = @(harshDrivingEvent.magnitude);
1194
+ dict[@"confidence"] = @(harshDrivingEvent.confidence);
1195
+ dict[@"type"] = [self stringifyHarshEventType:harshDrivingEvent.type];
1194
1196
  return dict;
1195
1197
  }
1196
1198
 
1197
- - (NSArray<NSDictionary<NSString *, NSNumber *> *> *)convertPhoneUsageEvents:(NSArray<SENTPhoneUsageEvent*> *)phoneUsageEvents {
1199
+ - (NSArray<NSDictionary<NSString *, id> *> *)convertPhoneUsageEvents:(NSArray<SENTPhoneUsageEvent*> *)phoneUsageEvents {
1198
1200
  NSMutableArray <NSDictionary<NSString *, NSNumber *> *> *array = [[NSMutableArray alloc] init];
1199
1201
  for (SENTPhoneUsageEvent *event in phoneUsageEvents) {
1200
1202
  [array addObject:[self convertPhoneUsageEvent:event]];
@@ -1202,11 +1204,11 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1202
1204
  return array;
1203
1205
  }
1204
1206
 
1205
- - (NSDictionary<NSString *, NSNumber *> *)convertPhoneUsageEvent:(SENTPhoneUsageEvent *)phoneUsageEvent {
1207
+ - (NSDictionary<NSString *, id> *)convertPhoneUsageEvent:(SENTPhoneUsageEvent *)phoneUsageEvent {
1206
1208
  return [self convertDrivingEvent:phoneUsageEvent];
1207
1209
  }
1208
1210
 
1209
- - (NSArray<NSDictionary<NSString *, NSNumber *> *> *)convertCallWhileMovingEvents:(NSArray<SENTCallWhileMovingEvent*> *)callWhileMovingEvents {
1211
+ - (NSArray<NSDictionary<NSString *, id> *> *)convertCallWhileMovingEvents:(NSArray<SENTCallWhileMovingEvent*> *)callWhileMovingEvents {
1210
1212
  NSMutableArray <NSDictionary<NSString *, NSNumber *> *> *array = [[NSMutableArray alloc] init];
1211
1213
  for (SENTCallWhileMovingEvent *event in callWhileMovingEvents) {
1212
1214
  [array addObject:[self convertCallWhileMovingEvent:event]];
@@ -1214,8 +1216,8 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1214
1216
  return array;
1215
1217
  }
1216
1218
 
1217
- - (NSDictionary<NSString *, NSNumber *> *)convertCallWhileMovingEvent:(SENTCallWhileMovingEvent *)callWhileMovingEvent {
1218
- NSMutableDictionary<NSString *, NSNumber *> *dict = [self convertDrivingEvent:callWhileMovingEvent];
1219
+ - (NSDictionary<NSString *, id> *)convertCallWhileMovingEvent:(SENTCallWhileMovingEvent *)callWhileMovingEvent {
1220
+ NSMutableDictionary<NSString *, id> *dict = [self convertDrivingEvent:callWhileMovingEvent];
1219
1221
  if (callWhileMovingEvent.minTraveledSpeedInMps != nil) {
1220
1222
  dict[@"minTravelledSpeedInMps"] = callWhileMovingEvent.minTraveledSpeedInMps;
1221
1223
  }
@@ -1225,7 +1227,7 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1225
1227
  return dict;
1226
1228
  }
1227
1229
 
1228
- - (NSArray<NSDictionary<NSString *, NSNumber *> *> *)convertSpeedingEvents:(NSArray<SENTSpeedingEvent*> *)speedingEvents {
1230
+ - (NSArray<NSDictionary<NSString *, id> *> *)convertSpeedingEvents:(NSArray<SENTSpeedingEvent*> *)speedingEvents {
1229
1231
  NSMutableArray <NSDictionary<NSString *, NSNumber *> *> *array = [[NSMutableArray alloc] init];
1230
1232
  for (SENTSpeedingEvent *event in speedingEvents) {
1231
1233
  [array addObject:[self convertSpeedingEvent:event]];
@@ -1233,13 +1235,13 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1233
1235
  return array;
1234
1236
  }
1235
1237
 
1236
- - (NSDictionary<NSString *, NSNumber *> *)convertSpeedingEvent:(SENTSpeedingEvent *)speedingEvent {
1238
+ - (NSDictionary<NSString *, id> *)convertSpeedingEvent:(SENTSpeedingEvent *)speedingEvent {
1237
1239
  NSMutableDictionary *dict = [self convertDrivingEvent:speedingEvent];
1238
1240
  dict[@"waypoints"] = [self convertWaypointArray:speedingEvent.waypoints];
1239
1241
  return dict;
1240
1242
  }
1241
1243
 
1242
- - (NSMutableDictionary<NSString *, NSNumber *> *)convertDrivingEvent:(SENTDrivingEvent *)drivingEvent {
1244
+ - (NSMutableDictionary<NSString *, id> *)convertDrivingEvent:(SENTDrivingEvent *)drivingEvent {
1243
1245
  NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
1244
1246
  dict[@"startTime"] = [drivingEvent.startDate description];
1245
1247
  dict[@"startTimeEpoch"] = @((long) (drivingEvent.startDate.timeIntervalSince1970 * 1000));
@@ -1347,4 +1349,15 @@ static NSString * const SmartGeofencesErrorDomain = @"com.sentiance.SmartGeofenc
1347
1349
  return dict;
1348
1350
  }
1349
1351
 
1352
+ - (NSString *)stringifyHarshEventType:(HarshDrivingEventType)type {
1353
+ switch (type) {
1354
+ case HarshDrivingEventTypeAcceleration:
1355
+ return @"ACCELERATION";
1356
+ case HarshDrivingEventTypeBraking:
1357
+ return @"BRAKING";
1358
+ case HarshDrivingEventTypeTurn:
1359
+ return @"TURN";
1360
+ }
1361
+ }
1362
+
1350
1363
  @end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentiance-react-native/core",
3
- "version": "6.10.0-alpha.1",
3
+ "version": "6.10.0-rc.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.10.0-alpha1"
32
+ "sentiance": "6.10.0-rc1"
33
33
  },
34
34
  "ios": {
35
- "sentiance": "6.10.0-alpha1"
35
+ "sentiance": "6.10.0-rc1"
36
36
  }
37
37
  }
38
38
  }