Beispiel #1
0
        /// <summary>
        /// Send multiple events data to Atom server.
        /// </summary>
        /// <param name="stream">
        /// <see cref="string"/> for name of stream
        /// </param>
        /// <param name="data">
        /// <see cref="string"/> for request data
        /// </param>
        /// <param name="method">
        /// <see cref="HttpMethod"/> for type of request
        /// </param>
        /// <param name="callback">
        /// <see cref="string"/> for reponse data
        /// </param>
        /// <param name="parrentGameObject">
        /// <see cref="GameObject"/> for callback calling
        /// </param>
        public void PutEvents(string stream, List <string> data, string callback = null,
                              GameObject parentGameObject = null)
        {
            string json = IronSourceAtomUtils.ListToJson(data);

            PutEvents(stream, json, callback, parentGameObject);
        }
Beispiel #2
0
        /// <summary>
        /// GET request to server
        /// </summary>
        public IEnumerator Get()
        {
            string url = url_ + "?data=" + IronSourceAtomUtils.Base64Encode(data_);

            PrintLog("Request URL: " + url);

            WWW www = new WWW(url, null, headers_);

            yield return(www);

            ReadResponse(www);
        }
Beispiel #3
0
        /// <summary>
        /// Create request json data
        /// </summary>
        /// <returns>The request data.</returns>
        /// <param name="stream">
        /// <see cref="string"/> for request stream
        /// </param>
        /// <param name="data">
        /// <see cref="string"/> for request data
        /// </param>
        protected string GetRequestData(string stream, string data)
        {
            string hash = IronSourceAtomUtils.EncodeHmac(data, Encoding.ASCII.GetBytes(authKey_));

            var eventObject = new Dictionary <string, string>();

            eventObject ["table"] = stream;
            eventObject["data"]   = IronSourceAtomUtils.EscapeStringValue(data);
            eventObject["auth"]   = hash;
            string jsonEvent = IronSourceAtomUtils.DictionaryToJson(eventObject);

            printLog("Request body: " + jsonEvent);

            return(jsonEvent);
        }
Beispiel #4
0
        /// <summary>
        /// Send multiple events data to Atom server.
        /// </summary>
        /// <param name="stream">
        /// <see cref="string"/> for name of stream
        /// </param>
        /// <param name="data">
        /// <see cref="string"/> for request data
        /// </param>
        /// <param name="method">
        /// <see cref="HttpMethod"/> for type of request
        /// </param>
        /// <param name="callback">
        /// <see cref="Action<Response>"/> for reponse data
        /// </param>
        public void PutEvents(string stream, List <string> data, Action <Response> callback = null)
        {
            string json = IronSourceAtomUtils.ListToJson(data);

            PutEvents(stream, json, callback);
        }
Beispiel #5
0
 /// <summary>
 /// Gets the string data.
 /// </summary>
 /// <returns>
 /// The string data.
 /// </returns>
 public string GetStringData()
 {
     return(IronSourceAtomUtils.ListToJson(bulkData_));
 }