Skip to content

Commit 19cc5e9

Browse files
authored
Update the smaple kotlin app for the new logging changes. (#145)
1 parent f514a96 commit 19cc5e9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

samples/kotlin-android-app/src/main/java/com/segment/analytics/next/EventFragment.kt

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class EventFragment(val type: EventType, val analytics: Analytics) : Fragment()
5454
EventType.Identify -> sendIdentify(userId = input, traits = properties)
5555
EventType.Screen -> sendScreen(screenName = input, props = properties)
5656
EventType.Group -> sendGroup(groupId = input, traits = properties)
57+
else -> println("Type not supported: $type")
5758
}
5859
}
5960

samples/kotlin-android-app/src/main/java/com/segment/analytics/next/plugins/AndroidAdvertisingIdPlugin.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class AndroidAdvertisingIdPlugin(private val androidContext: Context) : Plugin {
4848
if (isLimitAdTrackingEnabled) {
4949
analytics.log(
5050
"Not collecting advertising ID because isLimitAdTrackingEnabled (Google Play Services) is true.",
51-
kind = LogFilterKind.WARNING
51+
kind = LogKind.WARNING
5252
)
5353
return Result.Err(Exception("LimitAdTrackingEnabled (Google Play Services) is true"))
5454
}
@@ -65,7 +65,7 @@ class AndroidAdvertisingIdPlugin(private val androidContext: Context) : Plugin {
6565
if (limitAdTracking) {
6666
analytics.log(
6767
"Not collecting advertising ID because limit_ad_tracking (Amazon Fire OS) is true.",
68-
kind = LogFilterKind.WARNING
68+
kind = LogKind.WARNING
6969
)
7070
return Result.Err(Exception("limit_ad_tracking (Amazon Fire OS) is true."))
7171
}
@@ -91,7 +91,7 @@ class AndroidAdvertisingIdPlugin(private val androidContext: Context) : Plugin {
9191
} catch (e: Exception) {
9292
Analytics.segmentLog(
9393
message = "${e.message}: Unable to collect advertising ID from Google Play Services.",
94-
kind = LogFilterKind.ERROR
94+
kind = LogKind.ERROR
9595
)
9696
}
9797
try {
@@ -111,12 +111,12 @@ class AndroidAdvertisingIdPlugin(private val androidContext: Context) : Plugin {
111111
} catch (e: Exception) {
112112
Analytics.segmentLog(
113113
"${e.message}: Unable to collect advertising ID from Amazon Fire OS.",
114-
kind = LogFilterKind.WARNING
114+
kind = LogKind.WARNING
115115
)
116116
}
117117
analytics.log(
118118
"Unable to collect advertising ID from Amazon Fire OS and Google Play Services.",
119-
kind = LogFilterKind.WARNING
119+
kind = LogKind.WARNING
120120
)
121121
}
122122

samples/kotlin-android-app/src/main/java/com/segment/analytics/next/plugins/AndroidRecordScreenPlugin.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AndroidRecordScreenPlugin : Plugin, AndroidLifecycle {
2626
} catch (e: Exception) {
2727
Analytics.segmentLog(
2828
"Unable to track screen view for ${activity.toString()}",
29-
kind = LogFilterKind.ERROR
29+
kind = LogKind.ERROR
3030
)
3131
}
3232
}

0 commit comments

Comments
 (0)