Ejemplo n.º 1
0
        private string getBestUrl(GitHubRelease release)
        {
            GitHubAsset bestAsset = null;

            switch (RuntimeInfo.OS)
            {
            case RuntimeInfo.Platform.Windows:
                bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".exe", StringComparison.Ordinal));
                break;

            case RuntimeInfo.Platform.macOS:
                bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".app.zip", StringComparison.Ordinal));
                break;

            case RuntimeInfo.Platform.Linux:
                bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".AppImage", StringComparison.Ordinal));
                break;

            case RuntimeInfo.Platform.iOS:
                // iOS releases are available via testflight. this link seems to work well enough for now.
                // see https://stackoverflow.com/a/32960501
                return("itms-beta://beta.itunes.apple.com/v1/app/1447765923");

            case RuntimeInfo.Platform.Android:
                // on our testing device this causes the download to magically disappear.
                //bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".apk"));
                break;
            }

            return(bestAsset?.BrowserDownloadUrl ?? release.HtmlUrl);
        }
        private string getBestUrl(GitHubRelease release)
        {
            GitHubAsset bestAsset = null;

            switch (RuntimeInfo.OS)
            {
            case RuntimeInfo.Platform.Windows:
                bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".exe"));
                break;

            case RuntimeInfo.Platform.MacOsx:
                bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".app.zip"));
                break;

            case RuntimeInfo.Platform.Linux:
                bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".AppImage"));
                break;

            case RuntimeInfo.Platform.Android:
                // on our testing device this causes the download to magically disappear.
                //bestAsset = release.Assets?.Find(f => f.Name.EndsWith(".apk"));
                break;
            }

            return(bestAsset?.BrowserDownloadUrl ?? release.HtmlUrl);
        }