问题描述:

Hello everyone i have cureently create a mobile game app using html5. I am using (AWS Amazon web services) and more specific amazon mobile analytics to track some events that i want to record and it works fine when my app is connected to the WiFi all the events are listed but the below error is triggered when i use my app with no internet connection

Failed to load resource: net::ERR_NAME_NOT_RESOLVED https://cognito-identity.us-east-1.amazonaws.com/

Isn't there automatically suppose to local storage the events and when go online to send it or should i make it? Cause in android and ios native language AWS automatically take care of this issues.

Thanx in advance!

AWS.config.region = 'us-east-1';

AWS.config.credentials = new AWS.CognitoIdentityCredentials({

IdentityPoolId: COGNITO_IDENTITY_POOL_ID //Required e.g. 'us-east-1:12345678-c1ab-4122-913b-22d16971337b'

});

var options = {

appId : MOBILE_ANALYTICS_APP_ID //Required e.g. 'c5d69c75a92646b8953126437d92c007'

};

mobileAnalyticsClient = new AMA.Manager(options);

mobileAnalyticsClient.recordEvent('CUSTOM EVENT NAME', {

'ATTRIBUTE_1_NAME': 'ATTRIBUTE_1_VALUE',

'ATTRIBUTE_2_NAME': 'ATTRIBUTE_2_VALUE'

/* ... */

}, {

'METRIC_1_NAME': 1,

'METRIC_2_NAME': 99.3

/* ... */

});

相关阅读:
Top