Ejemplo n.º 1
0
        private IEnumerator UpdateToursService()
        {
            yield return(new WaitForSeconds(1f));

            JSONObject json;

            using (var sqlite = new SQLiteService())
            {
                json = sqlite.DataSynchronization();
            }

            WWWForm form = new WWWForm();

            form.AddField("id", FB.UserId);
            form.AddField("usuarioTourList", json.GetField("UsuarioTourList").ToString());
            form.AddField("usuarioLocalizacionList", json.GetField("UsuarioLocalizacionList").ToString());

            yield return(WebService.POST(
                             SERVER_URL + "/tour/updateSubscriber",
                             form,
                             (status, response) =>
            {
                if (status)
                {
                    Debug.Log("Peticion updateSubscriber -> " + response);

                    json = new JSONObject(response);

                    //Hacer un update a la base de datos
                    //using (var sqlService = new SQLiteService())
                    //{
                    //    sqlService.UpdateTours(json);
                    //}
                }
            }
                             ));

            if (!IsEnterToUpdateTours)
            {
                StartCoroutine(CountDown(600, value => IsEnterToUpdateTours = value));
                yield return(new WaitForSeconds(0.5f));
            }
        }