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

Change Device.BatteryLevel from Short to Double #3557

Closed
jamescrosswell opened this issue Aug 25, 2024 · 1 comment
Closed

Change Device.BatteryLevel from Short to Double #3557

jamescrosswell opened this issue Aug 25, 2024 · 1 comment
Milestone

Comments

@jamescrosswell
Copy link
Collaborator

// TODO: For next major: Remove this and change BatteryLevel from short to float
// The Java and Cocoa SDK report the battery as `float`
// Cocoa https://github.com/getsentry/sentry-cocoa/blob/e773cad622b86735f1673368414009475e4119fd/Sources/Sentry/include/SentryUIDeviceWrapper.h#L18
// Java https://github.com/getsentry/sentry-java/blob/25f1ca4e1636a801c17c1662f0145f888550bce8/sentry/src/main/java/io/sentry/protocol/Device.java#L231-L233
var batteryLevel = json.GetPropertyOrNull("battery_level")?.TryGetDouble(out var level) is true
? (short)level
: (short?)null;

@jamescrosswell jamescrosswell added this to the 5.0.0 milestone Aug 25, 2024
@jamescrosswell
Copy link
Collaborator Author

Duplicate of #3542

@jamescrosswell jamescrosswell marked this as a duplicate of #3542 Aug 26, 2024
@github-project-automation github-project-automation bot moved this to Done in GDX Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant