GMS is not supported on Huawei phones released after the Google ban.
Here I provide three options for you:
Option 1: Release your app both on HUAWEI AppGallery and Google Play, with different packages. The app you release on AppGallery contains only Huawei's logic code. For details about multi-channel packaging, please refer to docs.
Option 2: Release the same app on HUAWEI AppGallery and Google Play. Add the following code to determine whether GMS APIs or HMS APIs are available and call the available APIs:
public boolean isGMS(){
return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) == com.google.android.gms.common.ConnectionResult.SUCCESS;
}
public boolean isHMS(){
return HuaweiApiAvailability.getInstance().isHuaweiMobileServicesAvailable(this) == com.huawei.hms.api.ConnectionResult.SUCCESS;
}
You can add the code manually, or use HMS ToolKit to realize G+H logic judgment.
Option 3:
if you just want to suppress this dialog complaining "No google services available in this device...." in RN that could be achieved by Turning off Google Play Services availability errors:
firebase.utils().errorOnMissingPlayServices = false;
firebase.utils().promptOnMissingPlayServices = false;
for more information please visit this link.