diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 4d0bdae8..089968e8 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -21,6 +21,16 @@ + + + + + + + + + + diff --git a/sample/src/main/java/com/example/webtrekk/androidsdk/MainActivity.kt b/sample/src/main/java/com/example/webtrekk/androidsdk/MainActivity.kt index 456b98ac..cf560bd3 100644 --- a/sample/src/main/java/com/example/webtrekk/androidsdk/MainActivity.kt +++ b/sample/src/main/java/com/example/webtrekk/androidsdk/MainActivity.kt @@ -26,16 +26,21 @@ package com.example.webtrekk.androidsdk import android.content.Intent +import android.net.Uri import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import com.appoxee.Appoxee import com.example.webtrekk.androidsdk.mapp.MainActivity import kotlinx.android.synthetic.main.activity_main.* import webtrekk.android.sdk.* +import java.lang.StringBuilder @TrackPageDetail( contextName = "Main Page", - trackingParams = [TrackParams(paramKey = Param.PAGE_PARAMS.INTERNAL_SEARCH, paramVal = "search")] + trackingParams = [TrackParams( + paramKey = Param.PAGE_PARAMS.INTERNAL_SEARCH, + paramVal = "search" + )] ) class MainActivity : AppCompatActivity() { @@ -86,5 +91,18 @@ class MainActivity : AppCompatActivity() { val intent = Intent(this, ObjectTrackingActivityExample::class.java) startActivity(intent) } + + val int = intent + val uri = int.data + if (uri != null) { + val result = int.dataString?.removePrefix("mapptest://test?link=") + val url = Uri.parse(result) + Webtrekk.getInstance().trackUrl(url) + Webtrekk.getInstance().trackPage(this) + } + } + + override fun onNewIntent(intent: Intent?) { + super.onNewIntent(intent) } }