Skip to content

Commit

Permalink
Fixed 2019 unity support
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Alekseev committed May 6, 2022
1 parent 547c5e5 commit 9fea053
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Assets/AnkrSDK/Scripts/OpenSea/OpenSeaAPIAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static class OpenSeaAPIAssets

private static string BaseURL => $"{(_isTestNet ? EndPoint : TestNetEndPoint)}{Version}";
private static string GetAssetsURL => $"{BaseURL}{GETAssets}";

private static readonly TimeSpan DelayTimeSpan = TimeSpan.FromSeconds(1f);

private static string GetSingleAssetURL(string contractAddress, string tokenId) =>
Expand Down Expand Up @@ -114,8 +114,11 @@ private static async UniTask<string> CallAPI(string uri, Dictionary<string, stri
}

await webRequest.SendWebRequest();

#if UNITY_2020_1_OR_NEWER
if (webRequest.result == UnityWebRequest.Result.Success)
#else
if(!webRequest.isHttpError && !webRequest.isNetworkError)
#endif
{
return webRequest.downloadHandler.text;
}
Expand Down

0 comments on commit 9fea053

Please sign in to comment.