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: set correct User-Agent for Android and returns session recording even if authorized domains is enabled #125

Merged
merged 4 commits into from
Apr 24, 2024
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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
## Next

## 3.1.18 - 2024-04-24

- fix: set correct `User-Agent` for Android and returns session recording even if authorized domains is enabled ([#125](https://github.com/PostHog/posthog-android/pull/125))

## 3.1.17 - 2024-04-11

recording: multiple fixes for better frame rate, padding, drawables ([#118](https://github.com/PostHog/posthog-android/pull/118))
- recording: multiple fixes for better frame rate, padding, drawables ([#118](https://github.com/PostHog/posthog-android/pull/118))

## 3.1.16 - 2024-03-27

fix: add replay props only if replay is enabled ([#112](https://github.com/PostHog/posthog-android/pull/112))
- fix: add replay props only if replay is enabled ([#112](https://github.com/PostHog/posthog-android/pull/112))

## 3.1.15 - 2024-03-08

Expand Down
5 changes: 4 additions & 1 deletion posthog/src/main/java/com/posthog/PostHogConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ public open class PostHogConfig(
@PostHogInternal
public var sdkVersion: String = BuildConfig.VERSION_NAME

internal val userAgent: String = "$sdkName/$sdkVersion"
internal val userAgent: String
get() {
return "$sdkName/$sdkVersion"
}

@PostHogInternal
public var legacyStoragePrefix: String? = null
Expand Down
6 changes: 6 additions & 0 deletions posthog/src/test/java/com/posthog/PostHogConfigTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ internal class PostHogConfigTest {
assertEquals(BuildConfig.VERSION_NAME, config.sdkVersion)
}

@Test
fun `user agent is returned correctly if changed`() {
config.sdkName = "posthog-android"
assertEquals("posthog-android/${BuildConfig.VERSION_NAME}", config.userAgent)
}

@Test
fun `user agent is set the java sdk by default`() {
assertEquals("posthog-java/${BuildConfig.VERSION_NAME}", config.userAgent)
Expand Down
Loading