mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
convert platformName from os.platfoem() form to AMA form
This commit is contained in:
@@ -10,11 +10,23 @@ if (process.env.NODE_ENV === 'production' && ConfigManager.default.get().amaEnab
|
|||||||
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||||
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
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({
|
const mobileAnalyticsClient = new AMA.Manager({
|
||||||
appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||||
appTitle: 'xxxxxxxxxx',
|
appTitle: 'xxxxxxxxxx',
|
||||||
appVersionName: remote.app.getVersion().toString(),
|
appVersionName: remote.app.getVersion().toString(),
|
||||||
platform: os.platform()
|
platform: actualPlatform
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user