1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

convert platformName from os.platfoem() form to AMA form

This commit is contained in:
Sosuke Suzuki
2017-10-10 14:58:52 +09:00
parent d56bcc4fdf
commit d772551c60

View File

@@ -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
})
}