|
|
|
|
@ -4,6 +4,7 @@ package com.cloud.diplomaticquarterapp.geofence.intent_receivers
|
|
|
|
|
|
|
|
|
|
import android.content.Context
|
|
|
|
|
import com.cloud.diplomaticquarterapp.R
|
|
|
|
|
import com.cloud.diplomaticquarterapp.utils.saveLog
|
|
|
|
|
import com.google.android.gms.common.api.ApiException
|
|
|
|
|
import com.google.android.gms.location.GeofenceStatusCodes
|
|
|
|
|
|
|
|
|
|
@ -18,7 +19,7 @@ object GeofenceErrorMessages {
|
|
|
|
|
|
|
|
|
|
fun getErrorString(context: Context, errorCode: Int): String {
|
|
|
|
|
val resources = context.resources
|
|
|
|
|
return when (errorCode) {
|
|
|
|
|
val errorMessage = when (errorCode) {
|
|
|
|
|
GeofenceStatusCodes.GEOFENCE_NOT_AVAILABLE ->
|
|
|
|
|
resources.getString(R.string.geofence_not_available)
|
|
|
|
|
|
|
|
|
|
@ -28,7 +29,17 @@ object GeofenceErrorMessages {
|
|
|
|
|
GeofenceStatusCodes.GEOFENCE_TOO_MANY_PENDING_INTENTS ->
|
|
|
|
|
resources.getString(R.string.geofence_too_many_pending_intents)
|
|
|
|
|
|
|
|
|
|
GeofenceStatusCodes.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION ->
|
|
|
|
|
resources.getString(R.string.GEOFENCE_INSUFFICIENT_LOCATION_PERMISSION)
|
|
|
|
|
|
|
|
|
|
GeofenceStatusCodes.GEOFENCE_REQUEST_TOO_FREQUENT ->
|
|
|
|
|
resources.getString(R.string.GEOFENCE_REQUEST_TOO_FREQUENT)
|
|
|
|
|
|
|
|
|
|
else -> resources.getString(R.string.geofence_unknown_error)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saveLog(context,"GeofenceErrorMessages","$errorCode | $errorMessage")
|
|
|
|
|
|
|
|
|
|
return errorMessage
|
|
|
|
|
}
|
|
|
|
|
}
|