Skip to content

Instantly share code, notes, and snippets.

@ankushg
Last active August 3, 2018 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankushg/034c151ac6ed4ed5c89d3065e2899149 to your computer and use it in GitHub Desktop.
Save ankushg/034c151ac6ed4ed5c89d3065e2899149 to your computer and use it in GitHub Desktop.
Fun with TLS 1.2
fun Context.installTls12() {
try {
ProviderInstaller.installIfNeeded(this)
} catch (e: GooglePlayServicesRepairableException) {
// Prompt the user to install/update/enable Google Play services.
GoogleApiAvailability.getInstance()
.showErrorNotification(this, e.connectionStatusCode)
} catch (e: GooglePlayServicesNotAvailableException) {
// Indicates a non-recoverable error: let the user know.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment