From 0289bfb323e7ceb8e5c2e14f5d22ec01689fe205 Mon Sep 17 00:00:00 2001 From: Sanu gupta Date: Wed, 15 Nov 2023 14:06:09 +0530 Subject: [PATCH] feat-demographic-code (#66) 1. Added the function for demographic 2. Added the getPartner function in TrackierSDK class ref: https://app.asana.com/0/0/1205938329859325/f --- TrackierSDK/gradle.properties | 4 ++-- .../main/java/com/trackier/sdk/Constants.kt | 3 ++- .../java/com/trackier/sdk/ResponseData.kt | 1 + .../main/java/com/trackier/sdk/TrackierSDK.kt | 22 +++++++++++++++++++ .../com/trackier/sdk/TrackierSDKInstance.kt | 4 ++++ .../com/trackier/sdk/TrackierWorkRequest.kt | 4 ++++ .../src/main/java/com/trackier/sdk/Util.kt | 1 + 7 files changed, 36 insertions(+), 3 deletions(-) diff --git a/TrackierSDK/gradle.properties b/TrackierSDK/gradle.properties index ea9a20a..c599b07 100644 --- a/TrackierSDK/gradle.properties +++ b/TrackierSDK/gradle.properties @@ -20,8 +20,8 @@ POM_DEVELOPER_ID=trackier POM_DEVELOPER_NAME=Trackier PUBLISH_DEVELOPER_EMAIL=dev@trackier.com POM_LICENCE_DIST=repo -VERSION_CODE=38 -VERSION_NAME=1.6.47 +VERSION_CODE=39 +VERSION_NAME=1.6.48 GROUP=com.trackier POM_SCM_DEV_CONNECTION=scm\:git@github.com\:trackier/android_sdk.git POM_LICENCE_NAME=The Apache Software License, Version 2.0 diff --git a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Constants.kt b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Constants.kt index 3d1bc23..9d7d460 100644 --- a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Constants.kt +++ b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Constants.kt @@ -2,7 +2,7 @@ package com.trackier.sdk object Constants { - const val SDK_VERSION = "1.6.47" + const val SDK_VERSION = "1.6.48" const val USER_AGENT = "com.cloudstuff.trackiersdk:trackier-android:" + SDK_VERSION const val API_VERSION = "v1" const val BASE_URL = "https://events.trackier.io/" + API_VERSION + "/" @@ -35,6 +35,7 @@ object Constants { const val SHARED_PREF_CLICKID = "clickId" const val SHARED_PREF_DLV = "dlv" const val SHARED_PREF_PID = "pid" + const val SHARED_PREF_PARTNER = "partner" const val SHARED_PREF_ISRETARGETING = "isRetargeting" const val PRE_INSTALL_MANIFEST_KEY = "TR_PRE_INSTALL_PATH" diff --git a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/ResponseData.kt b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/ResponseData.kt index 39df25a..7ac176e 100644 --- a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/ResponseData.kt +++ b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/ResponseData.kt @@ -23,6 +23,7 @@ data class ResponseData( var clickId: String, var dlv: String, var pid: String, + var partner: String, val isRetargeting: Boolean ) { } \ No newline at end of file diff --git a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDK.kt b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDK.kt index ce8e9f5..f6fb892 100644 --- a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDK.kt +++ b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDK.kt @@ -2,6 +2,7 @@ package com.trackier.sdk import android.content.Context import android.net.Uri +import android.util.Log import androidx.annotation.Keep @Keep @@ -184,6 +185,11 @@ object TrackierSDK { return Util.getSharedPrefString(instance.config.context, Constants.SHARED_PREF_PID) } + @JvmStatic + fun getPartner(): String { + return Util.getSharedPrefString(instance.config.context, Constants.SHARED_PREF_PARTNER) + } + @JvmStatic fun getIsRetargeting(): String { return Util.getSharedPrefString(instance.config.context, Constants.SHARED_PREF_ISRETARGETING) @@ -198,4 +204,20 @@ object TrackierSDK { .apply() } + enum class Gender{ + MALE, + Female, + OTHERS + } + + @JvmStatic + fun setGender(gender: Gender) { + instance.gender = gender.toString() + } + + @JvmStatic + fun setDOB(dob: String) { + instance.dob = dob + } + } diff --git a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDKInstance.kt b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDKInstance.kt index 5df1152..4503546 100644 --- a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDKInstance.kt +++ b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDKInstance.kt @@ -32,6 +32,8 @@ class TrackierSDKInstance { var firstInstallTime = "" var organic = false + var gender = "" + var dob = "" var preinstallData: MutableMap? = null @@ -183,6 +185,8 @@ class TrackierSDKInstance { trackierWorkRequest.disableOrganicTrack = disableOrganicTrack trackierWorkRequest.firstInstallTime = firstInstallTime trackierWorkRequest.organic = organic + trackierWorkRequest.gender = gender + trackierWorkRequest.dob = dob trackierWorkRequest.secretId = this.config.getAppSecretId() trackierWorkRequest.secretKey = this.config.getAppSecretKey() trackierWorkRequest.customerName = this.customerName diff --git a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierWorkRequest.kt b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierWorkRequest.kt index ed1602b..00d07e3 100644 --- a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierWorkRequest.kt +++ b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierWorkRequest.kt @@ -32,6 +32,8 @@ class TrackierWorkRequest( var secretId: String = "" var secretKey: String = "" var organic = false + var gender = "" + var dob = "" var preinstallData: MutableMap? = null private fun setDefaults(): MutableMap { @@ -81,6 +83,8 @@ class TrackierWorkRequest( } } body["organic"] = organic + body["gender"] = gender + body["dob"] = dob body["cphone"] = customerPhoneNumber body["cname"] = customerName body["getPreLoadAndPAIdata"] = preinstallData.toString() diff --git a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Util.kt b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Util.kt index 9335bec..383405d 100644 --- a/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Util.kt +++ b/TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/Util.kt @@ -185,6 +185,7 @@ object Util { setSharedPrefString(context, Constants.SHARED_PREF_CLICKID, res.clickId) setSharedPrefString(context, Constants.SHARED_PREF_DLV, res.dlv) setSharedPrefString(context, Constants.SHARED_PREF_PID, res.pid) + setSharedPrefString(context, Constants.SHARED_PREF_PARTNER, res.partner) setSharedPrefString(context, Constants.SHARED_PREF_ISRETARGETING, res.isRetargeting.toString()) }