Skip to content

Commit

Permalink
chore: Expose sdk name and version to be set on Flutter (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Jan 9, 2024
1 parent be9ac55 commit 6ff9347
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion PostHog/PostHogApi.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PostHogApi {

config.httpAdditionalHeaders = [
"Content-Type": "application/json; charset=utf-8",
"User-Agent": "posthog-ios/\(postHogVersion)",
"User-Agent": "\(postHogSdkName)/\(postHogVersion)",
]

return config
Expand Down
2 changes: 1 addition & 1 deletion PostHog/PostHogContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class PostHogContext {
properties["$screen_height"] = Float(UIScreen.main.bounds.height)
#endif

properties["$lib"] = "posthog-ios"
properties["$lib"] = postHogSdkName
properties["$lib_version"] = postHogVersion

if Locale.current.languageCode != nil {
Expand Down
6 changes: 5 additions & 1 deletion PostHog/PostHogVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
import Foundation

// if you change this, make sure to also change it in the podspec and check if the script scripts/bump-version.sh still works
let postHogVersion = "3.0.0-beta.1"
// This property is internal only
public var postHogVersion = "3.0.0-beta.1"

// This property is internal only
public var postHogSdkName = "posthog-ios"

0 comments on commit 6ff9347

Please sign in to comment.