Пример #1
0
        public IEnumerator GetPointerByContent(ContentVO content)
        {
            //'https://popping-fire-7321.firebaseio.com/pointer.json?orderBy="content"&equalTo="-KAGMywVBTFkPIHQNzL9"&print=pretty'
            string            url = "pointer.json?orderBy=\"content\"&equalTo=\"" + content.key + "\"";
            CoroutineWithData cd  = new CoroutineWithData(this, myFirebase.GET(url));

            yield return(cd.coroutine);

            PointerVO pointer = customDeserializer.deserializeToPointer(cd.result.ToString());

            Debug.Log("Pointer from Content: " + pointer.content_id);
            yield return(pointer);
        }
Пример #2
0
        public List <ContentVO> deserializeToListContent(string response)
        {
            IDictionary      search   = Json.Deserialize(response) as IDictionary;
            List <ContentVO> contents = new List <ContentVO>();

            foreach (var key in search.Keys)
            {
                IDictionary temp    = (IDictionary)search[key];
                ContentVO   content = new ContentVO();
                content.key         = key.ToString();
                content.name        = temp["name"].ToString();
                content.description = temp["description"].ToString();
                content.content     = temp["content"].ToString();
                content.subject_id  = temp["subject"].ToString();
                contents.Add(content);
                Debug.Log("Content: " + content.name);
            }
            return(contents);
        }