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

Add a platform context plugin to the React Native tracker to track device information #1395

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

matus-tomlein
Copy link
Contributor

Adds the platform context to the React Native tracker that tracks information about the device.

The information available in React Native is quite limited, so only a few properties are auto-tracked: osType, osVersion, deviceManufacturer, deviceModel, resolution, language, scale

The rest can be provided by a platformContextRetriever configuration option. This is the same as on our mobile trackers.

There is also an option to provide platformContextProperties configuration option that filters which properties will be tracked. Also reflects our mobile trackers.

Copy link

bundlemon bot commented Nov 28, 2024

BundleMon

Files added (6)
Status Path Size Limits
trackers/javascript-tracker/dist/sp.js
+24.54KB 30KB / +10%
libraries/browser-tracker-core/dist/index.mod
ule.js
+23.59KB 25KB / +10%
libraries/tracker-core/dist/index.module.js
+19.5KB 20KB / +10%
trackers/browser-tracker/dist/index.umd.min.j
s
+17.44KB 20KB / +10%
trackers/javascript-tracker/dist/sp.lite.js
+17.39KB 20KB / +10%
trackers/browser-tracker/dist/index.module.js
+3.49KB 5KB / +10%

Total files change +105.95KB 0%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history

@matus-tomlein matus-tomlein force-pushed the issue/react-native-platform-context branch from 3a6dd59 to 8700480 Compare November 28, 2024 13:42
Copy link
Contributor

@mscwilson mscwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

/**
* Amount of memory in bytes available to the current app.
* The property is not tracked in the current version of the tracker due to the tracker not being able to access the API, see the issue here: https://github.com/snowplow/snowplow-ios-tracker/issues/772
* Note: this property is not automatically assigned but can be assigned using the PlatformContextRetriever.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it tracked if it's set with PlatformContextRetriever?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's true, when it's manually provided by the PlatformContextRetriever, then it should be added to the platform context.

…vice information

# Conflicts:
#	api-docs/docs/react-native-tracker/markdown/react-native-tracker.reactnativetracker.md
#	api-docs/docs/react-native-tracker/react-native-tracker.api.md
#	trackers/react-native-tracker/src/constants.ts
#	trackers/react-native-tracker/src/tracker.ts
#	trackers/react-native-tracker/test/tracker.test.ts
@matus-tomlein matus-tomlein force-pushed the issue/react-native-platform-context branch from 8700480 to 07180aa Compare November 29, 2024 08:48
@matus-tomlein matus-tomlein merged commit 45212f0 into wip/react-native Dec 10, 2024
3 checks passed
@matus-tomlein matus-tomlein deleted the issue/react-native-platform-context branch December 10, 2024 08:08
matus-tomlein added a commit that referenced this pull request Dec 16, 2024
@matus-tomlein matus-tomlein mentioned this pull request Jan 6, 2025
matus-tomlein added a commit that referenced this pull request Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants