Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix twa issue #13

Merged
merged 1 commit into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix twa issue
  • Loading branch information
ahmedshortcut committed Nov 10, 2022
commit e961fe8d5ecbde6a8dd0b30dc3bb6c72cabf3467
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() {
}





}