Skip to content

Commit

Permalink
Merge pull request #13 from shortcut/master
Browse files Browse the repository at this point in the history
fix twa issue
  • Loading branch information
ahmedshortcut committed Nov 10, 2022
2 parents 9646d83 + e961fe8 commit 2630918
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -73,7 +70,7 @@ open class TSMobileAnalytics protected constructor() {
/**
* URL for trusted web activity
*/
lateinit var twaInfo: TWAModel
protected var twaInfo: TWAModel = TWAModel()


/**
Expand All @@ -95,8 +92,9 @@ open class TSMobileAnalytics protected constructor() {
fun sendTag(category: String?): Int {
return dataRequestHandler.performMetricsRequest(category)
}

fun openTwa() {
dataRequestHandler.openTwa()
dataRequestHandler.openTwa()
}


Expand All @@ -123,7 +121,6 @@ open class TSMobileAnalytics protected constructor() {
}



/**
* Call to immediately send a tag to the server using the framework's HTTPS-functionality.
*
Expand Down Expand Up @@ -162,7 +159,6 @@ open class TSMobileAnalytics protected constructor() {
}



/**
* TSMobileAnalytics constructor with Builder class.
*
Expand Down Expand Up @@ -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).
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
)
}

Expand All @@ -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
)
}

Expand All @@ -351,8 +337,7 @@ open class TSMobileAnalytics protected constructor() {
*/
@JvmStatic
fun createInstance(
activity: ComponentActivity,
builder: TSMobileAnalytics
activity: ComponentActivity, builder: TSMobileAnalytics
): TSMobileAnalytics? {
return createInstance(
activity,
Expand Down Expand Up @@ -386,7 +371,4 @@ open class TSMobileAnalytics protected constructor() {
}





}

0 comments on commit 2630918

Please sign in to comment.