-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #620 from BoostIO/feature-AmazonMobileAnalytics
Feature amazon mobile analytics
- Loading branch information
Showing
12 changed files
with
127 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const AWS = require('aws-sdk') | ||
const AMA = require('aws-sdk-mobile-analytics') | ||
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({ | ||
appId: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | ||
appTitle: 'xxxxxxxxxx' | ||
}) | ||
|
||
function initAwsMobileAnalytics () { | ||
AWS.config.credentials.get(function (err) { | ||
if (!err) { | ||
console.log('Cognito Identity ID: ' + AWS.config.credentials.identityId) | ||
} | ||
}) | ||
recordStaticCustomEvent() | ||
} | ||
|
||
function recordDynamitCustomEvent (type) { | ||
mobileAnalyticsClient.recordEvent(type) | ||
} | ||
|
||
function recordStaticCustomEvent () { | ||
mobileAnalyticsClient.recordEvent('UI_COLOR_THEME', { | ||
uiColorTheme: ConfigManager.default.get().ui.theme | ||
}) | ||
} | ||
|
||
module.exports = { | ||
initAwsMobileAnalytics, | ||
recordDynamitCustomEvent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters