Skip to content

Commit

Permalink
update source
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Kurkin committed May 2, 2023
1 parent f924737 commit 2516f0b
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,15 @@ public class FlutterHmsGmsAvailabilityPlugin : FlutterPlugin, MethodCallHandler
}

private fun isHmsAvailable(): Boolean {
var isAvailable = false
if (null != context) {
val result = HuaweiApiAvailability.getInstance().isHuaweiMobileServicesAvailable(context)
isAvailable = ConnectionResult.SUCCESS == result
}
val result = context?.let { HuaweiApiAvailability.getInstance().isHuaweiMobileServicesAvailable(it) }
val isAvailable = ConnectionResult.SUCCESS == result

return isAvailable
}

private fun isGmsAvailable(): Boolean {
var isAvailable = false

private fun isGmsAvailable(): Boolean {
val result: Int? = context?.let { GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(it) }
isAvailable = com.google.android.gms.common.ConnectionResult.SUCCESS === result
val isAvailable = com.google.android.gms.common.ConnectionResult.SUCCESS === result

return isAvailable
}
Expand Down

0 comments on commit 2516f0b

Please sign in to comment.