mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Disable awsAnalytics on develop
This commit is contained in:
@@ -22,7 +22,9 @@ class Main extends React.Component {
|
|||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
|
|
||||||
mobileAnalytics.initAwsMobileAnalytics()
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
mobileAnalytics.initAwsMobileAnalytics()
|
||||||
|
}
|
||||||
|
|
||||||
let { config } = props
|
let { config } = props
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,18 @@ const AWS = require('aws-sdk')
|
|||||||
const AMA = require('aws-sdk-mobile-analytics')
|
const AMA = require('aws-sdk-mobile-analytics')
|
||||||
const ConfigManager = require('browser/main/lib/ConfigManager')
|
const ConfigManager = require('browser/main/lib/ConfigManager')
|
||||||
|
|
||||||
AWS.config.region = 'us-east-1'
|
|
||||||
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
|
||||||
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
|
||||||
})
|
|
||||||
const mobileAnalyticsClient = new AMA.Manager({
|
const mobileAnalyticsClient = new AMA.Manager({
|
||||||
appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
||||||
appTitle: 'xxxxxxxxxx'
|
appTitle: 'xxxxxxxxxx'
|
||||||
})
|
})
|
||||||
|
|
||||||
function initAwsMobileAnalytics () {
|
function initAwsMobileAnalytics () {
|
||||||
AWS.config.credentials.get(function (err) {
|
AWS.config.region = 'us-east-1'
|
||||||
|
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
|
||||||
|
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||||
|
})
|
||||||
|
|
||||||
|
AWS.config.credentials.get((err) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
console.log('Cognito Identity ID: ' + AWS.config.credentials.identityId)
|
console.log('Cognito Identity ID: ' + AWS.config.credentials.identityId)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user