@sentiance-react-native/core 6.9.1-rc.2 → 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.
package/RNSentianceCore.podspec
CHANGED
|
@@ -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
|
|
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) {
|
package/ios/RNSentianceCore.m
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
#import "RNSentianceSubscriptionsManager.h"
|
|
9
9
|
|
|
10
10
|
#define REJECT_IF_SDK_NOT_INITIALIZED(reject) if ([self isSdkNotInitialized]) { \
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
307
|
-
|
|
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 = @{
|
|
@@ -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.
|
|
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.
|
|
32
|
+
"sentiance": "6.10.0-alpha1"
|
|
33
33
|
},
|
|
34
34
|
"ios": {
|
|
35
|
-
"sentiance": "6.
|
|
35
|
+
"sentiance": "6.10.0-alpha1"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|