Skip to content

Commit

Permalink
feat: sdk setEnabled method
Browse files Browse the repository at this point in the history
  • Loading branch information
Hemant-Mann committed Nov 26, 2021
1 parent bfcbc6d commit c638f68
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 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=17
VERSION_NAME=1.6.14
VERSION_CODE=18
VERSION_NAME=1.6.15
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 @@ -25,8 +25,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 17
versionName "1.6.14"
versionCode 18
versionName "1.6.15"

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.14"
const val SDK_VERSION = "1.6.15"
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ object TrackierSDK {
instance.initialize(config)
}

@JvmStatic
fun isEnabled(): Boolean {
return instance.isEnabled
}

@JvmStatic
fun setEnabled(value: Boolean) {
instance.isEnabled = value
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ class TrackierSDKInstance {
}

private suspend fun trackInstall() {
if (!isEnabled || !configLoaded) {
return
}
if (isInstallTracked()) {
return
}
Expand Down Expand Up @@ -240,6 +243,9 @@ class TrackierSDKInstance {
}

suspend fun trackSession() {
if (!isEnabled || !configLoaded) {
return
}
if (!isInstallTracked()) {
return
}
Expand Down

0 comments on commit c638f68

Please sign in to comment.