diff --git a/libraries/pushproviders/firebase/README.md b/libraries/pushproviders/firebase/README.md index 204ac6dd19..a2a7ad97ed 100644 --- a/libraries/pushproviders/firebase/README.md +++ b/libraries/pushproviders/firebase/README.md @@ -4,4 +4,4 @@ In order to make this module only know about Firebase, the plugin `com.google.gms.google-services` has been disabled from the `app` module. -To be able to change the values in the file `firebase.xml` from this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services//values/values.xml` to import the generated values into the `firebase.xml` files. +To be able to change the values set to `google_app_id` in the file `build.gradle.kts` of this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services//values/values.xml` to import the generated values into the `build.gradle.kts` files. diff --git a/libraries/pushproviders/firebase/build.gradle.kts b/libraries/pushproviders/firebase/build.gradle.kts index d1c9f62ef0..28b58b1faa 100644 --- a/libraries/pushproviders/firebase/build.gradle.kts +++ b/libraries/pushproviders/firebase/build.gradle.kts @@ -13,6 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +@file:Suppress("UnstableApiUsage") + plugins { id("io.element.android-library") alias(libs.plugins.anvil) @@ -22,9 +25,43 @@ android { namespace = "io.element.android.libraries.pushproviders.firebase" buildTypes { - release { + getByName("release") { isMinifyEnabled = true consumerProguardFiles("consumer-proguard-rules.pro") + resValue( + type = "string", + name = "google_app_id", + value = if (isEnterpriseBuild) { + "1:912726360885:android:d273c2077ec3291500427c" + } else { + "1:912726360885:android:d097de99a4c23d2700427c" + } + ) + } + getByName("debug") { + resValue( + type = "string", + name = "google_app_id", + value = if (isEnterpriseBuild) { + "1:912726360885:android:f8de9126a94143d300427c" + } else { + "1:912726360885:android:def0a4e454042e9b00427c" + } + ) + } + register("nightly") { + isMinifyEnabled = true + consumerProguardFiles("consumer-proguard-rules.pro") + matchingFallbacks += listOf("release") + resValue( + type = "string", + name = "google_app_id", + value = if (isEnterpriseBuild) { + "1:912726360885:android:3f7e1fe644d99d5a00427c" + } else { + "1:912726360885:android:e17435e0beb0303000427c" + } + ) } } } diff --git a/libraries/pushproviders/firebase/src/debug/res/values/firebase.xml b/libraries/pushproviders/firebase/src/debug/res/values/firebase.xml deleted file mode 100644 index 540f0e9bbe..0000000000 --- a/libraries/pushproviders/firebase/src/debug/res/values/firebase.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 1:912726360885:android:def0a4e454042e9b00427c - diff --git a/libraries/pushproviders/firebase/src/nightly/res/values/firebase.xml b/libraries/pushproviders/firebase/src/nightly/res/values/firebase.xml deleted file mode 100644 index f793ba93f9..0000000000 --- a/libraries/pushproviders/firebase/src/nightly/res/values/firebase.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 1:912726360885:android:e17435e0beb0303000427c - diff --git a/libraries/pushproviders/firebase/src/release/res/values/firebase.xml b/libraries/pushproviders/firebase/src/release/res/values/firebase.xml deleted file mode 100644 index d563b43d05..0000000000 --- a/libraries/pushproviders/firebase/src/release/res/values/firebase.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 1:912726360885:android:d097de99a4c23d2700427c -