Hello everyone! We're continuing working on our pr...
# touchlab-tools
l
Hello everyone! We're continuing working on our project based on KampKit. We've implemented a location tracking service that defines the location and sends data to backend. It works with Android. But on IOS trying to send data to backend causes the following exception. Do you have any idea where I should look for the roots of this exception? I have TrackingKtorApi in coreModule in Koin like this
Copy code
single<TrackingKtorApi> {
    TrackingApi(
        getWith("TrackingApi")
    )
}
It's injected in the GeofencingModel like this
Copy code
private val trackingApi: TrackingKtorApi by inject()
And the place where the exception happens is when from ios app geofencingModel.saveGeofencingData(lat, long) ist called
Copy code
suspend fun saveGeofencingData(latitude: Double,
                               longitude: Double): String? {
    return try {
        val data  = TrackingData(
            lat = latitude,
            long = longitude)

        insertOrReplaceTrackingInDb(data)
        val saved = getAllTrackings()
        if (saved.isNotEmpty()){
            sendGeofencingData(saved)
        }
        null

    } catch (e: Exception) {
        e.printStackTrace()
"Couldn't send tracking data"
    }
}
suspend fun sendGeofencingData(data: List<TrackingData>) {
    try {
        trackingApi.postTrackingData(data, getFleetAccessToken())
        removeAllTrackings()
    } catch (e: Exception) {
        e.printStackTrace()
    }

}