diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f0857be..2f1385ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 9.3.0 +* Flutter version 3.29 supported. +* Deprecated Android Embedding v1 is no longer supported. +* Sample app gradle versions upgraded. + ## 9.2.1 * Fixed update policy issue for purchase with options. diff --git a/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/AutomationsPlugin.kt b/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/AutomationsPlugin.kt index bd2613c7..02e0892c 100644 --- a/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/AutomationsPlugin.kt +++ b/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/AutomationsPlugin.kt @@ -1,11 +1,8 @@ package com.qonversion.flutter.sdk.qonversion_flutter_sdk import com.google.gson.Gson -import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.plugin.common.BinaryMessenger -import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel -import io.flutter.plugin.common.PluginRegistry import io.qonversion.sandwich.AutomationsEventListener import io.qonversion.sandwich.AutomationsSandwich import io.qonversion.sandwich.BridgeData diff --git a/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/QonversionPlugin.kt b/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/QonversionPlugin.kt index 3035fb78..63616ea9 100644 --- a/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/QonversionPlugin.kt +++ b/android/src/main/kotlin/com/qonversion/flutter/sdk/qonversion_flutter_sdk/QonversionPlugin.kt @@ -11,7 +11,6 @@ import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result -import io.flutter.plugin.common.PluginRegistry.Registrar import io.qonversion.sandwich.ActivityProvider import io.qonversion.sandwich.BridgeData import io.qonversion.sandwich.QonversionEventsListener @@ -49,15 +48,6 @@ class QonversionPlugin : MethodCallHandler, FlutterPlugin, ActivityAware { private const val METHOD_CHANNEL = "qonversion_plugin" private const val EVENT_CHANNEL_PROMO_PURCHASES = "promo_purchases" private const val EVENT_CHANNEL_UPDATED_ENTITLEMENTS = "updated_entitlements" - - // Used for compatibility with the apps, which don't use Android Embedding v2. - @Suppress("DEPRECATION", "unused") - @JvmStatic - fun registerWith(registrar: Registrar) { - val instance = QonversionPlugin() - instance.setup(registrar.messenger(), registrar.context().applicationContext as Application) - instance.activity = registrar.activity() - } } override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 3665ef94..15b9519f 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,10 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" + id "com.google.gms.google-services" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +13,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,11 +23,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" -apply plugin: 'com.google.gms.google-services' - android { compileSdk 34 @@ -67,6 +64,13 @@ android { debuggable true } } + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = '11' + } lint { disable 'InvalidPackage' } @@ -78,7 +82,6 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' diff --git a/example/android/build.gradle b/example/android/build.gradle index 1c4b3235..5869be3d 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,17 +1,3 @@ -buildscript { - ext.kotlin_version = '1.8.22' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.10' - } -} - allprojects { repositories { google() diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 015d8e5a..6c4ab420 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/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-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 5a2f14fb..e2f6b1b4 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,15 +1,26 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.7.3" apply false + id "org.jetbrains.kotlin.android" version "1.9.25" apply false + id "com.google.gms.google-services" version "4.3.14" apply false } + +include ":app" \ No newline at end of file diff --git a/lib/src/internal/qonversion_internal.dart b/lib/src/internal/qonversion_internal.dart index dd2f93fd..0d46ca2a 100644 --- a/lib/src/internal/qonversion_internal.dart +++ b/lib/src/internal/qonversion_internal.dart @@ -11,7 +11,7 @@ import 'package:qonversion_flutter/src/internal/utils/string.dart'; import 'constants.dart'; class QonversionInternal implements Qonversion { - static const String _sdkVersion = "9.2.1"; + static const String _sdkVersion = "9.3.0"; final MethodChannel _channel = MethodChannel('qonversion_plugin'); diff --git a/pubspec.yaml b/pubspec.yaml index c7c6d734..35d4c091 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: qonversion_flutter description: Flutter plugin to implement in-app subscriptions and purchases. Validate user receipts and manage cross-platform access to paid content on your app. Android & iOS. -version: 9.2.1 +version: 9.3.0 homepage: 'https://qonversion.io' repository: 'https://github.com/qonversion/flutter-sdk'