private AWSMobileClient(final Context context, final String cognitoIdentityPoolID, final Regions cognitoRegion, final String mobileAnalyticsAppID, final IdentityManager identityManager, final ClientConfiguration clientConfiguration) { this.context = context; this.identityManager = identityManager; this.clientConfiguration = clientConfiguration; try { this.mobileAnalyticsManager = MobileAnalyticsManager. getOrCreateInstance(context, AWSConfiguration.AMAZON_MOBILE_ANALYTICS_APP_ID, AWSConfiguration.AMAZON_MOBILE_ANALYTICS_REGION, identityManager.getCredentialsProvider(), new AnalyticsConfig(clientConfiguration)); } catch (final InitializationException ie) { Log.e(LOG_TAG, "Unable to initalize Amazon Mobile Analytics. " + ie.getMessage(), ie); } this.syncManager = new CognitoSyncManager(context, AWSConfiguration.AMAZON_COGNITO_REGION, identityManager.getCredentialsProvider(), clientConfiguration); this.dynamoDBClient = new AmazonDynamoDBClient(identityManager.getCredentialsProvider(), clientConfiguration); this.dynamoDBMapper = new DynamoDBMapper(dynamoDBClient); }
public static void init(Context context) { provider = new CognitoCachingCredentialsProvider(context, AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNTIO_ROLE_UNAUTH, COGNITO_ROLE_AUTH, Regions.US_EAST_1); //initialize the clients cognitosync = new CognitoSyncManager(context, Regions.US_EAST_1, provider); manager = new TransferManager(provider); ddb = new AmazonDynamoDBClient(provider); //ddbmapper = new DynamoDBMapper(ddb); analytics = MobileAnalyticsManager.getOrCreateInstance(context, MOBILE_ANALYTICS_APP_ID, Regions.US_EAST_1, provider); kinesis = new KinesisRecorder(context.getDir(KINESIS_DIRECTORY_NAME, 0), Regions.US_EAST_1, provider); lambda = new LambdaInvokerFactory(context, Regions.US_WEST_2, provider); }
public static void init(Context context) { provider = new CognitoCachingCredentialsProvider(context, AWS_ACCOUNT_ID, COGNITO_POOL_ID, COGNTIO_ROLE_UNAUTH, COGNITO_ROLE_AUTH, Regions.US_EAST_1); //initialize the Cognito Sync Client //initialize the Other Clients manager = new TransferManager(provider); analytics = MobileAnalyticsManager.getOrCreateInstance(context, "App_ID_Here", Regions.US_EAST_1, provider); }
/** * Initializes the MobileAnalyticsManager. This must be called before * calling any methods in this class. * * @param context a context of the app */ public static void init(Context context) { if (analytics == null) { AnalyticsConfig options = new AnalyticsConfig(); options.withAllowsWANDelivery(true); analytics = MobileAnalyticsManager.getOrCreateInstance(context, Constants.MOBILE_ANALYTICS_APP_ID, Regions.US_EAST_1, CognitoClientManager.getCredentials(), options); } }
public static MobileAnalyticsManager getAnalytics() { if (analytics == null) { throw new IllegalStateException("client not initialized yet"); } return analytics; }
/** * Gets the Amazon Mobile Analytics Manager, which allows you to submit * custom and monetization events to the Amazon Mobile Analytics system. It * also handles recording user session data events. * @return mobile analytics manager */ public MobileAnalyticsManager getMobileAnalyticsManager() { return this.mobileAnalyticsManager; }