SENTSDK
The SENTSDK class is the main entry point for interacting with the SDK.
This document refers to deprecated parts of the platform and has been left intact to help customers with legacy integrations. In order to access the latest platform features and documentation, please go to https://docs.sentiance.com.
sharedInstance
Method to call the shared instance of the SDK.
initWithConfig: success: failure:
SDK initialization method. It sets up the modules internally and handles user authentication.
config
The configuration used to authenticate the user.
success
The success block called when init succeeded.
failure
The failure block called when init failed. It takes a SENTInitIssue issue indicating the reason of the failure.
Init should only be called once, unless initialization fails.
start:
Start the SDK.
completion
start should be called only after the SDK has been successfully initialized.
startWithStopDate:
Start the SDK with expiration date.
sdkStopDate
Should be set with date in the future. Dates in past will cause imediate stop of SDK. Setting nil will start SDK as usual.
completion
stop
Stop the SDK.
getUserId
Returns the user ID
getUserAccessToken:
Returns the users Access Token if the user is authenticated
addUserMetadataField: value:
Interface method to set metadata for user. Metadata is any additional data that enclosing app is willing to set for this user/app combination This metadata could contain vital information related to procesing wrt to the enclosing app.
label
Field name for the new entry.
value
Value for the new entry.
addUserMetadataFields:
Interface method to set metadata for user. Metadata is any additional data that enclosing app is willing to set for this user/app combination This metadata could contain vital information related to processing wrt to the enclosing app.
metadata
Key value pair data from enclosing app, could have any structure as long as it can be contained in a dictionary.
removeUserMetadataField:
Method to remove user data field to the sdk metadata (locally as well as on backend).
label
Field name for the new entry.
addTripMetadata:
add metadata pertaining to the ongoing external trip. All added metadata will be aggregated and added to the trip payload. Returns NO if there's no ongoing external trip.
metadata
key value pair data from enclosing app, could have any structure as long as it can be contained in a dictionary. The only time we return NO is when a trip is not ongoing, metadata contains NSNull objects or nil itself.
startTrip: transportModeHint: success: failure:
Start a Trip manually
metadata
Key value pair data from enclosing app, could have any structure as long as it can be contained in a dictionary.
transportModeHint
Suggest of transport mode
stopTrip: failure:
Stop a trip.
setTripTimeOutListener:
Set a trip timeout block.
tripDidTimeOut block will be called each time trip will time out
isVehicleCrashDetectionSupported:
Checks if vehicle crash detection is supported on the device for the specified trip type.
The result depends on multiple criteria, such as if vehicle crash detection is enabled for your app, and if the necessary sensors are present on the device.
tripType
The type of trip for which you want to check
invokeDummyVehicleCrash
Invokes a dummy vehicle crash event. Use this method to test your vehicle crash detection integration.
Calling this method will invoke the handler from setVehicleCrashHandler:
or setCrashListener:
depending on which handler was set last.
This method is intended for testing your integration, and not for production use.
setCrashListener:
Deprecated
setCrashListener:
is deprecated. Use setVehicleCrashHandler:
instead.
Set vehicle crash detection block.
setVehicleCrashHandler:
Sets a handler that is invoked when a vehicle crash is detected with an instance of SENTVehicleCrashEvent
.
setUserActivityListener:
This method provides the enclosing app the ability to get SDK detection updates. So when the SDK is in a trip or a stationary, it informs the app via a callback, providing some extra information.
getUserActivity
This method provides the enclosing app the ability to get SDK current user activity state. It is a trip or stationary with some enriched information.
isTripOngoing:
Interface method to check if trip is in progress or not.
tripType
Type of ongoing trip, SDK - started by SDK, External - started by the application
submitDetections: failure:
Submits all the pending detections to backend, without considering any quota related updates and returns the status of these submissions via a callback to the enclosing app.
success
Success block which is to be called when forced submission completes.
failure
Failure block which is to be called when forced submission completes.
isInitialised
Deprecated
This method is deprecated. Please use -(SENTSDKInitState)getInitState
instead.
Return state of inialization of the SDK: SENTNotInitialized, SENTInitInProgress, SENTInitialized
getInitState
Return state of inialization of the SDK: SENTNotInitialized, SENTInitInProgress, SENTInitialized
getSdkStatus
Get SDK status information
getVersion
Get SDK version
getWifiQuotaLimit
Get SDK WiFi quota limit
getWiFiQuotaUsage
Get SDK WiFi quota usage
getMobileQuotaLimit
Get SDK mobile data quota limit
getMobileQuotaUsage
Get SDK mobile data quota usage
getDiskQuotaLimit
Get SDK disk quota limit
getDiskQuotaUsage
Get SDK disk quota usage
reset: failure:
The reset functionality is intended for removing all data in the device to handle a case such as a user logging out from an app or user requesting data deletion in the local app. It should not be used to reset the internal state of the SDK.
Resets the Sentiance SDK. Calling this method results in stopping of all SDK operations and deleting all SDK user data from the device. Additionally, the SDK will be uninitialized, allowing reinitialization and new Sentiance user creation.
The reset operation may take a while, in which case the SDK's initialization state will be set to InitState SENTResetting until it's complete. Calling any other SDK method during this time will either be ignored or return a default value.
Note that calling this method during intermediate initialization states (i.e. InitState SENTInitInProgress} and InitState SENTResetting will fail.
success
Success block callback when reset successfully done
failure
setTripProfileHandler:
Deprecated
This method was deprecated in v5.12.0, as part of the Trip Profiling feature deprecation.
Sets a block to execute after a trip finishes and is profiled on device. The profiling data is returned with a SENTTripProcessingTripProfile object.
Each SENTTripProcessingTripProfile contains multiple transport segments which each is assigned a SENTTripProcessingVehicleMode. The handler makes sure that only the transport segments that is assigned SENTTripProcessingVehicleModeVehicle are returned.
In order to use this handler, your app configuration must enable the trip profiling feature explicitly. Full trip profiling also needs to be disabled from the SDK. Please see [SENTSDK setFullTripProfilingEnabled:]
for more details.
tripProfileHandler
The block to execute after a trip finishes and is profiled on device.
setFullTripProfilingEnabled:
Deprecated
This method was deprecated in v5.12.0, as part of the Trip Profiling feature deprecation.
Changes the trip profiling mode the SDK is currently using.
Pass YES to let the trips being profiled on the Sentiance platform. If you previously set an on-device trip profiling handler via [SENTSDK setTripProfileHandler:]
, this also disables that handler. When NO is passed later, the handler continues to be called.
Pass NO to enable on-device trip profiling without uploading trip information to the Sentiance platform.
In order to use this method, your app configuration must enable the trip profiling feature explicitly.
enabled
The flag that enables or disables trips being profiled on the Sentiance platform
setSpeedLimit:
Deprecated
This method was deprecated in v5.12.0, as part of the Trip Profiling feature deprecation.
Sets a custom speed limit in m/s that will be used during on-device speeding estimation. Any value that is less than or equal to "0" will be ignored.
If a custom speed limit is not set, the SDK uses a value of 23 m/s as the default speed limit.
In order to use this method, your app configuration must enable the trip profiling feature explicitly.
speedLimit
The speed limit value that will be used during on-device speeding estimation
Last updated