Beispiel #1
0
 private bool ValidateApiKey()
 {
     if (string.IsNullOrEmpty(_apiKey))
     {
         RaygunClient.Log("ApiKey has not been provided, exception will not be logged");
         return(false);
     }
     return(true);
 }
Beispiel #2
0
 private void SendMessage(string message)
 {
     try
     {
         byte[] data = StringToAscii(message);
         Dictionary <string, string> headers = new Dictionary <string, string>();
         headers["X-ApiKey"] = _apiKey;
         new WWW(new Uri("https://api.raygun.io/entries").AbsoluteUri, data, headers);
     }
     catch (Exception ex)
     {
         RaygunClient.Log(string.Format("Error Logging Exception to Raygun.io {0}", ex.Message));
     }
 }
Beispiel #3
0
        private void SendMessage(string message)
        {
            try
            {
                var request             = UnityEngine.Networking.UnityWebRequest.Post("https://api.raygun.com/entries", message);
                var customUploadHandler = new UnityEngine.Networking.UploadHandlerRaw(System.Text.Encoding.UTF8.GetBytes(message));
                customUploadHandler.contentType = "application/json";
                request.uploadHandler           = customUploadHandler;

                request.SetRequestHeader("X-ApiKey", _apiKey);

                request.SendWebRequest();
            }
            catch (Exception ex)
            {
                RaygunClient.Log(string.Format("Error Logging Exception to Raygun {0}", ex.Message));
            }
        }