From db1917b954e8562cbedfdfc34f7c2f80f260b88e Mon Sep 17 00:00:00 2001 From: Karen Tamayo Date: Tue, 4 Oct 2022 10:37:01 -0700 Subject: [PATCH] [MT-1139] Update appsflyer version range (#21) [MT-1139] Update appsflyer version range Co-authored-by: Karen Tamayo --- README.md | 2 +- app/build.gradle | 17 +++++++----- app/src/main/AndroidManifest.xml | 3 ++- .../java/com/tealium/demo/MainActivity.kt | 26 ++++++++++++------- appsflyer/build.gradle | 12 ++++----- .../appsflyer/AppsFlyerRemoteCommand.kt | 2 +- build.gradle | 8 +++--- 7 files changed, 40 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 4b9e998..22d8331 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ For full documentation, please see the Tealium Learning Community: Use of this software is subject to the terms and conditions of the license agreement contained in the file titled "LICENSE.txt". Please read the license before downloading or using any of the files contained in this repository. By downloading or using any of these files, you are agreeing to be bound by and comply with the license agreement. --- -Copyright (C) 2012-2020, Tealium Inc. \ No newline at end of file +Copyright (C) 2012-2022, Tealium Inc. \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 84f916a..01aa049 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,14 +1,13 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 - buildToolsVersion "29.0.3" + compileSdkVersion 33 + buildToolsVersion "30.0.3" defaultConfig { applicationId "com.tealium.demo" minSdkVersion 21 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -19,14 +18,18 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } + + buildFeatures { + viewBinding true + } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "com.tealium:kotlin-remotecommand-dispatcher:1.0.0" - implementation "com.tealium:kotlin-tagmanagement-dispatcher:1.0.0" - implementation "com.tealium:kotlin-lifecycle:1.0.0" + implementation "com.tealium:kotlin-remotecommand-dispatcher:1.1.1" + implementation "com.tealium:kotlin-tagmanagement-dispatcher:1.1.2" + implementation "com.tealium:kotlin-lifecycle:1.1.1" releaseImplementation "com.tealium.remotecommands:appsflyer:$tealium_appsflyer_version" debugImplementation project (path: ':appsflyer') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d2c3488..3e9833f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -16,7 +16,8 @@ android:theme="@style/AppTheme"> + android:label="@string/app_name" + android:exported="true"> diff --git a/app/src/main/java/com/tealium/demo/MainActivity.kt b/app/src/main/java/com/tealium/demo/MainActivity.kt index 1e79b03..1ec929b 100644 --- a/app/src/main/java/com/tealium/demo/MainActivity.kt +++ b/app/src/main/java/com/tealium/demo/MainActivity.kt @@ -2,26 +2,32 @@ package com.tealium.demo import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import kotlinx.android.synthetic.main.activity_main.* +import com.tealium.demo.databinding.ActivityMainBinding +import com.tealium.remotecommands.appsflyer.Host import org.json.JSONArray class MainActivity : AppCompatActivity() { + lateinit var binding: ActivityMainBinding + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) + binding = ActivityMainBinding.inflate(layoutInflater) + val view = binding.root + setContentView(view) TealiumHelper.trackView("main_screen") - TealiumHelper.trackEvent("home_screen", mapOf("af_dev_key" to "Y5WQPfwiANqCdVbZSEvpkX")) + TealiumHelper.trackEvent("home_screen", mapOf("af_dev_key" to "")) + - button_setHost.setOnClickListener { + binding.buttonSetHost.setOnClickListener { TealiumHelper.trackEvent( "set_host", mapOf(Host.HOST to "abc123", Host.HOST_PREFIX to "test_prefix") ) } - button_setUserEmails.setOnClickListener { + binding.buttonSetUserEmails.setOnClickListener { val emails = JSONArray() emails.put("test@tester.com") emails.put("othertest@tester.com") @@ -31,23 +37,23 @@ class MainActivity : AppCompatActivity() { ) } - button_setCurrencyCode.setOnClickListener { + binding.buttonSetCurrencyCode.setOnClickListener { TealiumHelper.trackEvent("set_currency", mapOf("currency_type" to "USD")) } - button_logPurchase.setOnClickListener { + binding.buttonLogPurchase.setOnClickListener { TealiumHelper.trackEvent("purchase") } - button_trackLevelAchieved.setOnClickListener { + binding.buttonTrackLevelAchieved.setOnClickListener { TealiumHelper.trackEvent("level_up", mapOf("current_level" to 3)) } - button_trackLocation.setOnClickListener { + binding.buttonTrackLocation.setOnClickListener { TealiumHelper.trackEvent("track_location", mapOf("latitude" to 0.0, "longitude" to 0.0)) } - button_checkStandardEvents.setOnClickListener { + binding.buttonCheckStandardEvents.setOnClickListener { TealiumHelper.trackEvent("payment", mapOf("payment" to true)) TealiumHelper.trackEvent("cart_add", mapOf()) TealiumHelper.trackEvent("wishlist_add", mapOf()) diff --git a/appsflyer/build.gradle b/appsflyer/build.gradle index 32640a2..7443ef8 100644 --- a/appsflyer/build.gradle +++ b/appsflyer/build.gradle @@ -1,19 +1,19 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' apply plugin: 'maven-publish' android { - compileSdkVersion 29 - buildToolsVersion "29.0.3" + compileSdkVersion 33 + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion 21 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName tealium_appsflyer_version buildConfigField 'String', 'TAG', "\"Tealium-AppsFlyer-$tealium_appsflyer_version\"" + buildConfigField 'String', "TEALIUM_APPSFLYER_VERSION", "\"$tealium_appsflyer_version\"" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' @@ -33,8 +33,8 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.core:core-ktx:1.0.2' - api 'com.tealium:remotecommands:1.0.0' - implementation 'com.appsflyer:af-android-sdk:6.5.3' + api 'com.tealium:remotecommands:1.0.1' + implementation "com.appsflyer:af-android-sdk:$appsflyer_version" implementation 'com.android.installreferrer:installreferrer:1.1.2' testImplementation 'junit:junit:4.12' diff --git a/appsflyer/src/main/java/com/tealium/remotecommands/appsflyer/AppsFlyerRemoteCommand.kt b/appsflyer/src/main/java/com/tealium/remotecommands/appsflyer/AppsFlyerRemoteCommand.kt index e32e33c..ed2c350 100644 --- a/appsflyer/src/main/java/com/tealium/remotecommands/appsflyer/AppsFlyerRemoteCommand.kt +++ b/appsflyer/src/main/java/com/tealium/remotecommands/appsflyer/AppsFlyerRemoteCommand.kt @@ -15,7 +15,7 @@ open class AppsFlyerRemoteCommand( private val appsFlyerDevKey: String? = null, commandId: String = DEFAULT_COMMAND_ID, description: String = DEFAULT_COMMAND_DESCRIPTION -) : RemoteCommand(commandId, description) { +) : RemoteCommand(commandId, description, BuildConfig.TEALIUM_APPSFLYER_VERSION) { private val TAG = this::class.java.simpleName diff --git a/build.gradle b/build.gradle index 388319b..42c493c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.10' + ext.kotlin_version = '1.5.30' ext.mockk_version = '1.9' - ext.tealium_appsflyer_version = '1.2.0' + ext.tealium_appsflyer_version = '1.2.1' + ext.appsflyer_version = "[6.5,7)" repositories { google() - jcenter() mavenCentral() } dependencies { @@ -21,7 +21,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() maven { url "https://maven.tealiumiq.com/android/releases/"