public ClientContext(string appId, ClientContextConfig config) { _config = config; this.AppID = appId; this._custom = new Dictionary<string, string>(); if (string.IsNullOrEmpty(_clientID)) { string fullPath = InternalSDKUtils.DetermineAppLocalStoragePath(CLIENT_ID_CACHE_FILENAME); var directoryPath = InternalSDKUtils.DetermineAppLocalStoragePath(); lock (_lock) { if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); } if (!System.IO.File.Exists(fullPath) || new System.IO.FileInfo(fullPath).Length == 0) { _clientID = Guid.NewGuid().ToString(); System.IO.File.WriteAllText(fullPath, _clientID); } else { using (System.IO.StreamReader file = new System.IO.StreamReader(fullPath)) { _clientID = file.ReadToEnd(); file.Close(); } } } } }
public ClientContext(string appId, ClientContextConfig config) { _config = config; this.AppID = appId; this._custom = new Dictionary <string, string>(); if (string.IsNullOrEmpty(_clientID)) { string fullPath = InternalSDKUtils.DetermineAppLocalStoragePath(CLIENT_ID_CACHE_FILENAME); var directoryPath = InternalSDKUtils.DetermineAppLocalStoragePath(); if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); } if (!System.IO.File.Exists(fullPath) || new System.IO.FileInfo(fullPath).Length == 0) { _clientID = Guid.NewGuid().ToString(); System.IO.File.WriteAllText(fullPath, _clientID); } else { using (System.IO.StreamReader file = new System.IO.StreamReader(fullPath)) { _clientID = file.ReadToEnd(); file.Close(); } } } }
/// <summary> /// Constructor of <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.MobileAnalyticsManagerConfig"/> /// </summary> public MobileAnalyticsManagerConfig() { SessionTimeout = defaultSessionTimeout; MaxDBSize = defaultMaxDBSize; DBWarningThreshold = defaultDBWarningThreshold; MaxRequestSize = defaultMaxRequestSize; AllowUseDataNetwork = defaultAllowUseDataNetwork; #if BCL ClientContextConfiguration = new ClientContextConfig(); #endif }
/// <summary> /// Constructor of <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.MobileAnalyticsManagerConfig"/> /// </summary> public MobileAnalyticsManagerConfig() { SessionTimeout = defaultSessionTimeout; MaxDBSize = defaultMaxDBSize; DBWarningThreshold = defaultDBWarningThreshold; MaxRequestSize = defaultMaxRequestSize; AllowUseDataNetwork = defaultAllowUseDataNetwork; #if BCL ClientContextConfiguration = new ClientContextConfig(); #endif #if UNITY var root = new RootConfig(); var section = root.GetServiceSection(mobileAnalyticsKey); if (section == null) { return; } var rootSection = new MobileAnalyticsManagerConfigSectionRoot(section); if (rootSection.SectionConfig != null) Configure(rootSection.SectionConfig); #endif }