Control Sending Data

The Sentiance SDK optimizes under which circumstances data submission occurs, to optimize network and battery usage.

For certain users with specific usage patterns (e.g. someone who rarely connects to Wi-Fi), it could take a long time before detections are finally submitted.

If you want to override the default behavior, you can initiate a forced submission of detections. Ideally, you use this method only after explaining to the user that your app will consume more bandwidth in case the device is not connected to Wi-Fi.

In order to know when it makes sense to do this, you can check the disk, mobile network and WiFi quotas of the SdkStatus and SENTSdkStatus objects.

Sentiance.shared.submitDetections { result, error in 
    guard let result = result else {
        // Error
        print("Error: \(error!.failureReason)")
        return 
    }
    
    // Successfully submitted
}

SubmitDetectionsResult is an empty object at this time. A non-nil result object signifies successful submission.

Last updated