1

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

aeroxr1
  • 1,014
  • 1
  • 14
  • 36

2 Answers2

1

The code referred is based on Google’s design, HarmonyOS does not control the outcome of true or false of this check.

Zinna
  • 1,947
  • 2
  • 5
  • 20
0

According to the team, HarmonyOS does not currently support APIs related to GoogleApiAvailability. Please stay tuned on HarmonyOS official websites.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108