Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.kotlin_version = '2.0.20'
if (!project.hasProperty('version') || project.version.equals('unspecified')) {
if (!project.hasProperty('version') || project.version == 'unspecified') {
project.version = '+'
}

Expand All @@ -11,8 +11,8 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:8.1.4'
classpath 'com.mparticle:android-kit-plugin:' + project.version
classpath "com.android.tools.build:gradle:8.4.2"
classpath "com.mparticle:android-kit-plugin:${project.version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -36,6 +36,7 @@ apply plugin: 'com.mparticle.kit'

android {
namespace 'com.mparticle.kits.apptentive'
compileSdk 35
buildFeatures {
buildConfig = true
}
Expand Down Expand Up @@ -64,6 +65,6 @@ allprojects {
}

dependencies {
api 'com.apptentive:apptentive-kit-android:6.9.1'
api 'com.apptentive:apptentive-kit-android:7.0.0'
testImplementation 'io.mockk:mockk:1.13.3'
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
19 changes: 19 additions & 0 deletions src/main/kotlin/com/mparticle/kits/ApptentiveKit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Application
import android.content.Context
import apptentive.com.android.feedback.Apptentive
import apptentive.com.android.feedback.ApptentiveConfiguration
import apptentive.com.android.feedback.ApptentiveRegion
import apptentive.com.android.feedback.RegisterResult
import apptentive.com.android.util.InternalUseOnly
import apptentive.com.android.util.LogLevel
Expand Down Expand Up @@ -60,6 +61,24 @@ class ApptentiveKit :
RATING_INTERACTION_THROTTLE_LENGTH,
TimeUnit.DAYS.toMillis(7),
)
val attributes = MParticle.getInstance()?.getIntegrationAttributes(MParticle.ServiceProviders.APPTENTIVE)
Logger.debug("Setting Apptentive region from attributes: ${attributes?.get("region") ?: "us"}")
configuration.region =
when (attributes?.get("region") ?: "us") {
"us" -> ApptentiveRegion.US
"eu" -> ApptentiveRegion.EU
"cn" -> ApptentiveRegion.CN
"au" -> ApptentiveRegion.AU
"custom" -> {
val region = attributes?.get("region")
if (region != null) {
ApptentiveRegion.Custom(region)
} else {
ApptentiveRegion.US
}
}
else -> ApptentiveRegion.US
}
Apptentive.register(
context.applicationContext as Application,
configuration,
Expand Down
Loading