Created
April 21, 2020 06:07
-
-
Save zyc945/1953b3fe0270e531367ea2880084d1aa to your computer and use it in GitHub Desktop.
report google play service status.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun reportGooglePlayServiceStatus(context: Context) { | |
when (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)) { | |
ConnectionResult.SUCCESS -> "success" | |
ConnectionResult.SERVICE_MISSING -> "service_missing" | |
ConnectionResult.SERVICE_UPDATING -> "service_updating" | |
ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED -> "service_version_update_required" | |
ConnectionResult.SERVICE_DISABLED -> "service_disabled" | |
ConnectionResult.SERVICE_INVALID -> "service_invalid" | |
else -> "unknown" | |
}.let { result -> | |
logEvent(context, "isGooglePlayServicesAvailable", Bundle().apply { | |
putString("result", result) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment