diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0b0d328..55fe8bc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -21,6 +21,7 @@ kotlinx-binary-validator = "0.13.2" dokka = "1.9.10" koinCompose = "1.1.0" revenueCatAndroid="7.5.2" +revenueCatIos="4.39.0" diff --git a/kmprevenuecat-purchases-ui/build.gradle.kts b/kmprevenuecat-purchases-ui/build.gradle.kts index 5ed6682..df90ae8 100644 --- a/kmprevenuecat-purchases-ui/build.gradle.kts +++ b/kmprevenuecat-purchases-ui/build.gradle.kts @@ -30,9 +30,11 @@ kotlin { } pod("RevenueCat"){ + version=libs.versions.revenueCatIos.get() extraOpts += listOf("-compiler-option", "-fmodules") } pod("RevenueCatUI"){ + version=libs.versions.revenueCatIos.get() extraOpts += listOf("-compiler-option", "-fmodules") } } diff --git a/kmprevenuecat-purchases-ui/kmprevenuecat_purchases_ui.podspec b/kmprevenuecat-purchases-ui/kmprevenuecat_purchases_ui.podspec index 524c0de..580bc9a 100644 --- a/kmprevenuecat-purchases-ui/kmprevenuecat_purchases_ui.podspec +++ b/kmprevenuecat-purchases-ui/kmprevenuecat_purchases_ui.podspec @@ -9,8 +9,8 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/KMPRevenueCatPurchasesUI.framework' spec.libraries = 'c++' spec.ios.deployment_target = '15.0' - spec.dependency 'RevenueCat' - spec.dependency 'RevenueCatUI' + spec.dependency 'RevenueCat', '4.39.0' + spec.dependency 'RevenueCatUI', '4.39.0' if !Dir.exist?('build/cocoapods/framework/KMPRevenueCatPurchasesUI.framework') || Dir.empty?('build/cocoapods/framework/KMPRevenueCatPurchasesUI.framework') raise " diff --git a/kmprevenuecat-purchases-ui/src/iosMain/kotlin/com/mmk/kmprevenuecat/purchases/ui/Paywall.kt b/kmprevenuecat-purchases-ui/src/iosMain/kotlin/com/mmk/kmprevenuecat/purchases/ui/Paywall.kt index c1a1315..2a6bdbc 100644 --- a/kmprevenuecat-purchases-ui/src/iosMain/kotlin/com/mmk/kmprevenuecat/purchases/ui/Paywall.kt +++ b/kmprevenuecat-purchases-ui/src/iosMain/kotlin/com/mmk/kmprevenuecat/purchases/ui/Paywall.kt @@ -10,15 +10,22 @@ import platform.UIKit.UIApplication @Composable public actual fun Paywall( shouldDisplayDismissButton: Boolean, - onDismiss: () -> Unit, listener: PaywallListener? + onDismiss: () -> Unit, + listener: PaywallListener? ) { - val rootViewController = UIApplication.sharedApplication.keyWindow?.rootViewController - val controller = RCPaywallViewController(null, shouldDisplayDismissButton) - controller.setDelegate(listener?.asRCPaywallViewControllerDelegate(onDismiss)) - if (controller.isBeingPresented().not()) - rootViewController?.presentViewController(controller, true, completion = { - if (controller.isBeingPresented().not()) onDismiss() - }) + RCPaywallViewController( + offering = null, + displayCloseButton = shouldDisplayDismissButton, + dismissRequestedHandler = null + ).apply { + updateWithDisplayCloseButton(shouldDisplayDismissButton) + setDelegate(listener?.asRCPaywallViewControllerDelegate(onDismiss)) + }.also { + if (it.isBeingPresented().not()) + rootViewController?.presentViewController(it, true, completion = { + if (it.isBeingPresented().not()) onDismiss() + }) + } } \ No newline at end of file diff --git a/kmprevenuecat-purchases/build.gradle.kts b/kmprevenuecat-purchases/build.gradle.kts index 3849131..f7c23e3 100644 --- a/kmprevenuecat-purchases/build.gradle.kts +++ b/kmprevenuecat-purchases/build.gradle.kts @@ -28,6 +28,7 @@ kotlin { isStatic = true } pod("RevenueCat"){ + version=libs.versions.revenueCatIos.get() extraOpts += listOf("-compiler-option", "-fmodules") } } diff --git a/kmprevenuecat-purchases/kmprevenuecat_purchases.podspec b/kmprevenuecat-purchases/kmprevenuecat_purchases.podspec index 83eeef3..a9bf361 100644 --- a/kmprevenuecat-purchases/kmprevenuecat_purchases.podspec +++ b/kmprevenuecat-purchases/kmprevenuecat_purchases.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.vendored_frameworks = 'build/cocoapods/framework/KMPRevenueCatPurchases.framework' spec.libraries = 'c++' spec.ios.deployment_target = '15.0' - spec.dependency 'RevenueCat' + spec.dependency 'RevenueCat', '4.39.0' if !Dir.exist?('build/cocoapods/framework/KMPRevenueCatPurchases.framework') || Dir.empty?('build/cocoapods/framework/KMPRevenueCatPurchases.framework') raise " diff --git a/sampleApp/iosApp/iosApp.xcodeproj/project.pbxproj b/sampleApp/iosApp/iosApp.xcodeproj/project.pbxproj index 21a24fc..89e68ff 100644 --- a/sampleApp/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/sampleApp/iosApp/iosApp.xcodeproj/project.pbxproj @@ -427,8 +427,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/RevenueCat/purchases-ios"; requirement = { - kind = upToNextMajorVersion; - minimumVersion = 4.36.3; + kind = exactVersion; + version = 4.39.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/sampleApp/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/sampleApp/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ebe324a..a41d71c 100644 --- a/sampleApp/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/sampleApp/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -5,8 +5,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/abseil-cpp-binary.git", "state" : { - "revision" : "bfc0b6f81adc06ce5121eb23f628473638d67c5c", - "version" : "1.2022062300.0" + "revision" : "7ce7be095bc3ed3c98b009532fe2d7698c132614", + "version" : "1.2024011601.0" } }, { @@ -14,8 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/app-check.git", "state" : { - "revision" : "5746b2d35c91c50581590ed97abe4c06b5037274", - "version" : "10.18.0" + "revision" : "3e464dad87dad2d29bb29a97836789bf0f8f67d2", + "version" : "10.18.1" } }, { @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/openid/AppAuth-iOS.git", "state" : { - "revision" : "71cde449f13d453227e687458144bde372d30fc7", - "version" : "1.6.2" + "revision" : "7e2c09cbeb3bb799f26c268dbedb26325ea722a9", + "version" : "1.7.3" } }, { @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/firebase-ios-sdk.git", "state" : { - "revision" : "c60c958e707c50a9cf8bcb7cfd7d51c566d726c5", - "version" : "10.19.1" + "revision" : "fcf5ced6dae2d43fced2581e673cc3b59bdb8ffa", + "version" : "10.23.0" } }, { @@ -41,8 +41,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleAppMeasurement.git", "state" : { - "revision" : "6b332152355c372ace9966d8ee76ed191f97025e", - "version" : "10.17.0" + "revision" : "6ec4ca62b00a665fa09b594fab897753a8c635fa", + "version" : "10.23.0" } }, { @@ -50,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleDataTransport.git", "state" : { - "revision" : "a732a4b47f59e4f725a2ea10f0c77e93a7131117", - "version" : "9.3.0" + "revision" : "a637d318ae7ae246b02d7305121275bc75ed5565", + "version" : "9.4.0" } }, { @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleSignIn-iOS", "state" : { - "revision" : "7932d33686c1dc4d7df7a919aae47361d1cdfda4", - "version" : "7.0.0" + "revision" : "a7965d134c5d3567026c523e0a8a583f73b62b0d", + "version" : "7.1.0" } }, { @@ -68,8 +68,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GoogleUtilities.git", "state" : { - "revision" : "bc27fad73504f3d4af235de451f02ee22586ebd3", - "version" : "7.12.1" + "revision" : "26c898aed8bed13b8a63057ee26500abbbcb8d55", + "version" : "7.13.1" } }, { @@ -77,8 +77,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/grpc-binary.git", "state" : { - "revision" : "a673bc2937fbe886dd1f99c401b01b6d977a9c98", - "version" : "1.49.1" + "revision" : "67043f6389d0e28b38fa02d1c6952afeb04d807f", + "version" : "1.62.1" } }, { @@ -86,8 +86,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/gtm-session-fetcher.git", "state" : { - "revision" : "115f75e43851774934d695449a4836123c3246e1", - "version" : "3.2.0" + "revision" : "9534039303015a84837090d20fa21cae6e5eadb6", + "version" : "3.3.2" } }, { @@ -95,8 +95,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/GTMAppAuth.git", "state" : { - "revision" : "cee3c709307912d040bd1e06ca919875a92339c6", - "version" : "2.0.0" + "revision" : "5d7d66f647400952b1758b230e019b07c0b4b22a", + "version" : "4.1.1" } }, { @@ -113,8 +113,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/leveldb.git", "state" : { - "revision" : "9d108e9112aa1d65ce508facf804674546116d9c", - "version" : "1.22.3" + "revision" : "43aaef65e0c665daadf848761d560e446d350d3d", + "version" : "1.22.4" } }, { @@ -122,8 +122,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/firebase/nanopb.git", "state" : { - "revision" : "819d0a2173aff699fb8c364b6fb906f7cdb1a692", - "version" : "2.30909.0" + "revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1", + "version" : "2.30910.0" } }, { @@ -131,8 +131,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/google/promises.git", "state" : { - "revision" : "e70e889c0196c76d22759eb50d6a0270ca9f1d9e", - "version" : "2.3.1" + "revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac", + "version" : "2.4.0" } }, { @@ -140,8 +140,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/RevenueCat/purchases-ios", "state" : { - "revision" : "c598bfa60672881933d8945584cc327acd6f018a", - "version" : "4.36.3" + "revision" : "12240d045cfad9f281bc21e9f09d0c33ff09b74f", + "version" : "4.39.0" } }, {