Ejemplo n.º 1
0
        public bool UpgradeAvailable(out Upgrade details, OnUpgradeAvailable onUpgrade)
        {
            var pars = new NameValueCollection() {
                { "action", "kyg_upgrade" },
                { "sky", SecretKey },
                { "product", Product },
                { "ver", Version },
                { "custom", Custom },
            };

            if (onUpgrade != null)
            {
                var kyw = HttpHelper.PostAsync(URL, pars, onUpgradeAvailableCompleteHandler);
                kyw.onUpgradeComplete = onUpgrade;
                webRequests.Add(kyw);
                details = null;
                return true;
            }

            var response = HttpHelper.Post(URL, pars);
            details = null;

            var str = System.Text.Encoding.Default.GetString(response);
            if (str != null && str.Equals("0")) return false; //Secret key might not match
            var outObject = JsonConvert.DeserializeObject<Upgrade>(str);
            if (outObject.valid == "TRUE")
            {
                details = outObject;
                return true;
            }
            //If this value is false then the user never registered, caller show try to re-register the client
            return false;
        }
Ejemplo n.º 2
0
 public bool UpgradeAvailable(OnUpgradeAvailable onUpgrade)
 {
     Upgrade upg = null;
     return UpgradeAvailable(out upg, onUpgrade);
 }