RN-526 fix broken analytics (#1183)
This commit is contained in:
parent
92bc6e73ee
commit
8b08a44820
2 changed files with 20 additions and 4 deletions
|
|
@ -10,6 +10,7 @@ import {IntlProvider} from 'react-intl';
|
|||
import {
|
||||
Alert,
|
||||
AppState,
|
||||
Dimensions,
|
||||
InteractionManager,
|
||||
NativeModules,
|
||||
Platform
|
||||
|
|
@ -151,12 +152,27 @@ export default class Mattermost {
|
|||
configureAnalytics = (config) => {
|
||||
if (config && config.DiagnosticsEnabled === 'true' && config.DiagnosticId && Config.SegmentApiKey) {
|
||||
if (!global.analytics) {
|
||||
const {height, width} = Dimensions.get('window');
|
||||
global.analytics = new Analytics(Config.SegmentApiKey);
|
||||
global.analytics_context = {
|
||||
app: {
|
||||
version: DeviceInfo.getVersion(),
|
||||
build: DeviceInfo.getBuildNumber()
|
||||
},
|
||||
device: {
|
||||
dimensions: {
|
||||
height,
|
||||
width
|
||||
},
|
||||
isTablet: DeviceInfo.isTablet(),
|
||||
os: DeviceInfo.getSystemVersion()
|
||||
},
|
||||
server: config.Version
|
||||
};
|
||||
|
||||
global.analytics.identify({
|
||||
userId: config.DiagnosticId,
|
||||
context: {
|
||||
ip: '0.0.0.0'
|
||||
},
|
||||
context: global.analytics_context,
|
||||
page: {
|
||||
path: '',
|
||||
referrer: '',
|
||||
|
|
|
|||
|
|
@ -3961,7 +3961,7 @@ makeerror@1.0.x:
|
|||
|
||||
mattermost-redux@mattermost/mattermost-redux#master:
|
||||
version "1.0.1"
|
||||
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/04f393e4ad512cd3be354f6ff57bb968bf3a27da"
|
||||
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/7c5c77c8fcf2b18530c7a5a07f229ee29a8f7822"
|
||||
dependencies:
|
||||
deep-equal "1.0.1"
|
||||
form-data "2.3.1"
|
||||
|
|
|
|||
Loading…
Reference in a new issue