Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement - Retrieve release notes from App Stores #24

Open
tbaggett opened this issue Mar 12, 2020 · 2 comments
Open

Enhancement - Retrieve release notes from App Stores #24

tbaggett opened this issue Mar 12, 2020 · 2 comments

Comments

@tbaggett
Copy link

If this issue is for a new feature, please skip the "Bug" section and fill out the "Feature Request" section at the bottom.

Feature Request

Description: In addition to retrieving the app's version number, add functionality to retrieve the app's release notes.

I've downloaded the source and added support for this to Android and iOS but I don't develop UWP apps. Here's what I came up with that works well with our app's release notes formatting:

Interface addition:

Task<string> GetLatestReleaseNotes();

Android release notes retrieval:

var content = responseMsg.Content == null ? null : await responseMsg.Content.ReadAsStringAsync();

var versionMatch = Regex.Match(content, "<div[^>]*>Current Version</div><span[^>]*><div[^>]*><span[^>]*>(.*?)<").Groups[1];

if (versionMatch.Success)
{
	version = versionMatch.Value.Trim();
}

var releaseNotesMatch = Regex.Match(content, "<h2[^>]*>What&#39;s New</h2>.*<div.*itemprop=\"description\"[^>]*><span([^>]*>)(.+?)</span>").Groups[2];

if (releaseNotesMatch.Success)
{
	var newLines = Environment.NewLine + Environment.NewLine;
	releaseNotes = releaseNotesMatch.Value.Trim().Replace("<br><br>", newLines).Replace("<br>", newLines);
}

iOS release notes retrieval:

var http = new HttpClient();
var response = await http.GetAsync($"http://itunes.apple.com/lookup?bundleId={_bundleIdentifier}");
var content = response.Content == null ? null : await response.Content.ReadAsStringAsync();
var appLookup = JsonValue.Parse(content);

var newLines = Environment.NewLine + Environment.NewLine;

return new App
{
	Version = appLookup["results"][0]["version"],
	Url = appLookup["results"][0]["trackViewUrl"],
	// Convert single line returns to double line returns without changing existing double line returns
	ReleaseNotes = ((string)(appLookup["results"][0]["releaseNotes"])).Replace("\n\n", "<br>").Replace("\n", newLines).Replace("<br>", newLines)
};
@Jakar510
Copy link

I want this as well.

@thomasgalliker
Copy link

Any progress here? I'll create another nuget if we stuck here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants