diff --git a/CHANGELOG.md b/CHANGELOG.md
index fc9d5f2..ee6aa26 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,417 @@
+Version 3.12.2 (30 Apr 2025)
+==================================
+ * Fix an issue when a forced variant remains active despite being un-forced later
+
+Version 3.12.1 (03 Dec 2024)
+==================================
+ * Fix a rare crash when Apptimize is initialized in background
+
+Version 3.12.0 (10 May 2024)
+==================================
+ * added partnerID property
+
+Version 3.11.0 (05 Sep 2023)
+==================================
+ * Updated visual support for Android 12+
+
+Version 3.10.18 (23 Nov 2022)
+==================================
+ * Fixed mParticle integration (v5.44.2+)
+
+Version 3.10.17 (18 Nov 2022)
+==================================
+ * Improved handling of rare crash in Conscrypt library on versions 8.0 and under
+
+Version 3.10.16 (15 Nov 2022)
+==================================
+ * Stability enhancements
+
+Version 3.10.15 (16 Sep 2022)
+==================================
+ * Performance enhancements
+
+Version 3.10.14 (12 Sep, 2022)
+==================================
+ * Performance enhancements
+
+Version 3.10.13 (22 Jul, 2022)
+==================================
+ * Fix strict mode violation while getting device properties on Android 12
+
+Version 3.10.12 (20 Jul, 2022)
+==================================
+ * Stability enhancements
+
+Version 3.10.11 (02 Jun, 2022)
+==================================
+ * Stability enhancements
+
+Version 3.10.10 (18 May, 2022)
+==================================
+ * Fixed a rare issue when Apptimize could return stale winners info
+
+Version 3.10.9 (05 May, 2022)
+==================================
+ * Deprecated Apptimize.setMixpanelIdentity()
+ * Fixed order of initialization limitations in Mixpanel cohort integration
+
+Version 3.10.8 (28 Mar, 2022)
+==================================
+ * Stability enhancements. Fix a rare ANR in apps using Mixpanel
+
+Version 3.10.7 (23 Mar, 2022)
+==================================
+ * Use current metaData settings at startup, instead of default values
+ * Export participation data to Mixpanel as Lists to avoid truncation
+ * Internal enhancements
+
+Version 3.10.6 (21 Mar, 2022)
+==================================
+ * Stability enhancements
+
+Version 3.10.5 (08 Mar, 2022)
+==================================
+ * Support showing group filters in dashboard Preview
+ * Fix clearing of large result sets after posting them to the backend
+ * Fix mixpanel cohort membership lookup to use URL from metadata
+ * Stability enhancements
+
+Version 3.10.2 (22 Dec, 2021)
+==================================
+ * Fix Android 11 ANR when dns lookup is slow
+
+Version 3.10.1 (07 Dec, 2021)
+==================================
+ * Extended Airship integration. Now Apptimize automatically tracks Airship user id and channel tags updates
+
+Version 3.10.0 (01 Dec, 2021)
+==================================
+ * Fixed an issue when Apptimize returns empty winners dictionary
+ * Added Apptimize.getVersion()
+
+Version 3.9.7 (19 Nov, 2021)
+==================================
+ * Optimize visual experiments
+
+Version 3.9.6 (03 Nov, 2021)
+==================================
+ * Improved multiprocess mode support
+
+Version 3.9.5 (27 Oct, 2021)
+==================================
+ * Add Localytics v6 Support
+
+Version 3.9.4 (12 Oct, 2021)
+==================================
+ * Expose Apptimize.getMetadataSequenceNumber to help troubleshooting
+
+Version 3.9.3 (29 Sep, 2021)
+==================================
+ * Stability enhancements for Android 11 emulators
+
+Version 3.9.2 (22 Sep, 2021)
+==================================
+ * Automatically call MixPanel (if present) with userId changes for cohort tracking
+ * Fixed multiprocess ANR
+
+Version 3.9.0 (21 Sep, 2021)
+==================================
+ * Added ability to reset pilot targeting id by setting a null value
+
+Version 3.9.0 (17 Aug, 2021)
+==================================
+ * Fix crash importing Mixpanel and Localytics events, introduced by AAR changes
+ * Support for Mixpanel cohorts
+ - Add Apptimize.setMixpanelIdentity()
+ - Automatically import the Mixpanel.identify setting
+
+Version 3.8.2 (03 Aug, 2021)
+==================================
+ * Disallow setting a UserID containing only whitespace
+
+Version 3.8.1 (20 Jul, 2021)
+==================================
+ * Apptimize is available as AAR module with its own proguard rules.
+ Jar format is deprecated and will be disabled in future releases.
+ * Fixed an issue when forceVariant and clearVariant might not work properly
+ * Fixed an issue when Apptimize wasn't able to process metadata changes
+
+Version 3.8.0 (13 Jul, 2021)
+==================================
+ * Added Apptimize.getApptimizeOptions(), which returns setup options, updated to
+ reflect actual isDevicePairingEnabled, isVisualChangesEnabled,
+ isThirdPartyEventExportingEnabled, getDeviceName, and getUpdateMetaDataTimeout
+ * Optimize performance for SQLite database access
+
+Version 3.7.26 (12 Jul, 2021)
+==================================
+ * Improve event reporting for multiprocess applications (ApptimizeOptions.setMultiprocessMode)
+ * Improve internal sdk logging
+
+Version 3.7.26 (25 Jun, 2021)
+==================================
+ * Optimize metadata management
+ * Optimize multi-process communications (ApptimizeOptions.setMultiprocessMode)
+
+Version 3.7.25 (11 Jun, 2021)
+==================================
+ * Stability enhancements. Fix a rare ANR race condition
+
+Version 3.7.24 (09 Jun, 2021)
+==================================
+ * Stability enhancements
+
+Version 3.7.23 (13 May, 2021)
+==================================
+ * Stability enhancements for multiprocess support (ApptimizeOptions.setMultiprocessMode)
+
+Version 3.7.22 (11 May, 2021)
+==================================
+ * Fixed issue when some applications were not able to generate a pairing token to connect with dashboard
+
+Version 3.7.21 (06 May, 2021)
+==================================
+ * Stability enhancements
+
+Version 3.7.20 (20 Apr, 2021)
+==================================
+ * Improved multiprocess support (ApptimizeOptions.setMultiprocessMode)
+
+Version 3.7.19 (17 Apr, 2021)
+==================================
+ * Remove support for Android 4.4 and 5.x
+ * Improved metadata processing, and it always runs on a background thread
+ * Stability enhancements
+
+Version 3.7.18 (24 Feb, 2021)
+==================================
+ * Added isOffline and removeAllUserAttributes APIs
+
+Version 3.7.17 (19 Feb, 2021)
+==================================
+ * Improved data consistency if user attributes were updated during metadata update
+ * Optimize metadata processing
+
+Version 3.7.16 (21 Jan, 2021)
+==================================
+ * Updated API documentation and Feature Variables support
+
+Version 3.7.15 (18 Jan, 2021)
+==================================
+ * Stability enhancements
+ * Support setting server region in Segment dashboard
+
+Version 3.7.14 (08 Jan, 2021)
+==================================
+ * Fix some situations when OnApptimizeInitializedListener.onApptimizeInitialized
+ does not get called after Apptimize.setup.
+
+Version 3.7.13 (16 Dec, 2020)
+==================================
+ * Performance optimizations for Apptimize.setup and event uploads
+ * Stability enhancements
+ * Export experiment participation to Mixpanel
+ * Add Apptimize.setLogMonitor to optionally pass all Apptimize log output to a custom logger
+
+Version 3.7.10 (24 Nov, 2020)
+==================================
+ * Stability enhancements
+
+Version 3.7.9 (09 Nov, 2020)
+==================================
+ * Fix all performance logging to use the ApptimizeLog settings
+ * Improve logcat output when when the app needs to call Apptimize.setup first,
+ * Support more server-side sdk configuration via metadata
+ * Stability enhancements
+
+Version 3.7.7 (20 Oct, 2020)
+==================================
+ * Stability enhancements. Fix an ANR when using the unit-testing-only Apptimize.reset() API.
+
+Version 3.7.6 (19 Oct, 2020)
+==================================
+ * Stability enhancements
+ * Change developer mode pairing to use a knock action and pairing token.
+ * See: https://faq.apptimize.com/hc/en-us/articles/360018776634-How-can-I-pair-my-phone-with-the-Apptimize-dashboard
+ * The clipboard check, already disabled for iOS 14+, has been completely removed.
+ * Older SDKs will no longer be able to use the clipboard check to pair starting in January 2021.
+
+Version 3.7.4 (14 Sep, 2020)
+==================================
+ * Stability enhancements
+ * Add support for EU region customers
+
+Version 3.7.1 (21 Jul, 2020)
+==================================
+ * Stability enhancements
+
+Version 3.7.0 (16 Jul, 2020)
+==================================
+ * Add metadata state monitoring functions.
+ See documentation for Apptimize.getMetadataState,
+ Apptimize.addOnMetadataStateChangedListener and
+ Apptimize.removeOnMetadataStateChangedListener.
+
+Version 3.6.11 (14 Jul, 2020)
+==================================
+ * Stability enhancements
+ * Extend analytics opt-in mechanism to data export
+
+Version 3.6.10 (05 Jun, 2020)
+==================================
+ * Fix images failing to download during application first loads on Visual Experiments and Instant Updates
+
+Version 3.6.9 (29 May, 2020)
+==================================
+ * Support Firebase crashlytics
+
+Version 3.6.8 (27 May, 2020)
+==================================
+ * Update Airship integration for Airship v12.0~v13.x
+
+Version 3.6.7 (18 May, 2020)
+==================================
+ * Stability enhancements
+
+Version 3.6.6 (28 Apr, 2020)
+==================================
+ * Remove visual support for Android 4.4
+
+Version 3.6.5 (15 Apr, 2020)
+==================================
+ * Fix possible flashing during removal of a customized visual element
+ * Stability enhancements
+
+Version 3.6.4 (09 Apr, 2020)
+==================================
+ * Improve performance of downloading metadata
+
+Version 3.6.3 (01 Apr, 2020)
+==================================
+ * Expand functional support for Android 10
+
+Version 3.6.2 (24 Mar, 2020)
+==================================
+ * Fix for rare ANRs on Android 5.0 through 7.1
+
+Version 3.6.0 (28 Jan, 2020)
+==================================
+ * Support metadata-driven opt-in mechanism for integration with other analytics frameworks
+
+Version 3.5.4 (27 Jan, 2020)
+==================================
+ * Fix visual experiments for some apks for Android-9 x86 and x86_64 simulators
+
+Version 3.5.3 (20 Jan, 2020)
+==================================
+ * Work-around for an Android 8.x bug, where it can generate a
+ AssertionError for "No NameTypeIndex match for SHORT_DAYLIGHT"
+
+Version 3.5.2 (10 Dec, 2019)
+==================================
+ * Suppresse extra calls to OnTestRunListener - number of calls to OnTestRunListener will now match the number posted in results.
+
+Version 3.5.1 (07 Nov, 2019)
+==================================
+* Remove unnecessary logcat output
+
+Version 3.5.0 (29 Oct, 2019)
+==================================
+* Add integration with Airship SDK to enable coordinated experiments and messaging campaigns
+* Added Apptimize.getInstantUpdateOrWinnerInfo - to fetch instant update and winning experiment infod
+
+Version 3.4.14 (18 Oct, 2019)
+==================================
+* Remove obfuscation of Android.OnApptimizeInitializedListener
+
+Version 1.25.2 (6 Aug, 2019)
+==================================
+*Update to Apptimize 3.4.13
+
+Version 1.25.1 (6 Aug, 2019)
+==================================
+*Update to Apptimize 3.4.9 and trigger latest version update
+
+Version 1.0.24 (6 Aug, 2019)
+==================================
+*Update to Apptimize 3.4.9
+
+Version 1.0.23 (11 June, 2019)
+===================================
+*Update to Apptimize 3.4.0
+
+Version 1.0.22 (09 May, 2019)
+===================================
+*Update to Apptimize 3.3.5
+
+Version 1.0.21 (30 January, 2019)
+===================================
+*Update to Apptimize 3.2.18
+
+Version 1.0.20 (24 January, 2019)
+===================================
+*Update to Apptimize 3.2.17
+
+Version 1.0.19 (13 December, 2018)
+===================================
+*Update to Apptimize 3.2.16
+
+Version 1.0.18 (30 November, 2018)
+===================================
+*Update to Apptimize 3.2.14
+
+Version 1.0.17 (11 September, 2018)
+===================================
+*Update to Apptimize 3.2.7
+
+Version 1.0.16 (06 September, 2018)
+===================================
+*Update to Apptimize 3.2.6
+
+Version 1.0.11 (01 March, 2018)
+===================================
+*Update to Apptimize 3.1.1
+
+Version 1.0.10 (17 July, 2017)
+===================================
+*Update to Apptimize 2.13.0
+
+Version 1.0.9 (07 July, 2017)
+===================================
+*Update to Apptimize 2.12.13
+
+Version 1.0.8 (06 July, 2017)
+===================================
+*Only create participation events for the first time a user participates in an experiment.
+*Update to Apptimize 2.12.12
+
+Version 1.0.7 (14 June, 2017)
+===================================
+*Update to Apptimize 2.12.11
+
+Version 1.0.6 (06 April, 2017)
+===================================
+*Update to Apptimize 2.12.9
+
+Version 1.0.5 (05 April, 2017)
+===================================
+*Update to Apptimize 2.12.8
+
+Version 1.0.4 (08 March, 2017))
+===================================
+*Update to Apptimize 2.12.5
+
+Version 1.0.3 (17th February, 2017))
+===================================
+*Update to Apptimize 2.12.4
+
+Version 1.0.2 (23rd January, 2017))
+===================================
+*Update to Apptimize 2.12.3
+
+Version 1.0.1 (14th June, 2016)
+===================================
+*Change owner to Apptimize
Version 1.0.0 (26th April, 2016)
===================================
diff --git a/RELEASING.md b/RELEASING.md
index a7a75ef..1cf9ec4 100644
--- a/RELEASING.md
+++ b/RELEASING.md
@@ -1,12 +1,42 @@
Releasing
========
- 1. Change the version in `gradle.properties` to a non-SNAPSHOT version.
- 2. Update the `CHANGELOG.md` for the impending release.
- 3. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
- 4. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
- 5. `./gradlew clean uploadArchives`
- 6. Update the `gradle.properties` to the next SNAPSHOT version.
- 7. `git commit -am "Prepare next development version."`
- 8. `git push && git push --tags`
- 9. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact.
+1. Change gradle.properties for VERSION_CODE and VERSION_NAME:
+
+ VERSION_CODE=muupp
+ VERSION_NAME=m.u.p
+
+ where "m" is the major version
+ "u" is the minor version ("uu" is 2 digits with a leading zero when u is 0..9)
+ "p" is the patch level ("pp" is a 2 digits with a leading zero when p is 0..9)
+
+2. Update CHANGELOG.md for the impending release. This has the format:
+
+ Version m.u.p (dd Mmm, yyyy)
+ ==================================
+ ...the change-log.txt entry from android lib/change-log.txt,
+ ...with any internal lines removed.
+
+ For example,
+
+ Version 3.4.14 (18 Oct, 2019)
+ ==================================
+ * Remove obfuscation of Android.OnApptimizeInitializedListener
+
+3. Update build.gradle with the new build number:
+
+ compile 'com.apptimize:apptimize-android:m.u.p@aar'
+
+4. git commit -am "Prepare for release m.u.p."
+
+5. git tag -a m.u.p -m "Version m.u.p"
+
+6. ./gradlew clean uploadArchives
+
+7. Make sure you have a github token to authenticate the push. You use a token
+ instead of your password. You can get a token by logging into github
+ and using the Settings > Developer Settings > Personal Access Tokens menu.
+
+ git push && git push --tags
+
+8. Visit [Sonatype Nexus](https://oss.sonatype.org/) and promote the artifact.
diff --git a/build.gradle b/build.gradle
index a1db5ee..48acc32 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,3 +1,6 @@
+// Please do not change this file
+// This file is autogenerated from build.gradle.template
+
buildscript {
repositories {
mavenCentral()
@@ -14,13 +17,13 @@ apply plugin: 'checkstyle'
apply plugin: 'com.f2prateek.checkstyle'
android {
- compileSdkVersion 23
- buildToolsVersion '23.0.1'
+ compileSdkVersion 22
+ buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 14
- targetSdkVersion 23
- compileSdkVersion 23
+ targetSdkVersion 22
+ compileSdkVersion 22
}
compileOptions {
@@ -41,7 +44,7 @@ dependencies {
provided 'com.segment.analytics.android:analytics:4.0.9'
- compile 'com.apptimize:apptimize-android:2.10.8'
+ compile 'com.apptimize:apptimize-android:3.12.2@aar'
testCompile 'junit:junit:4.12'
testCompile('org.robolectric:robolectric:3.0') {
diff --git a/build.gradle.template b/build.gradle.template
new file mode 100644
index 0000000..1d4564a
--- /dev/null
+++ b/build.gradle.template
@@ -0,0 +1,65 @@
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+
+ dependencies {
+ classpath 'com.android.tools.build:gradle:1.3.1'
+ classpath 'com.f2prateek.checkstyle:checkstyle:1.0.1'
+ }
+}
+
+apply plugin: 'com.android.library'
+apply plugin: 'checkstyle'
+apply plugin: 'com.f2prateek.checkstyle'
+
+android {
+ compileSdkVersion 22
+ buildToolsVersion '23.0.3'
+
+ defaultConfig {
+ minSdkVersion 14
+ targetSdkVersion 22
+ compileSdkVersion 22
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_7
+ targetCompatibility JavaVersion.VERSION_1_7
+ }
+}
+
+checkstyle {
+ configFile rootProject.file('gradle/checkstyle.xml')
+}
+
+dependencies {
+ repositories {
+ mavenCentral()
+ maven { url 'http://maven.apptimize.com/artifactory/repo' }
+ }
+
+ provided 'com.segment.analytics.android:analytics:4.0.9'
+
+ compile 'com.apptimize:apptimize-android:${VERSION}@aar'
+
+ testCompile 'junit:junit:4.12'
+ testCompile('org.robolectric:robolectric:3.0') {
+ exclude group: 'commons-logging', module: 'commons-logging'
+ exclude group: 'org.apache.httpcomponents', module: 'httpclient'
+ }
+
+ testCompile 'com.segment.analytics.android:analytics-tests:4.0.9'
+
+ testCompile 'org.assertj:assertj-core:1.7.1'
+
+ testCompile 'org.mockito:mockito-core:1.10.19'
+
+ testCompile 'org.powermock:powermock:1.6.2'
+ testCompile 'org.powermock:powermock-module-junit4:1.6.2'
+ testCompile 'org.powermock:powermock-module-junit4-rule:1.6.2'
+ testCompile 'org.powermock:powermock-api-mockito:1.6.2'
+ testCompile 'org.powermock:powermock-classloading-xstream:1.6.2'
+}
+
+apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
diff --git a/gradle.properties b/gradle.properties
old mode 100755
new mode 100644
index c7c0fe9..17d2a89
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,22 +1,25 @@
-GROUP=com.segment.analytics.android.integrations
+# Please do not change this file
+# This file is autogenerated from gradle.properties.template
-VERSION_CODE=101
-VERSION_NAME=1.0.1-SNAPSHOT
+GROUP=com.apptimize.segment
-POM_ARTIFACT_ID=apptimize
+VERSION_CODE=31202
+VERSION_NAME=3.12.2
+
+POM_ARTIFACT_ID=apptimize-segment-integration
POM_PACKAGING=aar
-POM_NAME=Apptimize Integration
+POM_NAME=Apptimize Segment Integration
POM_DESCRIPTION=Apptimize Integration for Segment Android Analytics
-POM_URL=http://github.com/segment-integrations/analytics-android-integration-apptimize
-POM_SCM_URL=http://github.com/segment-integrations/analytics-android-integration-apptimize
-POM_SCM_CONNECTION=scm:git:git://github.com/segment-integrations/analytics-android-integration-apptimize.git
-POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/segment-integrations/analytics-android-integration-apptimize.git
+POM_URL=http://github.com/Apptimize/analytics-android-integration-apptimize/
+POM_SCM_URL=https://github.com/Apptimize/analytics-android-integration-apptimize/
+POM_SCM_CONNECTION=scm:git:git://github.com/Apptimize/analytics-android-integration-apptimize.git
+POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Apptimize/analytics-android-integration-apptimize.git
POM_LICENCE_NAME=The MIT License (MIT)
POM_LICENCE_URL=http://opensource.org/licenses/MIT
POM_LICENCE_DIST=repo
-POM_DEVELOPER_ID=segmentio
-POM_DEVELOPER_NAME=Segment, Inc.
+POM_DEVELOPER_ID=apptimize
+POM_DEVELOPER_NAME=Apptimize, Inc.
diff --git a/gradle.properties.template b/gradle.properties.template
new file mode 100755
index 0000000..ea4a15c
--- /dev/null
+++ b/gradle.properties.template
@@ -0,0 +1,22 @@
+GROUP=com.apptimize.segment
+
+VERSION_CODE=${VERSION-CODE}
+VERSION_NAME=${VERSION-NAME}
+
+POM_ARTIFACT_ID=apptimize-segment-integration
+POM_PACKAGING=aar
+
+POM_NAME=Apptimize Segment Integration
+POM_DESCRIPTION=Apptimize Integration for Segment Android Analytics
+
+POM_URL=http://github.com/Apptimize/analytics-android-integration-apptimize/
+POM_SCM_URL=https://github.com/Apptimize/analytics-android-integration-apptimize/
+POM_SCM_CONNECTION=scm:git:git://github.com/Apptimize/analytics-android-integration-apptimize.git
+POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Apptimize/analytics-android-integration-apptimize.git
+
+POM_LICENCE_NAME=The MIT License (MIT)
+POM_LICENCE_URL=http://opensource.org/licenses/MIT
+POM_LICENCE_DIST=repo
+
+POM_DEVELOPER_ID=apptimize
+POM_DEVELOPER_NAME=Apptimize, Inc.
diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index afc6720..3b144e9 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -1 +1 @@
-
+
diff --git a/src/main/java/com/segment/analytics/android/integrations/apptimize/ApptimizeIntegration.java b/src/main/java/com/apptimize/segment/ApptimizeIntegration.java
similarity index 83%
rename from src/main/java/com/segment/analytics/android/integrations/apptimize/ApptimizeIntegration.java
rename to src/main/java/com/apptimize/segment/ApptimizeIntegration.java
index 789e6e1..dda0399 100644
--- a/src/main/java/com/segment/analytics/android/integrations/apptimize/ApptimizeIntegration.java
+++ b/src/main/java/com/apptimize/segment/ApptimizeIntegration.java
@@ -1,7 +1,8 @@
-package com.segment.analytics.android.integrations.apptimize;
+package com.apptimize.segment;
import com.apptimize.Apptimize;
import com.apptimize.Apptimize.OnExperimentRunListener;
+import com.apptimize.ApptimizeOptions;
import com.segment.analytics.Analytics;
import com.segment.analytics.Properties;
import com.segment.analytics.ValueMap;
@@ -25,7 +26,8 @@ public class ApptimizeIntegration extends Integration implements OnExperim
@Override public Integration> create(ValueMap settings, Analytics analytics) {
String appkey = settings.getString("appkey");
boolean listen = settings.getBoolean("listen", false);
- return new ApptimizeIntegration(analytics, appkey, listen, analytics.logger(APPTIMIZE_KEY));
+ boolean eucs = settings.getBoolean("apptimizeEuDataCenter", false);
+ return new ApptimizeIntegration(analytics, appkey, listen, eucs, analytics.logger(APPTIMIZE_KEY));
}
@Override public String key() {
@@ -39,11 +41,15 @@ public class ApptimizeIntegration extends Integration implements OnExperim
final Analytics analytics;
final Logger logger;
- ApptimizeIntegration(Analytics analytics, String appKey, boolean listen, Logger logger)
+ ApptimizeIntegration(Analytics analytics, String appKey, boolean listen, boolean eucs, Logger logger)
throws IllegalStateException {
this.analytics = analytics;
this.logger = logger;
- Apptimize.setup(analytics.getApplication(), appKey);
+ ApptimizeOptions apptimizeOptions = new ApptimizeOptions();
+ if(eucs) {
+ apptimizeOptions.setServerRegion(ApptimizeOptions.ServerRegion.EUCS);
+ }
+ Apptimize.setup(analytics.getApplication(), appKey, apptimizeOptions);
this.logger.verbose("Apptimize.setup(context, %s)", appKey);
if (listen) {
Apptimize.setOnExperimentRunListener(this);
@@ -89,7 +95,11 @@ public class ApptimizeIntegration extends Integration implements OnExperim
@Override
public void onExperimentRun(String experimentName, String variantName, boolean firstRun) {
- analytics.track("Experiment Viewed", new Properties().putValue("experimentName", experimentName)
- .putValue("variationName", variantName));
+ if (firstRun) {
+ analytics.track(
+ "Experiment Viewed",
+ new Properties().putValue("experimentName", experimentName)
+ .putValue("variationName", variantName));
+ }
}
}
diff --git a/src/test/java/com/segment/analytics/android/integrations/apptimize/ApptimizeTest.java b/src/test/java/com/apptimize/segment/ApptimizeTest.java
similarity index 99%
rename from src/test/java/com/segment/analytics/android/integrations/apptimize/ApptimizeTest.java
rename to src/test/java/com/apptimize/segment/ApptimizeTest.java
index 81a912f..b7358e5 100644
--- a/src/test/java/com/segment/analytics/android/integrations/apptimize/ApptimizeTest.java
+++ b/src/test/java/com/apptimize/segment/ApptimizeTest.java
@@ -1,4 +1,4 @@
-package com.segment.analytics.android.integrations.apptimize;
+package com.apptimize.segment;
import android.app.Activity;
import android.app.Application;