From 83dee6fca62ddce8bd71da31e51a671bf11d801d Mon Sep 17 00:00:00 2001 From: Kamo Spertsyan Date: Tue, 23 Jan 2024 17:46:53 +0300 Subject: [PATCH 1/4] Fixed Aegis e2e purchase test (#556) * Fixed Outager purchase integration test. * Fixed Outager purchase integration test. --- .github/workflows/integration_tests.yml | 2 +- .../qonversion/android/sdk/internal/OutagerIntegrationTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 65db8a5a..8c109b26 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -32,4 +32,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: test-results - path: sdk/build/reports/androidTests/connected/index.html \ No newline at end of file + path: sdk/build/reports/androidTests/connected/** \ No newline at end of file diff --git a/sdk/src/androidTest/java/com/qonversion/android/sdk/internal/OutagerIntegrationTest.kt b/sdk/src/androidTest/java/com/qonversion/android/sdk/internal/OutagerIntegrationTest.kt index a867ce78..65a4d799 100644 --- a/sdk/src/androidTest/java/com/qonversion/android/sdk/internal/OutagerIntegrationTest.kt +++ b/sdk/src/androidTest/java/com/qonversion/android/sdk/internal/OutagerIntegrationTest.kt @@ -148,7 +148,7 @@ internal class OutagerIntegrationTest { Date(1680537971000), // plus week, as we don't send duration QEntitlementSource.Unknown, 1, - 2, + 0, null, null, null, From 8edd3606d6334e389a2be8efaa5674732bb14b95 Mon Sep 17 00:00:00 2001 From: Kamo Spertsyan Date: Tue, 30 Jan 2024 11:22:19 +0300 Subject: [PATCH 2/4] Actualizing permissions if they've expired while an app session. (#558) --- .../sdk/internal/QProductCenterManager.kt | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/sdk/src/main/java/com/qonversion/android/sdk/internal/QProductCenterManager.kt b/sdk/src/main/java/com/qonversion/android/sdk/internal/QProductCenterManager.kt index 4e9315f6..0009f57d 100644 --- a/sdk/src/main/java/com/qonversion/android/sdk/internal/QProductCenterManager.kt +++ b/sdk/src/main/java/com/qonversion/android/sdk/internal/QProductCenterManager.kt @@ -856,7 +856,7 @@ internal class QProductCenterManager internal constructor( onSuccess: (permissions: Map) -> Unit, onError: (QonversionError) -> Unit ) { - if (launchError != null || unhandledLogoutAvailable) { + fun actualizePermissions() { retryLaunch( onSuccess = { launchResult -> onSuccess(launchResult.permissions) @@ -869,9 +869,25 @@ internal class QProductCenterManager internal constructor( onSuccess(it) } ?: onError(error) }) - } else { - val permissions = launchResultCache.getActualPermissions() ?: emptyMap() + } + + if (launchError != null || unhandledLogoutAvailable) { + actualizePermissions() + return + } + + val permissions = launchResultCache.getActualPermissions() ?: emptyMap() + + val nowMs = System.currentTimeMillis() + val permissionsAreActual = permissions.none { + val expirationTs = it.value.expirationDate?.time ?: Long.MAX_VALUE + it.value.isActive() && expirationTs < nowMs + } + + if (permissionsAreActual) { onSuccess(permissions) + } else { + actualizePermissions() } } From 68f94c1a93d8959711e12ccd9cdc24fc1c086055 Mon Sep 17 00:00:00 2001 From: Kamo Spertsyan Date: Tue, 30 Jan 2024 11:22:31 +0300 Subject: [PATCH 3/4] Added properties for PushWoosh and AppMetrica integration (#557) * Added properties for PushWoosh and AppMetrica integration * Added properties for PushWoosh and AppMetrica integration * Added properties for PushWoosh and AppMetrica integration * Added properties for PushWoosh and AppMetrica integration --- .../qonversion/android/sdk/dto/properties/QUserPropertyKey.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/src/main/java/com/qonversion/android/sdk/dto/properties/QUserPropertyKey.kt b/sdk/src/main/java/com/qonversion/android/sdk/dto/properties/QUserPropertyKey.kt index d7d907d7..778831ef 100644 --- a/sdk/src/main/java/com/qonversion/android/sdk/dto/properties/QUserPropertyKey.kt +++ b/sdk/src/main/java/com/qonversion/android/sdk/dto/properties/QUserPropertyKey.kt @@ -11,6 +11,10 @@ enum class QUserPropertyKey(val userPropertyCode: String) { FirebaseAppInstanceId("_q_firebase_instance_id"), AppSetId("_q_app_set_id"), AdvertisingId("_q_advertising_id"), // iOS only + AppMetricaDeviceId("_q_appmetrica_device_id"), + AppMetricaUserProfileId("_q_appmetrica_user_profile_id"), + PushWooshHwId("_q_pushwoosh_hwid"), + PushWooshUserId("_q_pushwoosh_user_id"), Custom(""); companion object { From cfbe6867a121851164cdba595f6969574a519c25 Mon Sep 17 00:00:00 2001 From: SpertsyanKM Date: Tue, 30 Jan 2024 08:26:24 +0000 Subject: [PATCH 4/4] [create-pull-request] automated change --- build.gradle | 2 +- fastlane/report.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 9111bbea..e0174107 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask buildscript { ext { release = [ - versionName: "7.0.0", + versionName: "7.1.0", versionCode: 1 ] } diff --git a/fastlane/report.xml b/fastlane/report.xml index 4b1059ca..2ffb37cd 100644 --- a/fastlane/report.xml +++ b/fastlane/report.xml @@ -5,7 +5,7 @@ - +