Skip to content

Commit

Permalink
v1.6.44
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Korney committed Sep 4, 2024
1 parent da8d8a1 commit 7a45bf4
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 49 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [1.6.44] - 2024-09-04

### Fixed

- Fix `Gaid` in `Advertising` module.

## [1.6.43] - 2024-09-03

### Fixed
Expand Down Expand Up @@ -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
Expand Down
74 changes: 39 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -116,25 +116,25 @@ 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'
}
```

### 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
Expand All @@ -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")
}
Expand All @@ -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'
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/affise/app/ui/screen/api/ApiScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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<Pair<String, () -> Unit>> {
Expand Down Expand Up @@ -99,8 +100,9 @@ private fun demoApi(): List<Pair<String, () -> 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()
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion module-advertising/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7a45bf4

Please sign in to comment.