diff --git a/sample_app/android/app/build.gradle b/sample_app/android/app/build.gradle index 37f2454362..238ebf5654 100644 --- a/sample_app/android/app/build.gradle +++ b/sample_app/android/app/build.gradle @@ -1,67 +1,34 @@ plugins { id "com.android.application" + // START: FlutterFire Configuration + id "com.google.gms.google-services" + // END: FlutterFire Configuration id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. id "dev.flutter.flutter-gradle-plugin" } -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - android { namespace "io.getstream.chat.android.flutter.sample" + compileSdkVersion flutter.compileSdkVersion + ndkVersion "27.0.12077973" - compileSdkVersion 35 - - ndkVersion "26.2.11394342" - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + coreLibraryDesugaringEnabled true } - lintOptions { - disable 'InvalidPackage' - checkReleaseBuilds false + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() } defaultConfig { applicationId "io.getstream.chat.android.flutter.sample" - minSdkVersion 23 - targetSdkVersion 35 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - multiDexEnabled true - } - - compileOptions { - // Flag to enable support for the new language APIs - coreLibraryDesugaringEnabled true - } - - // Added this block: - afterEvaluate { project -> - if (project.hasProperty("kotlin")) { - project.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { - kotlinOptions { - jvmTarget = "1.8" - } - } - } + minSdkVersion Math.max(flutter.minSdkVersion, 23) + targetSdkVersion flutter.targetSdkVersion + versionCode flutter.versionCode + versionName flutter.versionName } signingConfigs { @@ -93,5 +60,5 @@ flutter { } dependencies { - coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2' + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' } diff --git a/sample_app/android/app/google-services.json b/sample_app/android/app/google-services.json index 13b6dba5c5..be5f022fa4 100644 --- a/sample_app/android/app/google-services.json +++ b/sample_app/android/app/google-services.json @@ -48,10 +48,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -84,10 +84,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -120,10 +120,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -172,10 +172,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -216,10 +216,46 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:674907137625:android:c24d9f14da7a9b62d7f348", + "android_client_info": { + "package_name": "io.getstream.chat.android.compose.sample.pntest.debug" + } + }, + "oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBArS4RH7lUn3xbD-jhzWl5hVWZhliRgY0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -268,10 +304,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -304,10 +340,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -340,10 +376,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -376,10 +412,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -420,10 +456,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -472,10 +508,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -516,10 +552,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -552,10 +588,118 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.expotiktokapp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:674907137625:android:ff89101ac2565fd9d7f348", + "android_client_info": { + "package_name": "io.getstream.expotiktokapp" + } + }, + "oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBArS4RH7lUn3xbD-jhzWl5hVWZhliRgY0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.expotiktokapp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:674907137625:android:3f084bd915af3b11d7f348", + "android_client_info": { + "package_name": "io.getstream.feeds.android.sample" + } + }, + "oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBArS4RH7lUn3xbD-jhzWl5hVWZhliRgY0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "io.getstream.expotiktokapp" + } + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:674907137625:android:d563721ebce8e225d7f348", + "android_client_info": { + "package_name": "io.getstream.feeds.flutter.sample" + } + }, + "oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyBArS4RH7lUn3xbD-jhzWl5hVWZhliRgY0" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "674907137625-o5iqvv6dtmljtn069b5djv19ad9a7js0.apps.googleusercontent.com", + "client_type": 3 + }, + { + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] @@ -588,10 +732,10 @@ "client_type": 3 }, { - "client_id": "674907137625-2n5l5f3j8chjrgl0hkendtgvlbdnf42j.apps.googleusercontent.com", + "client_id": "674907137625-2a06km2oshvi7e9m52v95a30u0ek36up.apps.googleusercontent.com", "client_type": 2, "ios_info": { - "bundle_id": "io.getstream.reactnative.SampleApp" + "bundle_id": "io.getstream.expotiktokapp" } } ] diff --git a/sample_app/android/build.gradle b/sample_app/android/build.gradle index 146fdda907..07832a68af 100644 --- a/sample_app/android/build.gradle +++ b/sample_app/android/build.gradle @@ -5,27 +5,27 @@ allprojects { } } -rootProject.buildDir = '../build' +rootProject.layout.buildDirectory = "../build" subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" + project.layout.buildDirectory = rootProject.layout.buildDirectory.dir(project.name) - afterEvaluate { - // check if `android` block is available and namespace isn't set - if(it.hasProperty('android') && it.android.namespace == null){ - def manifest = new XmlSlurper().parse(file(it.android.sourceSets.main.manifest.srcFile)) - def packageName = manifest.@package.text() - android.namespace= packageName - } - if (project.hasProperty('android')) { - project.android { compileSdkVersion 35 } + afterEvaluate { project -> + if (project.hasProperty("android")) { + // Set the namespace for all subprojects if not set + if (android.namespace == null) { + android.namespace = project.group + } + + // Align the compileSdkVersion with Flutter's compileSdkVersion + android.compileSdkVersion = flutter.compileSdkVersion } } } subprojects { - project.evaluationDependsOn(':app') + project.evaluationDependsOn(":app") } tasks.register("clean", Delete) { - delete rootProject.buildDir + delete rootProject.layout.buildDirectory } \ No newline at end of file diff --git a/sample_app/android/gradle/wrapper/gradle-wrapper.properties b/sample_app/android/gradle/wrapper/gradle-wrapper.properties index ed0d5cdc32..13f4a4adc1 100644 --- a/sample_app/android/gradle/wrapper/gradle-wrapper.properties +++ b/sample_app/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip diff --git a/sample_app/android/settings.gradle b/sample_app/android/settings.gradle index bcc097f859..f26ff5edfb 100644 --- a/sample_app/android/settings.gradle +++ b/sample_app/android/settings.gradle @@ -18,8 +18,11 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version '8.3.2' apply false - id "org.jetbrains.kotlin.android" version "1.9.24" apply false + id "com.android.application" version "8.7.0" apply false + // START: FlutterFire Configuration + id "com.google.gms.google-services" version "4.3.10" apply false + // END: FlutterFire Configuration + id "org.jetbrains.kotlin.android" version "2.1.0" apply false } include ":app" \ No newline at end of file diff --git a/sample_app/android/settings_aar.gradle b/sample_app/android/settings_aar.gradle deleted file mode 100644 index e7b4def49c..0000000000 --- a/sample_app/android/settings_aar.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/sample_app/firebase.json b/sample_app/firebase.json new file mode 100644 index 0000000000..78c87a2dd6 --- /dev/null +++ b/sample_app/firebase.json @@ -0,0 +1,40 @@ +{ + "flutter": { + "platforms": { + "android": { + "default": { + "projectId": "stream-chat-internal", + "appId": "1:674907137625:android:f4033353c54985b0d7f348", + "fileOutput": "android/app/google-services.json" + } + }, + "ios": { + "default": { + "projectId": "stream-chat-internal", + "appId": "1:674907137625:ios:cafb9fb076a453c4d7f348", + "uploadDebugSymbols": false, + "fileOutput": "ios/Runner/GoogleService-Info.plist" + } + }, + "macos": { + "default": { + "projectId": "stream-chat-internal", + "appId": "1:674907137625:ios:c719c700198c28b1d7f348", + "uploadDebugSymbols": false, + "fileOutput": "macos/Runner/GoogleService-Info.plist" + } + }, + "dart": { + "lib/firebase_options.dart": { + "projectId": "stream-chat-internal", + "configurations": { + "android": "1:674907137625:android:f4033353c54985b0d7f348", + "ios": "1:674907137625:ios:cafb9fb076a453c4d7f348", + "macos": "1:674907137625:ios:c719c700198c28b1d7f348", + "web": "1:674907137625:web:7a93c02445f2585ad7f348" + } + } + } + } + } +} \ No newline at end of file diff --git a/sample_app/ios/Runner/GoogleService-Info.plist b/sample_app/ios/Runner/GoogleService-Info.plist index 9faee9ff20..a4f491631e 100644 --- a/sample_app/ios/Runner/GoogleService-Info.plist +++ b/sample_app/ios/Runner/GoogleService-Info.plist @@ -7,7 +7,7 @@ REVERSED_CLIENT_ID com.googleusercontent.apps.674907137625-flarfn9cefu4lermgpbc4b8rm8l15ian ANDROID_CLIENT_ID - 674907137625-2scfo9a5cs074dced5vhm712ej6hhtpm.apps.googleusercontent.com + 674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com API_KEY AIzaSyBTAsaKFUPLAJqfsLiz0yPUVzwrgJkOwSE GCM_SENDER_ID diff --git a/sample_app/lib/firebase_options.dart b/sample_app/lib/firebase_options.dart index 46d9b06bab..db57e07f1f 100644 --- a/sample_app/lib/firebase_options.dart +++ b/sample_app/lib/firebase_options.dart @@ -44,19 +44,19 @@ class DefaultFirebaseOptions { } static const FirebaseOptions web = FirebaseOptions( - apiKey: 'AIzaSyA4Obi2paSQ1IZZ88OcMC98DJlpV16DAzE', - appId: '1:674907137625:web:a4b97e5d080ec165d7f348', + apiKey: 'AIzaSyAAz5GWLv7UzWJx0QYNBNk2bowXDju6jMU', + appId: '1:674907137625:web:7a93c02445f2585ad7f348', messagingSenderId: '674907137625', projectId: 'stream-chat-internal', authDomain: 'stream-chat-internal.firebaseapp.com', databaseURL: 'https://stream-chat-internal.firebaseio.com', storageBucket: 'stream-chat-internal.appspot.com', - measurementId: 'G-F2RV4P139L', + measurementId: 'G-L0JLRVLDZL', ); static const FirebaseOptions android = FirebaseOptions( apiKey: 'AIzaSyBArS4RH7lUn3xbD-jhzWl5hVWZhliRgY0', - appId: '1:674907137625:android:e55b74fd5747e39ad7f348', + appId: '1:674907137625:android:f4033353c54985b0d7f348', messagingSenderId: '674907137625', projectId: 'stream-chat-internal', databaseURL: 'https://stream-chat-internal.firebaseio.com', @@ -70,10 +70,8 @@ class DefaultFirebaseOptions { projectId: 'stream-chat-internal', databaseURL: 'https://stream-chat-internal.firebaseio.com', storageBucket: 'stream-chat-internal.appspot.com', - androidClientId: - '674907137625-2scfo9a5cs074dced5vhm712ej6hhtpm.apps.googleusercontent.com', - iosClientId: - '674907137625-flarfn9cefu4lermgpbc4b8rm8l15ian.apps.googleusercontent.com', + androidClientId: '674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com', + iosClientId: '674907137625-flarfn9cefu4lermgpbc4b8rm8l15ian.apps.googleusercontent.com', iosBundleId: 'io.getstream.flutter', ); @@ -84,10 +82,9 @@ class DefaultFirebaseOptions { projectId: 'stream-chat-internal', databaseURL: 'https://stream-chat-internal.firebaseio.com', storageBucket: 'stream-chat-internal.appspot.com', - androidClientId: - '674907137625-2scfo9a5cs074dced5vhm712ej6hhtpm.apps.googleusercontent.com', - iosClientId: - '674907137625-p3msks3snq0h22l7ekpqcf0frr0vt8mg.apps.googleusercontent.com', + androidClientId: '674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com', + iosClientId: '674907137625-p3msks3snq0h22l7ekpqcf0frr0vt8mg.apps.googleusercontent.com', iosBundleId: 'io.getstream.streamChatV1', ); -} + +} \ No newline at end of file diff --git a/sample_app/macos/Runner/GoogleService-Info.plist b/sample_app/macos/Runner/GoogleService-Info.plist index 0d4409dd1c..62c38b48a5 100644 --- a/sample_app/macos/Runner/GoogleService-Info.plist +++ b/sample_app/macos/Runner/GoogleService-Info.plist @@ -7,7 +7,7 @@ REVERSED_CLIENT_ID com.googleusercontent.apps.674907137625-p3msks3snq0h22l7ekpqcf0frr0vt8mg ANDROID_CLIENT_ID - 674907137625-2scfo9a5cs074dced5vhm712ej6hhtpm.apps.googleusercontent.com + 674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com API_KEY AIzaSyBTAsaKFUPLAJqfsLiz0yPUVzwrgJkOwSE GCM_SENDER_ID