Firebase Remote Config/Realtime database on Huawei devices
L

4

20

Are all of the Firebase services for Android unable to work on Huawei or is it just the cloud messaging service that does not work? Do all of the firebase services rely on Google Play Services?

Lethalethal answered 12/6, 2020 at 8:42 Comment(3)
All of the Google Play Services are unable to work on Huawei.Deccan
Google Play Services != FirebaseLethalethal
I haven't been able to get Firebase Remote Config to work on Huawei devices in our React Native app... I tried the web SDK route (which works for our Firebase Auth implementation), but the Remote Config library is not supported on Node JS and doesn't work. Sad pandaSalientian
U
30

Firebase SDKs can be divided into three categories:

  1. Play services required — These SDKs require Google Play services, otherwise they have no functionality.

  2. Play services recommended — These SDKs require Google Play services to have full functionality, but they still offer most functionality even without Google Play services.

  3. Play services not required — These SDKS do not require Google Play services to have full functionality.

List of Firebase SDKs that don't require Google Play services

List of Firebase SDKs that you need to include Google Play services

Remote Config SDK com.google.firebase:firebase-config:20.0.0 doesn't require Google Play Services.

Realtime Database SDK com.google.firebase:firebase-database:19.5.1 doesn't require Google Play Services. But keep in mind that Realtime Database depends on Firebase Auth (it needs an authenticated user to work) which depends on Google Play Services. For that you can use Firebase Auth REST API instead of Firebase Auth SDK.

For more info Use Firebase Authentication without Google Play services


Update 27 Oct 2020:

Firebase Auth SDK v20.0.0 com.google.firebase:firebase-auth:20.0.0 doesn't require Google Play Service.

Undercast answered 28/10, 2020 at 9:16 Comment(0)
D
8

Official Dependencies of Firebase Android SDKs on Google Play services

The following Firebase products depend on Firebase Authentication.

  1. Firebase Realtime Database
  2. Cloud Firestore
  3. Cloud Functions
  4. Cloud Storage

You just need to replace Firebase Authentication with Firebase Auth REST SDK. Using this SDK, you don't need to change your existing Firebase Realtime Database code. It will start working on Huawei devices and also GMS devices as well.

Docs: Firebase Auth REST SDK - How to use Firebase Authentication on HMS phones

Downstate answered 29/6, 2020 at 17:30 Comment(3)
That's a very nice answer! How reliable is it though? I mean can we rely on that for example Firebase Realtime Db will always depend on Firebase Auth, without play services dependenciesLethalethal
That's very good question. I have these concerns as well when trying to develop this SDK. From research, I think 1. It was not intentional and they are trying to undo it (https://mcmap.net/q/662457/-using-google-firebase-remote-config-without-google-play-services). 2. Strategically they shouldn't increase dependency to GMS because Huawei Cloud is available on both HMS and GMS devices.Downstate
You can view this SDK as an interim solution to get your existing apps working on Huawei devices quickly. Of course we are ready to support you, if you want to migrate to Huawei Cloud DB. :)Downstate
D
4

Firebase official stance is that all Firebase services require Google Play Services to work. Yes, some Firebase services actually work without GPS currently, however this can change at any time without prior notice.

Doriandoric answered 12/6, 2020 at 11:27 Comment(0)
N
2

Firebase services will not work on the new Huawei Phones. For Huawei devices you can take a look to HMS and App Gallery Connect Services

Remote config: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-remoteconfig-introduction

Cloud DB: https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/clouddb-apply

Push Notifications: https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/push-introduction

To make your app compatible with all devices, you can use the G+H solution: https://forums.developer.huawei.com/forumPortal/en/topicview?tid=0201200435859940059&fid=0101187876626530001

Naples answered 22/6, 2020 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.