Skip to content

Commit

Permalink
Feat user detail implementation (#30)
Browse files Browse the repository at this point in the history
* Methods implemented

* version updated

* Update TrackierWorkRequest.kt

* Update TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierWorkRequest.kt

* Update TrackierSDK/sdk-core/src/main/java/com/trackier/sdk/TrackierWorkRequest.kt

* Update TrackierWorkRequest.kt

* Update TrackierWorkRequest.kt

Co-authored-by: Hemant Mann <[email protected]>
  • Loading branch information
prak24oct and Hemant-Mann authored Jun 30, 2021
1 parent 8b4ac47 commit 763703c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MainActivity : AppCompatActivity(){
}
}

requestPermission()
//requestPermission()

}
private fun getUri(): Uri? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ class MainApplication : Application() {
val sdkConfig = TrackierSDKConfig(this, TR_DEV_KEY, "development")
val apkAttributes = AttributionParams("kFyW2bEizc", subSiteID= "sub_partner_tiktok", siteId = "google")
sdkConfig.setAttributionParams(apkAttributes)
sdkConfig.setManualMode(true)
TrackierSDK.setLocalRefTrack(true,"_")
// sdkConfig.setManualMode(true)
// TrackierSDK.setLocalRefTrack(true,"_")
TrackierSDK.setUserId("pppppp")
TrackierSDK.setUserEmail("[email protected]")
val userAdditionalDetails: MutableMap<String,Any> = mutableMapOf()
userAdditionalDetails.put("userMobile",9999000000)
TrackierSDK.setUserAdditionalDetails(userAdditionalDetails)
TrackierSDK.initialize(sdkConfig)
}
}
4 changes: 2 additions & 2 deletions TrackierSDK/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android.enableJetifier=true
POM_DEVELOPER_ID=trackier
POM_DEVELOPER_NAME=Trackier
POM_LICENCE_DIST=repo
VERSION_CODE=6
VERSION_NAME=1.6.3
VERSION_CODE=7
VERSION_NAME=1.6.4
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
4 changes: 2 additions & 2 deletions TrackierSDK/sdk-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.6.0"
versionCode 7
versionName "1.6.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.trackier.sdk

object Constants {
const val SDK_VERSION = "1.6.3"
const val SDK_VERSION = "1.6.4"
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
15 changes: 15 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 @@ -71,4 +71,19 @@ object TrackierSDK {
fun fireInstall() {
instance.fireInstall()
}

@JvmStatic
fun setUserId(userId: String) {
instance.customerId = userId
}

@JvmStatic
fun setUserEmail(userEmail: String) {
instance.customerEmail = userEmail
}

@JvmStatic
fun setUserAdditionalDetails(userAdditionalDetails: MutableMap<String, Any>) {
instance.customerOptionals = userAdditionalDetails
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class TrackierSDKInstance {
var localRefDelimeter = ""
var isManualInstall = false

var customerId = ""
var customerEmail = ""
var customerOptionals: MutableMap<String, Any>? = null

/**
* Initialize method should be called to initialize the sdk
*/
Expand Down Expand Up @@ -120,6 +124,9 @@ class TrackierSDKInstance {
trackierWorkRequest.gaid = gaid
trackierWorkRequest.refDetails = getReferrerDetails()
trackierWorkRequest.installID = installId
trackierWorkRequest.customerId = this.customerId
trackierWorkRequest.customerEmail = this.customerEmail
trackierWorkRequest.customerOptionals = this.customerOptionals
trackierWorkRequest.attributionParams = this.config.getAttributionParams()
trackierWorkRequest.sdtk = this.config.getSDKType()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class TrackierWorkRequest(val kind: String, private val appToken: String, privat
var sessionTime = ""
var sdtk = ""
var attributionParams: AttributionParams? = null
var customerId = ""
var customerEmail = ""
var customerOptionals: MutableMap<String, Any>? = null

private fun setDefaults(): MutableMap<String, Any> {
val body = mutableMapOf<String, Any>()
Expand All @@ -34,6 +37,11 @@ class TrackierWorkRequest(val kind: String, private val appToken: String, privat
body["appKey"] = appToken
body["mode"] = mode
body["sdkt"] = sdtk
body["cuid"] = customerId
body["cmail"] = customerEmail
if (customerOptionals != null) {
body["opts"] = customerOptionals!!
}

val adnAttributes = this.attributionParams?.getData()
if (adnAttributes != null) {
Expand Down

0 comments on commit 763703c

Please sign in to comment.