2

I have app that using Firebase Phone Authentication, as I know Huawei app gallery not support Google play services, is there a way to make this platform compatible with Firebase Phone Authentication?

Pavel Poley
  • 5,307
  • 4
  • 35
  • 66

3 Answers3

1
  1. As new Huawei phones are banned from using GMS, if you want your app to run on these phones, integrate Huawei Mobile Services (HMS). If you want to use Auth Service in your app, and also want your app to run on both Huawei phones and Google Android phones, you can integrate both firebase-authentication and Huawei Account Kit, AppGallery Connect Auth Service. Then your app will use AGC Auth Service on Huawei phones, while using Firebase Phone Authentication on Google Android phones.

  2. You can use this IDE plug-in called HMS Core Toolkit to help you analyze where GMS is used in your code. HMS Core Toolkit implements app creation, coding, conversion, debugging, test, and release. The Convertor is a code conversion tool supporting Java and Kotlin projects. This tool can help you quickly convert the existing Android app code for calling third-party APIs into the app code integrated with the HMS Core. HMS Core Toolkit does not support automatic download of the AppGallery Connect configuration file and will be planned in later versions.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • Is there a way to verify that no conflicts will be with users' ID's, generated by HMS and GMS? – Pavel Poley Sep 10 '20 at 08:22
  • The user IDs would be on a whole different server than the ones from Firebase if you choose to use Huawei Auth Service or the Account Kit so there wouldn't be a conflict. I also wrote an answer on how Firebase can still be used. – devEnju Sep 10 '20 at 15:57
0

An alternative to Firebase Phone Authentication would be Phone number sign in via Huawei Auth Service.

https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-auth-service-mobilephone

Hunter
  • 3,080
  • 20
  • 23
0

Depending on the services you are already using with the authentication (e.g. Cloud Firestore or something else) it might not be feasible to implement a new authentication service because you would also have to replace all the other connected services with their dependencies.

Most of the Firebase services do not depend on GMS. Unfortunately, the authentication does but it can also be realized with the REST API from Google. Check out this GitHub repository and the official documentation from Google which Firebase services rely on GMS.

If you are only using the authentication, I would also recommend to implement the Huawei Auth Service with the help of the tools described in one of the other answers because it might be easier than importing the GitHub project and changing the code manually.

devEnju
  • 207
  • 1
  • 9