Skip to content

Commit

Permalink
feat-demographic-code (#66)
Browse files Browse the repository at this point in the history
1. Added the function for demographic
2. Added the getPartner function in TrackierSDK class

ref: https://app.asana.com/0/0/1205938329859325/f
  • Loading branch information
IloveJavaa authored Nov 15, 2023
1 parent f2ea408 commit 0289bfb
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TrackierSDK/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ POM_DEVELOPER_ID=trackier
POM_DEVELOPER_NAME=Trackier
PUBLISH_DEVELOPER_EMAIL=[email protected]
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\:[email protected]\:trackier/android_sdk.git
POM_LICENCE_NAME=The Apache Software License, Version 2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "/"
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ data class ResponseData(
var clickId: String,
var dlv: String,
var pid: String,
var partner: String,
val isRetargeting: Boolean
) {
}
22 changes: 22 additions & 0 deletions TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierSDK.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class TrackierSDKInstance {

var firstInstallTime = ""
var organic = false
var gender = ""
var dob = ""

var preinstallData: MutableMap<String, Any>? = null

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class TrackierWorkRequest(
var secretId: String = ""
var secretKey: String = ""
var organic = false
var gender = ""
var dob = ""
var preinstallData: MutableMap<String, Any>? = null

private fun setDefaults(): MutableMap<String, Any> {
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down

0 comments on commit 0289bfb

Please sign in to comment.