Android Tutorial Integrating Firebase Services

Status
Not open for further replies.
Google has acquired a company named Firebase and is now offering many backend services under the Firebase umbrella. Most of them are free.

Integrating the services is relatively simple.

1. Use B4A Sdk Manager tool to install all recommended items.

2. Register with Firebase and create a new project: https://console.firebase.google.com/
Make sure that the package name matches your app's package name.

3. Download google-services.json and put it in the projects folder (folder of the b4a file).

4. Add the manifest snippets to the manifest editor based on the services that you need.

5. Follow the instructions of the specific libraries.

Note that a recent version of Google Play Services should be installed on the device.
The minimum version of most features is 4.0 (API 14).
You can test whether Google Play Services is available with FirebaseAnalytics.IsGooglePlayServicesAvailable or with: https://www.b4x.com/android/forum/threads/check-and-install-google-play-services.84813

Google Play Services Base - Always required when using Google Play Services or Firebase:
Code: Copy
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
Firebase - Always required when using Firebase
Code: Copy
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
Firebase Notifications / Push messages
Code: Copy
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
Firebase Analytics
Code: Copy
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
Firebase Ads
Code: Copy
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
Firebase Auth
Code: Copy
CreateResourceFromFile(Macro, FirebaseAuth.FirebaseAuth)
 
Last edited:
Status
Not open for further replies.
Back
Top