[TIMOB-27745] Android: Add "google-services.json" support for Firebase
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2020-04-15T18:07:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 9.0.1 |
Components | Android |
Labels | android, build, json |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2020-02-04T04:38:42.000+0000 |
Updated | 2020-04-15T18:07:16.000+0000 |
Description
*Summary:*
Google documents that you should configure your app for Firebase via a "google-services.json" file. Titanium does not currently support this JSON file and requires app developers to call Google's Java APIs to configure the app for Firebase instead.
Add JSON file support will make this much simpler and would follow their docs.
*Note:*
Google documents how to set this up here...
https://firebase.google.com/docs/android/setup
*Recommended Solution:*
The file should be added to the following Titanium project folder...
./platform/android/google-services.json
If the file is found, we need to copy it to the following build folder location...
./build/android/app
We'll need to add the following to the [root.build.gradle](https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/build/root.build.gradle) file.
buildscript {
dependencies {
classpath 'com.google.gms:google-services:4.3.3'
}
}
We'll need to add the following to the [app.build.gradle](https://github.com/appcelerator/titanium_mobile/blob/master/android/templates/build/app.build.gradle) file.
apply plugin: 'com.google.gms.google-services'
PR (master): https://github.com/appcelerator/titanium_mobile/pull/11461
PR (9.0.x): https://github.com/appcelerator/titanium_mobile/pull/11514
FR Passed.
Verified on: Mac OS: 10.15.4 SDK: 9.0.1.v20200415071927, 9.1.0.v20200415075143 Appc CLI: 8.0.0 JDK: 11.0.4 Node: 10.17.0 Studio: 6.0.0.202003181504 Device: Pixel3(v10.0) emulator