Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private static void GetLatestEdExVersion()

if (DateTime.Today > threshold)
{
PlayFabEditorHttp.MakeGitHubApiCall("https://api.github.com/repos/PlayFab/UnitySDK/git/refs/tags", (version) =>
PlayFabEditorHttp.MakeGitHubApiCall("https://api.github.com/repos/PlayFab/UnitySDK/releases/latest", (version) =>
{
latestEdExVersion = version ?? "Unknown";
PlayFabEditorPrefsSO.Instance.EdSet_latestEdExVersion = latestEdExVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ private static void GetLatestSdkVersion()

if (DateTime.Today > threshold)
{
PlayFabEditorHttp.MakeGitHubApiCall("https://api.github.com/repos/PlayFab/UnitySDK/git/refs/tags", (version) =>
PlayFabEditorHttp.MakeGitHubApiCall("https://api.github.com/repos/PlayFab/UnitySDK/releases/latest", (version) =>
{
latestSdkVersion = version ?? "Unknown";
PlayFabEditorPrefsSO.Instance.EdSet_latestSdkVersion = latestSdkVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,15 @@ private static void OnGitHubSuccess(Action<string> resultCallback, string respon
if (resultCallback == null)
return;

var jsonResponse = JsonWrapper.DeserializeObject<List<object>>(response);
if (jsonResponse == null || jsonResponse.Count == 0)
var jsonResponse = JsonWrapper.DeserializeObject<JsonObject>(response);
if (jsonResponse == null)
return;

// list seems to come back in ascending order (oldest -> newest)
var latestSdkTag = (JsonObject)jsonResponse[jsonResponse.Count - 1];
// The /releases/latest endpoint returns a single object with a "tag_name" field
object tag;
if (latestSdkTag.TryGetValue("ref", out tag))
if (jsonResponse.TryGetValue("tag_name", out tag) && tag != null)
{
var startIndex = tag.ToString().LastIndexOf('/') + 1;
var length = tag.ToString().Length - startIndex;
resultCallback(tag.ToString().Substring(startIndex, length));
resultCallback(tag.ToString());
}
else
{
Expand Down