At starting of my app I check if there are the playservices. To complete the job I wrote a code like the following:
private fun checkPlayServices(): Boolean {
val apiAvailability = GoogleApiAvailability.getInstance()
val resultCode = apiAvailability.isGooglePlayServicesAvailable(this)
if (resultCode != ConnectionResult.SUCCESS) {
if (apiAvailability.isUserResolvableError(resultCode)) {
apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST)
.show()
} else {
//show my custom error message
}
return false
}
return true
}
The issue is that the method isUserResolvableError return true also when the error code is SERVICE_INVALID and in this way my custom error message is being never showed .
Why ? I'm doing it in wrong way ?
EDIT: I test it on HarmonyOs OS