From 7a45bf4a363194f4bcab3bb4c00f66fba5389c83 Mon Sep 17 00:00:00 2001 From: Sergey Korney Date: Wed, 4 Sep 2024 20:55:10 +0500 Subject: [PATCH] v1.6.44 --- CHANGELOG.md | 7 ++ README.md | 74 ++++++++++--------- .../com/affise/app/ui/screen/api/ApiScreen.kt | 4 +- build.gradle | 2 +- module-advertising/build.gradle | 2 +- .../advertising/AdvertisingIdManagerImpl.kt | 24 +++--- .../advertising/parameters/OaidProvider.kt | 2 +- 7 files changed, 66 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2253140..d26b163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.6.44] - 2024-09-04 + +### Fixed + +- Fix `Gaid` in `Advertising` module. + ## [1.6.43] - 2024-09-03 ### Fixed @@ -134,6 +140,7 @@ - Improve `AffiseModuleManager` - Update gradle for demo app. +[1.6.44]: https://github.com/affise/sdk-android/compare/v1.6.43...v1.6.44 [1.6.43]: https://github.com/affise/sdk-android/compare/v1.6.42...v1.6.43 [1.6.42]: https://github.com/affise/sdk-android/compare/v1.6.41...v1.6.42 [1.6.41]: https://github.com/affise/sdk-android/compare/v1.6.40...v1.6.41 diff --git a/README.md b/README.md index 4d0c161..e1ed76d 100644 --- a/README.md +++ b/README.md @@ -97,15 +97,15 @@ For kotlin build script build.gradle.kts use: ```kotlin dependencies { // Add Affise library - implementation("com.affise:attribution:1.6.43") + implementation("com.affise:attribution:1.6.44") // Add Affise modules - implementation("com.affise:module-advertising:1.6.43") - implementation("com.affise:module-androidid:1.6.43") - implementation("com.affise:module-link:1.6.43") - implementation("com.affise:module-network:1.6.43") - implementation("com.affise:module-phone:1.6.43") - implementation("com.affise:module-status:1.6.43") - implementation("com.affise:module-subscription:1.6.43") + implementation("com.affise:module-advertising:1.6.44") + implementation("com.affise:module-androidid:1.6.44") + implementation("com.affise:module-link:1.6.44") + implementation("com.affise:module-network:1.6.44") + implementation("com.affise:module-phone:1.6.44") + implementation("com.affise:module-status:1.6.44") + implementation("com.affise:module-subscription:1.6.44") // Add install referrer implementation("com.android.installreferrer:installreferrer:2.2") } @@ -116,15 +116,15 @@ For groovy build script build.gradle use: ```groovy dependencies { // Add Affise library - implementation 'com.affise:attribution:1.6.43' + implementation 'com.affise:attribution:1.6.44' // Add Affise modules - implementation 'com.affise:module-advertising:1.6.43' - implementation 'com.affise:module-androidid:1.6.43' - implementation 'com.affise:module-link:1.6.43' - implementation 'com.affise:module-network:1.6.43' - implementation 'com.affise:module-phone:1.6.43' - implementation 'com.affise:module-status:1.6.43' - implementation 'com.affise:module-subscription:1.6.43' + implementation 'com.affise:module-advertising:1.6.44' + implementation 'com.affise:module-androidid:1.6.44' + implementation 'com.affise:module-link:1.6.44' + implementation 'com.affise:module-network:1.6.44' + implementation 'com.affise:module-phone:1.6.44' + implementation 'com.affise:module-status:1.6.44' + implementation 'com.affise:module-subscription:1.6.44' // Add install referrer implementation 'com.android.installreferrer:installreferrer:2.2' } @@ -132,9 +132,9 @@ dependencies { ### Integrate as file dependency -Download latest Affise SDK (`attribution-1.6.43.aar`) +Download latest Affise SDK (`attribution-1.6.44.aar`) from [releases page](https://github.com/affise/sdk-android/releases) and place this binary to gradle application -module lib directory `app/libs/attribution-1.6.43.aar` +module lib directory `app/libs/attribution-1.6.44.aar` Add library as gradle file dependency to application module build script Add install referrer library @@ -145,15 +145,15 @@ For kotlin build script build.gradle.kts use: dependencies { // ... // Add Affise library - implementation(files("libs/attribution-1.6.43.aar")) + implementation(files("libs/attribution-1.6.44.aar")) // Add Affise modules - implementation(files("libs/module-advertising-1.6.43.aar")) - implementation(files("libs/module-androidid-1.6.43.aar")) - implementation(files("libs/module-link-1.6.43.aar")) - implementation(files("libs/module-network-1.6.43.aar")) - implementation(files("libs/module-phone-1.6.43.aar")) - implementation(files("libs/module-status-1.6.43.aar")) - implementation(files("libs/module-subscription-1.6.43.aar")) + implementation(files("libs/module-advertising-1.6.44.aar")) + implementation(files("libs/module-androidid-1.6.44.aar")) + implementation(files("libs/module-link-1.6.44.aar")) + implementation(files("libs/module-network-1.6.44.aar")) + implementation(files("libs/module-phone-1.6.44.aar")) + implementation(files("libs/module-status-1.6.44.aar")) + implementation(files("libs/module-subscription-1.6.44.aar")) // Add install referrer implementation("com.android.installreferrer:installreferrer:2.2") } @@ -165,15 +165,15 @@ For groovy build script build.gradle use: dependencies { // ... // Add Affise library - implementation files('libs/attribution-1.6.43.aar') + implementation files('libs/attribution-1.6.44.aar') // Add Affise modules - implementation files('libs/module-advertising-1.6.43.aar') - implementation files('libs/module-androidid-1.6.43.aar') - implementation files('libs/module-link-1.6.43.aar') - implementation files('libs/module-network-1.6.43.aar') - implementation files('libs/module-phone-1.6.43.aar') - implementation files('libs/module-status-1.6.43.aar') - implementation files('libs/module-subscription-1.6.43.aar') + implementation files('libs/module-advertising-1.6.44.aar') + implementation files('libs/module-androidid-1.6.44.aar') + implementation files('libs/module-link-1.6.44.aar') + implementation files('libs/module-network-1.6.44.aar') + implementation files('libs/module-phone-1.6.44.aar') + implementation files('libs/module-status-1.6.44.aar') + implementation files('libs/module-subscription-1.6.44.aar') // Add install referrer implementation 'com.android.installreferrer:installreferrer:2.2' } @@ -286,10 +286,14 @@ Affise.Module.getModulesInstalled() > > For module `Advertising` to send GAID (Google Advertising ID) > -> You must setup `com.google.gms:google-services` +> Uses `com.google.android.gms:play-services-ads-identifier` > > 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 +```kotlin +val gaid = Affise.getProviders()[ProviderType.GAID_ADID] as? String +``` + #### Module Link Return last url in chan of redirection diff --git a/app/src/main/java/com/affise/app/ui/screen/api/ApiScreen.kt b/app/src/main/java/com/affise/app/ui/screen/api/ApiScreen.kt index 063b9eb..d88b195 100644 --- a/app/src/main/java/com/affise/app/ui/screen/api/ApiScreen.kt +++ b/app/src/main/java/com/affise/app/ui/screen/api/ApiScreen.kt @@ -21,6 +21,7 @@ import com.affise.app.ui.theme.AffiseAttributionLibTheme import com.affise.app.ui.utils.toNormalCase import com.affise.attribution.Affise import com.affise.attribution.modules.AffiseModules +import com.affise.attribution.parameters.ProviderType import com.affise.attribution.referrer.ReferrerKey private fun demoApi(): List Unit>> { @@ -99,8 +100,9 @@ private fun demoApi(): List Unit>> { output("getRandomDeviceId: $value") }, Pair("getProviders") { + val providerType = ProviderType.GAID_ADID val value = Affise.getProviders() - output("getProviders: $value") + output("getProviders: ${providerType.provider} = ${value[providerType] as? String}") }, Pair("isFirstRun") { val value = Affise.isFirstRun() diff --git a/build.gradle b/build.gradle index 8ebf3e6..6ef2a98 100644 --- a/build.gradle +++ b/build.gradle @@ -55,7 +55,7 @@ tasks.register('clean', Delete) { } ext { - affiseVersion = "1.6.43" + affiseVersion = "1.6.44" compose_compiler_version = "1.4.8" compose_bom = "2024.06.00" diff --git a/module-advertising/build.gradle b/module-advertising/build.gradle index e39b698..ad0666b 100644 --- a/module-advertising/build.gradle +++ b/module-advertising/build.gradle @@ -38,7 +38,7 @@ dependencies { compileOnly files('libs/oaid_sdk_1.0.26.aar') //Gaid - compileOnly 'com.google.android.gms:play-services-ads:21.4.0' + implementation("com.google.android.gms:play-services-ads-identifier:18.1.0") testImplementation "com.google.truth:truth:$testTruth" testImplementation "io.mockk:mockk:$testMockk" diff --git a/module-advertising/src/main/java/com/affise/attribution/module/advertising/advertising/AdvertisingIdManagerImpl.kt b/module-advertising/src/main/java/com/affise/attribution/module/advertising/advertising/AdvertisingIdManagerImpl.kt index 7ba50be..fffb452 100644 --- a/module-advertising/src/main/java/com/affise/attribution/module/advertising/advertising/AdvertisingIdManagerImpl.kt +++ b/module-advertising/src/main/java/com/affise/attribution/module/advertising/advertising/AdvertisingIdManagerImpl.kt @@ -24,14 +24,16 @@ internal class AdvertisingIdManagerImpl( */ private var advertisingId: String? = null private var adPersonalization: Boolean = false + private var advertisingIdInfo: AdvertisingIdClient.Info? = null /** * Init Advertising IdManager */ override fun init(app: Application) = executorProvider.provideExecutorService().execute { try { - //Get Google Advertising ID with context - advertisingId = getGoogleAdvertisingId(app) + advertisingIdInfo = getAdvertisingIdInfo(app) + //Get Google Advertising ID + advertisingId = getGoogleAdvertisingId() adPersonalization = checkGoogleAdPersonalization() } catch (throwable: Throwable) { //Log error @@ -51,16 +53,18 @@ internal class AdvertisingIdManagerImpl( */ override fun getAdPersonalization() = adPersonalization + private fun getAdvertisingIdInfo(context: Context) = try { + AdvertisingIdClient.getAdvertisingIdInfo(context) + } catch (throwable: Throwable) { + null + } + /** - * Get Google Advertising ID with [context] app + * Get Google Advertising ID */ - private fun getGoogleAdvertisingId(context: Context): String? { - return try { - //Get Google Advertising ID - AdvertisingIdClient.getAdvertisingIdInfo(context).id - } catch (throwable: Throwable) { - null - } + private fun getGoogleAdvertisingId(): String? { + //Get Google Advertising ID + return advertisingIdInfo?.id } private fun checkGoogleAdPersonalization(): Boolean { diff --git a/module-advertising/src/main/java/com/affise/attribution/module/advertising/parameters/OaidProvider.kt b/module-advertising/src/main/java/com/affise/attribution/module/advertising/parameters/OaidProvider.kt index 441cf69..421b013 100644 --- a/module-advertising/src/main/java/com/affise/attribution/module/advertising/parameters/OaidProvider.kt +++ b/module-advertising/src/main/java/com/affise/attribution/module/advertising/parameters/OaidProvider.kt @@ -12,7 +12,7 @@ import com.affise.attribution.parameters.ProviderType class OaidProvider( private val oaidManager: OaidManager ) : StringPropertyProvider() { - override val order: Float = 31.5f + override val order: Float = 31.7f override val key: ProviderType = ProviderType.OAID override fun provide(): String? = oaidManager.getOaid()