latestversionplugin icon indicating copy to clipboard operation
latestversionplugin copied to clipboard

fix to get android latest version #47

Open markmcavoy opened this issue 2 years ago • 3 comments

Fixes #47

Changes proposed in this pull request:

Simple change to get the correct script from the html page to then get the version number for Android devices

markmcavoy avatar Sep 01 '22 23:09 markmcavoy

@edsnider @Jerome-Liger can you merge this one please so no clone nuget is needed again ?

gsgou avatar Sep 13 '22 07:09 gsgou

@markmcavoy did you created by chance any package such as nuget with this PR for personal use? If not i ll create a new project that will address abandoned PRs and issues as this one.

gsgou avatar Sep 19 '22 13:09 gsgou

@markmcavoy did you created by chance any package such as nuget with this PR for personal use? If not i ll create a new project that will address abandoned PRs and issues as this one.

@gsgou no we just did a build locally and referenced the DLLs in our project. I was hoping that by the time our project is released this project would have accepted the pull request and generated a new nuget package which we could just reference and move forward with.

markmcavoy avatar Sep 19 '22 15:09 markmcavoy

@edsnider @Jerome-Liger can you merge this one so no fork or clone nuget is needed again ?

gsgou avatar Oct 14 '22 13:10 gsgou

@edsnider @Jerome-Liger can you merge this one so no fork or clone nuget is needed again ?

Merged.

edsnider avatar Oct 14 '22 17:10 edsnider

Everybody here is a developer and appreciates you time and effort you put. Seems like the Google Play Store changes settle down and this fix works for a while. @edsnider can you upload also a new beta nuget too with this change. Tks a lot.

gsgou avatar Oct 15 '22 14:10 gsgou

@Jerome-Liger could you take in your "Xam.Plugin.LatestVersion.Forked" this change please? Else i will have to create "Xam.Plugin.LatestVersion.Forked2".

gsgou avatar Oct 21 '22 10:10 gsgou

I'm getting error call IsUsingLatestVersion() even using the beta version

cesarmenchao avatar Oct 26 '22 20:10 cesarmenchao

The PR is merged but there is no new package published.

gsgou avatar Oct 26 '22 20:10 gsgou

Do you have a date on when the package will come out?

cesarmenchao avatar Oct 26 '22 21:10 cesarmenchao

did any version come out?

cesarmenchao avatar Oct 31 '22 18:10 cesarmenchao

Any update on when a [beta] NuGet package will be available with this fix?

idenardi avatar Nov 09 '22 19:11 idenardi

hi any update on that fix? @Jerome-Liger @edsnider thanks

grounch avatar Dec 15 '22 16:12 grounch

Sorry, I'm really busy these days... I didn't look at the Google website changes... I'll try to take a look this WE... And maybe if I have enough time, I'll try to use a better approach (with GooglePlay API better than scrolling the website that can change any time again...). This may be my next "ChatGPT" pair-programming test ;-)

Jerome-Liger avatar Dec 16 '22 09:12 Jerome-Liger

But if you're too much impatient, just ask ChatGPT "show me C# code sample to get any published application versioncode and versionname from the packagename with Google Play API... it will answer in just couples of seconds (I'm so impressed... GooglePlay API documentation is so big/unreadable/awfull to search for a human...) :

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace GooglePlayAPIExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            string apiKey = "YOUR_API_KEY";
            string packageName = "com.example.app";

            HttpClient client = new HttpClient();
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
            HttpResponseMessage response = await client.GetAsync($"https://www.googleapis.com/androidpublisher/v3/applications/{packageName}");

            if (response.IsSuccessStatusCode)
            {
                string responseJson = await response.Content.ReadAsStringAsync();
                Console.WriteLine(responseJson);
            }
            else
            {
                Console.WriteLine($"Erreur : {response.StatusCode} - {response.ReasonPhrase}");
            }
        }
    }
}

And it can guide you to obtain the Apikey or whatever you didn't undertand in the process... if you didn't test ChatGPT, just think about it seriously... ;-)

Jerome-Liger avatar Dec 16 '22 16:12 Jerome-Liger

But if you're too much impatient, just ask ChatGPT "show me C# code sample to get any published application versioncode and versionname from the packagename with Google Play API... it will answer in just couples of seconds (I'm so impressed... GooglePlay API documentation is so big/unreadable/awfull to search for a human...) :

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

namespace GooglePlayAPIExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            string apiKey = "YOUR_API_KEY";
            string packageName = "com.example.app";

            HttpClient client = new HttpClient();
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
            HttpResponseMessage response = await client.GetAsync($"https://www.googleapis.com/androidpublisher/v3/applications/{packageName}");

            if (response.IsSuccessStatusCode)
            {
                string responseJson = await response.Content.ReadAsStringAsync();
                Console.WriteLine(responseJson);
            }
            else
            {
                Console.WriteLine($"Erreur : {response.StatusCode} - {response.ReasonPhrase}");
            }
        }
    }
}

And it can guide you to obtain the Apikey or whatever you didn't undertand in the process... if you didn't test ChatGPT, just think about it seriously... ;-)

@Jerome-Liger sorry but that's not working. It seems that is not possible to get the latest version of an app using the Google Play API. I have described a workaround in: https://github.com/edsnider/latestversionplugin/issues/50#issuecomment-1485006507

ivgomezarnedo avatar Mar 27 '23 11:03 ivgomezarnedo