From d772551c600ac696d94ae357b01911afba1783a8 Mon Sep 17 00:00:00 2001 From: Sosuke Suzuki Date: Tue, 10 Oct 2017 14:58:52 +0900 Subject: [PATCH] convert platformName from os.platfoem() form to AMA form --- browser/main/lib/AwsMobileAnalyticsConfig.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/browser/main/lib/AwsMobileAnalyticsConfig.js b/browser/main/lib/AwsMobileAnalyticsConfig.js index 9bfa8767..037513c2 100644 --- a/browser/main/lib/AwsMobileAnalyticsConfig.js +++ b/browser/main/lib/AwsMobileAnalyticsConfig.js @@ -10,11 +10,23 @@ if (process.env.NODE_ENV === 'production' && ConfigManager.default.get().amaEnab AWS.config.credentials = new AWS.CognitoIdentityCredentials({ IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx' }) + + const rawPlatform = os.platform() + + let actualPlatform + if (rawPlatform === 'darwin') { + actualPlatform = 'MacOS' + } else if (rawPlatform === 'win32') { + actualPlatform = 'Windows' + } else if (rawPlatform === 'linux') { + actualPlatform = 'Linux' + } + const mobileAnalyticsClient = new AMA.Manager({ appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx', appTitle: 'xxxxxxxxxx', appVersionName: remote.app.getVersion().toString(), - platform: os.platform() + platform: actualPlatform }) }