From f276378a72562e9e0e6d1c2baa73068dfcd70e24 Mon Sep 17 00:00:00 2001 From: Josh Kasten Date: Mon, 15 Jul 2024 20:56:16 -0400 Subject: [PATCH] Bump firebase-messaging to 24.0.0 firebase-messaging has always included play-services-base but in 24.0.0 they changed this to runtime. This means we needed to start including `play-services-base` in our `build.gradle`, however we are doing so as `compileOnly` so we don't upgrade or downgrade the version in the customer's app. --- .../onesignal/notifications/build.gradle | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/OneSignalSDK/onesignal/notifications/build.gradle b/OneSignalSDK/onesignal/notifications/build.gradle index 8ad12216b..c82f8792f 100644 --- a/OneSignalSDK/onesignal/notifications/build.gradle +++ b/OneSignalSDK/onesignal/notifications/build.gradle @@ -72,14 +72,22 @@ dependencies { compileOnly('com.amazon.device:amazon-appstore-sdk:[3.0.1, 3.0.99]') - // firebase-messaging:21.0.0 introduces FirebaseMessaging.getToken API - // firebase-messaging:23.0.0 incoporates fix for SecurityException: Not allowed to bind to service + // NOTE: firebase-messaging:24.0.0 requires customer's project to use + // compileSdkVersion 34 or higher. api('com.google.firebase:firebase-messaging') { version { - require '[21.0.0, 23.4.99]' - prefer '23.4.0' + require '[23.0.8, 24.0.99]' + prefer '24.0.0' } } + // Needed for GoogleApiAvailability + // Using compileOnly as firebase-messaging already includes this as a + // runtime dependency and we don't want to change what version is used in + // the customer's app. (firebase-messaging:24.0.0 is when this dependency + // changed to runtime) + // NOTE: If you change the firebase-messaging version you may need to + // bump this version if you get a compile error when building the SDK. + compileOnly('com.google.android.gms:play-services-base:18.0.1') // Huawei PushKit // KEEP as "compileOnly", so OneSignal isn't a direct dependency in the POM file.