/// <summary> /// Constructor of <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.Internal.DeliveryClient"/> class. /// </summary> /// <param name="policyFactory">An instance of IDeliveryPolicyFactory. <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.Internal.IDeliveryPolicyFactory"/></param> /// <param name="maConfig">Mobile Analytics Manager configuration. <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.MobileAnalyticsManagerConfig"/></param> /// <param name="clientContext">An instance of ClientContext. <see cref="Amazon.Runtime.Internal.ClientContext"/></param> /// <param name="credentials">An instance of Credentials. <see cref="Amazon.Runtime.AWSCredentials"/></param> /// <param name="regionEndPoint">Region endpoint. <see cref="Amazon.RegionEndpoint"/></param> /// <param name="maManager">Mobile Analytics Manager instance. <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.MobileAnalyticsManager"/></param> public DeliveryClient(IDeliveryPolicyFactory policyFactory, MobileAnalyticsManagerConfig maConfig, ClientContext clientContext, AWSCredentials credentials, RegionEndpoint regionEndPoint, MobileAnalyticsManager maManager) { _policyFactory = policyFactory; _deliveryPolicies = new List<IDeliveryPolicy>(); _deliveryPolicies.Add(_policyFactory.NewConnectivityPolicy()); _clientContext = clientContext; _appID = clientContext.AppID; _maConfig = maConfig; _eventStore = new SQLiteEventStore(maConfig); _maManager = maManager; if (null == credentials && null == regionEndPoint) { _mobileAnalyticsLowLevelClient = new AmazonMobileAnalyticsClient(); } else if (null == credentials) { _mobileAnalyticsLowLevelClient = new AmazonMobileAnalyticsClient(regionEndPoint); } else if (null == regionEndPoint) { _mobileAnalyticsLowLevelClient = new AmazonMobileAnalyticsClient(credentials); } else { _mobileAnalyticsLowLevelClient = new AmazonMobileAnalyticsClient(credentials, regionEndPoint); } }
/// <summary> /// Constructor of <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.DeliveryClient"/> class. /// </summary> /// <param name="isDataAllowed">An instance of IDeliveryPolicyFactory <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.Internal.IDeliveryPolicyFactory"/></param> /// <param name="clientContext">An instance of ClientContext <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.Internal.ClientContext"/></param> /// <param name="credentials">An instance of Credentials <see cref="Amazon.Runtime.AWSCredentials"/></param> /// <param name="regionEndPoint">Region end point <see cref="Amazon.RegionEndpoint"/></param> public DeliveryClient(IDeliveryPolicyFactory policyFactory, ClientContext clientContext, AWSCredentials credentials, RegionEndpoint regionEndPoint) { _policyFactory = policyFactory; _mobileAnalyticsLowLevelClient = new AmazonMobileAnalyticsClient(credentials, regionEndPoint); _clientContext = clientContext; _appId = clientContext.Config.AppId; _eventStore = new SQLiteEventStore(AWSConfigsMobileAnalytics.MaxDBSize, AWSConfigsMobileAnalytics.DBWarningThreshold); _deliveryPolicies = new List<IDeliveryPolicy>(); _deliveryPolicies.Add(_policyFactory.NewConnectivityPolicy()); _deliveryPolicies.Add(_policyFactory.NewBackgroundSubmissionPolicy()); }