Before invoking the GMS interface, invoke the following method to check whether the GMS is available:
public boolean isGMS(){
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) == com.google.android.gms.common.ConnectionResult.SUCCESS;
}
If true
is returned, the GMS interface can be used properly.
If false
is returned, the GMS interface cannot be used properly. Related processing is required:
As new Huawei phones are banned from using GMS, you app, if with GMS integrated, will be unable to run on new Huawei phones. If you want your app to run on these phones, integrate Huawei Mobile Services (HMS). The integration is quick and easy. You can conveniently convert your code using HMS Core ToolKit.