From 6fe03a8efb6b35b8b1ebc067b05da76082b97789 Mon Sep 17 00:00:00 2001 From: Didier Garcia Date: Mon, 27 Feb 2023 18:51:17 -0500 Subject: [PATCH] Change name of function to match Swift analytics. (#134) --- .../com/segment/analytics/kotlin/android/AndroidAnalytics.kt | 2 +- .../src/main/java/com/segment/analytics/next/MainActivity.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/segment/analytics/kotlin/android/AndroidAnalytics.kt b/android/src/main/java/com/segment/analytics/kotlin/android/AndroidAnalytics.kt index 016045a0..42097656 100644 --- a/android/src/main/java/com/segment/analytics/kotlin/android/AndroidAnalytics.kt +++ b/android/src/main/java/com/segment/analytics/kotlin/android/AndroidAnalytics.kt @@ -80,7 +80,7 @@ private fun Analytics.startup() { * @param referrer: The string representing the app or url that caused the deep link to be activated. * @param intent: The intent received by the Activity's onNewIntent() function. */ -fun Analytics.trackDeepLinkOpen(referrer: String?, intent: Intent?) { +fun Analytics.openUrl(referrer: String?, intent: Intent?) { DeepLinkUtils(this).trackDeepLinkFrom(referrer, intent) } diff --git a/samples/kotlin-android-app/src/main/java/com/segment/analytics/next/MainActivity.kt b/samples/kotlin-android-app/src/main/java/com/segment/analytics/next/MainActivity.kt index 32aa1afd..b3901af3 100644 --- a/samples/kotlin-android-app/src/main/java/com/segment/analytics/next/MainActivity.kt +++ b/samples/kotlin-android-app/src/main/java/com/segment/analytics/next/MainActivity.kt @@ -7,7 +7,7 @@ import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentTransaction -import com.segment.analytics.kotlin.android.trackDeepLinkOpen +import com.segment.analytics.kotlin.android.openUrl import com.segment.analytics.kotlin.core.Analytics import com.segment.analytics.kotlin.core.EventType import com.segment.analytics.kotlin.core.platform.plugins.logger.log @@ -65,6 +65,6 @@ class MainActivity : AppCompatActivity() { // The Analytics SDK automatically identifies when you app is started from a deep link // if the Activity is created, but not if it is re-used. Therefore we have to add this // code to manually capture the Deep Link info. - analytics.trackDeepLinkOpen("deep-link", intent) + analytics.openUrl("deep-link", intent) } } \ No newline at end of file