/// <summary>
        /// Initializes a new instance of the
        /// <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.Internal.SubmissionTimePolicy"/> class.
        /// </summary>
        /// <param name="WaitInterval">Wait interval.</param>
        public SubmissionTimePolicy (long WaitInterval)
        {
            this.WaitInterval = WaitInterval;
        
            //retrieve the last submitted timestamp from the cache
            _persistStore = new PlayerPreferenceKVStore();

            String TimeStamp = _persistStore.Get(LAST_SUCCESSFUL_DELIVERY_TIME_STAMP_KEY);
            if(TimeStamp != null && TimeStamp.Length > 0)
            {
                this.LastSubmittedTime = long.Parse(TimeStamp);
            }
            else
            {
                this.LastSubmittedTime = 0;
            }
        }
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="Amazon.MobileAnalytics.MobileAnalyticsManager.ClientContextConfig"/> class.
        /// </summary>
        /// <param name="appTitle">App title -  The title of your app. For example, My App.</param>
        /// <param name="appVersionName">App version name - The version of your app. For example, V2.0.</param>
        /// <param name="appVersionCode">App version code - The version code for your app. For example, 3.</param>
        /// <param name="appPackageName">App package name - The name of your package. For example, com.example.my_app.</param>
        /// <param name="appId">App identifier - AWS Mobile Analytics App ID corresponding to your App</param>
        public ClientContextConfig(string appTitle, string appVersionName,string appVersionCode, string appPackageName, string appId)
        {
            if(string.IsNullOrEmpty(appTitle))
            {
                throw new ArgumentNullException("appTitle");
            }
            
            if(string.IsNullOrEmpty(appVersionName))
            {
                throw new ArgumentNullException("appVersionName");
            }
            
            if(string.IsNullOrEmpty(appId))
            {
                throw new ArgumentNullException("appId");
            }
            
            if(string.IsNullOrEmpty(appPackageName))
            {
                throw new ArgumentNullException("appPackageName");
            }
            
            if(string.IsNullOrEmpty(appVersionCode))
            {
                throw new ArgumentNullException("appVersionCode");
            }

            this._appTitle = appTitle;
            this._appVersionName = appVersionName;
            this._appVersionCode = appVersionCode;
            this._appPackageName = appPackageName;
            this._appId = appId;
            
            _kvStore = new PlayerPreferenceKVStore();
            _clientId = _kvStore.Get(APP_CLIENT_ID_KEY);
            if (string.IsNullOrEmpty(_clientId))
            {
                _clientId = Guid.NewGuid().ToString();
                _kvStore.Put(APP_CLIENT_ID_KEY, _clientId);
            }
        }
Exemplo n.º 3
0
 public ApplicationSettings()
 {
     kvStore = new PlayerPreferenceKVStore();
 }