-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[REACT-NATIVE] Send device information like model and OS version #877
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
Comments
There are libs that get this information, like https://github.com/rebeccahughes/react-native-device-info, but I see #809 wasn't merged, so I'm not sure we can set this somehow. cc @orlando |
@brunolemos I ended up using my fork https://github.com/orlando/raven-js. You only need device information from JavaScript, in Java you should use the raven-java library |
@orlando thanks for your insight! I was able to fully implement it without a fork, here is my solution: Codeimport DeviceInfo from 'react-native-device-info'
import Raven from 'raven-js'
import RavenNative from 'raven-js/plugins/react-native'
import pkg from '../package.json'
RavenNative(Raven)
if (!__DEV__) {
Raven
.config('https://[email protected]/...', {
release: pkg.version,
dataCallback: data => {
data.contexts = data.contexts || {}
data.contexts.device = Object.assign(data.contexts.device || {}, {
name: DeviceInfo.getDeviceName(),
family: DeviceInfo.getBrand(),
model: DeviceInfo.getModel(),
})
data.contexts.os = Object.assign(data.contexts.os || {}, {
name: DeviceInfo.getSystemName(),
version: DeviceInfo.getSystemVersion(),
})
return data
},
})
.install()
} Result |
All right, sentry just released a more complete React Native integration! https://blog.sentry.io/2017/03/14/react-native EDIT: iOS only by now 😒 So the code above is still useful. |
Uh oh!
There was an error while loading. Please reload this page.
I was expecting to have the device details on the crash reports, but that didn't happen.
Is this going to be supported? Any way we can do that today?
The text was updated successfully, but these errors were encountered: