Exemplo n.º 1
0
        private static IEnumerator _apiCallStringCollection(string uri, DelegateStringAnswer delegateSearch)
        {
            WWW www = new WWW(TenorAPIUri + uri);

            yield return(www);

            if (www.error == "" || www.error == null)
            {
                ResultStringCollection data = JsonUtility.FromJson <ResultStringCollection>(www.text);
                if (delegateSearch != null)
                {
                    delegateSearch(data);
                }
            }
            else
            {
                throw new Exception(www.error);
            }
        }
Exemplo n.º 2
0
 // Method to call API End Point: Auto Complete https://tenor.com/gifapi#autocomplete
 public static IEnumerator AutoComplete(AutoCompleteRequest request, DelegateStringAnswer delegateAutoComplete)
 {
     return(_apiCallStringCollection(request.getQueryString(key), delegateAutoComplete));
 }
Exemplo n.º 3
0
 // Method to call API End Point: Register Share https://tenor.com/gifapi#registershare
 public static IEnumerator RegisterShare(RegisterShareRequest request, DelegateStringAnswer delegateRegisterShare)
 {
     return(_apiCallStringCollection(request.getQueryString(key), delegateRegisterShare));
 }
Exemplo n.º 4
0
 // Method to call API End Point: Search Suggestions https://tenor.com/gifapi#suggestions
 public static IEnumerator SearchSuggestions(SearchSuggestionsRequest request, DelegateStringAnswer delegateSearchSuggestions)
 {
     return(_apiCallStringCollection(request.getQueryString(key), delegateSearchSuggestions));
 }
Exemplo n.º 5
0
 // Method to call API End Point: Hourly Trending https://tenor.com/gifapi#hourly-trending
 public static IEnumerator HourlyTrending(HourlyTrendingRequest request, DelegateStringAnswer delegateHourlyTrending)
 {
     return(_apiCallStringCollection(request.getQueryString(key), delegateHourlyTrending));
 }