diff --git a/app/src/main/java/se/kantarsifo/mobileanalytics/sampleapp/util/Constants.kt b/app/src/main/java/se/kantarsifo/mobileanalytics/sampleapp/util/Constants.kt index e94839b..41c2be9 100644 --- a/app/src/main/java/se/kantarsifo/mobileanalytics/sampleapp/util/Constants.kt +++ b/app/src/main/java/se/kantarsifo/mobileanalytics/sampleapp/util/Constants.kt @@ -1,7 +1,7 @@ package se.kantarsifo.mobileanalytics.sampleapp.util object Constants { - const val CODIGO_CPID = "F53C7A3D-013D-4B89-A1C1-E697DC724467" + const val CODIGO_CPID = "F53C7A3D013D4B89A1C1E697DC724467" const val LOG_TAG = "mobileAnalyticsLog" const val CPID_PREFERENCE = "cpid" const val APP_NAME_PREFERENCE = "app_name" diff --git a/libmobiletagging/src/main/java/se/kantarsifo/mobileanalytics/framework/TSMobileAnalytics.kt b/libmobiletagging/src/main/java/se/kantarsifo/mobileanalytics/framework/TSMobileAnalytics.kt index ddc995d..125979b 100644 --- a/libmobiletagging/src/main/java/se/kantarsifo/mobileanalytics/framework/TSMobileAnalytics.kt +++ b/libmobiletagging/src/main/java/se/kantarsifo/mobileanalytics/framework/TSMobileAnalytics.kt @@ -5,11 +5,8 @@ */ package se.kantarsifo.mobileanalytics.framework -import android.content.Context import android.webkit.WebView import androidx.activity.ComponentActivity -import se.kantarsifo.mobileanalytics.framework.TagStringsAndValues.DOMAIN_CODIGO -import se.kantarsifo.mobileanalytics.framework.Utils.getApplicationVersion /** * Kantar Sifo Mobile Analytics Framework for Android: @@ -73,7 +70,7 @@ open class TSMobileAnalytics protected constructor() { /** * URL for trusted web activity */ - lateinit var twaInfo: TWAModel + protected var twaInfo: TWAModel = TWAModel() /** @@ -95,8 +92,9 @@ open class TSMobileAnalytics protected constructor() { fun sendTag(category: String?): Int { return dataRequestHandler.performMetricsRequest(category) } + fun openTwa() { - dataRequestHandler.openTwa() + dataRequestHandler.openTwa() } @@ -123,7 +121,6 @@ open class TSMobileAnalytics protected constructor() { } - /** * Call to immediately send a tag to the server using the framework's HTTPS-functionality. * @@ -162,7 +159,6 @@ open class TSMobileAnalytics protected constructor() { } - /** * TSMobileAnalytics constructor with Builder class. * @@ -196,7 +192,8 @@ open class TSMobileAnalytics protected constructor() { private set var isWebViewBased = false private set - lateinit var twaInfo :TWAModel + var twaInfo: TWAModel = TWAModel() + private set /** * Specify the cpId you want to set(required). @@ -257,7 +254,7 @@ open class TSMobileAnalytics protected constructor() { * @param twaUrl Set web URL for trusted web activity * @return the current builder object. */ - fun setTWAInfo(twaInfo:TWAModel = TWAModel()) = apply { + fun setTWAInfo(twaInfo: TWAModel = TWAModel()) = apply { this.twaInfo = twaInfo } @@ -306,16 +303,10 @@ open class TSMobileAnalytics protected constructor() { */ @JvmStatic fun createInstance( - activity: ComponentActivity, - cpID: String?, - applicationName: String? + activity: ComponentActivity, cpID: String?, applicationName: String? ): TSMobileAnalytics? { return TSMobileAnalyticsBackend.createInstance( - activity, - cpID, - applicationName, - false, - false + activity, cpID, applicationName, false, false ) } @@ -332,12 +323,7 @@ open class TSMobileAnalytics protected constructor() { twaInfo: TWAModel = TWAModel() ): TSMobileAnalytics? { return TSMobileAnalyticsBackend.createInstance( - activity, - cpID, - applicationName, - panelistTrackingOnly, - isWebViewBased, - twaInfo + activity, cpID, applicationName, panelistTrackingOnly, isWebViewBased, twaInfo ) } @@ -351,8 +337,7 @@ open class TSMobileAnalytics protected constructor() { */ @JvmStatic fun createInstance( - activity: ComponentActivity, - builder: TSMobileAnalytics + activity: ComponentActivity, builder: TSMobileAnalytics ): TSMobileAnalytics? { return createInstance( activity, @@ -386,7 +371,4 @@ open class TSMobileAnalytics protected constructor() { } - - - } \ No newline at end of file