Skip to content

Commit

Permalink
Do not set network carrier if empty (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Nov 14, 2023
1 parent 8f91b8e commit d812492
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next

- Do not set `$network_carrier` property if empty ([#66](https://github.com/PostHog/posthog-android/pull/66))

## 3.0.0-beta.6 - 2023-11-14

- Add a `propertiesSanitizer` callback configuration ([#64](https://github.com/PostHog/posthog-android/pull/64))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ internal class PostHogAndroidContext(
}

context.telephonyManager()?.let {
dynamicContext["\$network_carrier"] = it.networkOperatorName
val networkOperatorName = it.networkOperatorName
if (!networkOperatorName.isNullOrEmpty()) {
dynamicContext["\$network_carrier"] = networkOperatorName
}
}

return dynamicContext
Expand Down

0 comments on commit d812492

Please sign in to comment.