edsnider / latestversionplugin

LatestVersion Plugin for Xamarin and Windows apps
MIT License
151 stars 38 forks source link

Im unable to get GetLatestVersionNumber of the play store. It is always showing empty or null #43

Closed RajuGadda closed 2 years ago

RajuGadda commented 2 years ago

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

Bug

Im unable to get GetLatestVersionNumber. It is always showing empty or null Plugin Version: 2.1.0 Platform (e.g., Android v21): Andriod 11 Device/Hardware:

Expected behavior

Actual behavior

Steps to reproduce the issue

Feature Request

Description:

ghost commented 2 years ago

I've got the same. The issue is that Google have changed the HTML that is returned from the API call, so when it scrapes for Current Version, it's null, so fails.

Tulesh99 commented 2 years ago

GetLatestVersionNumber return null values.

Jerome-Liger commented 2 years ago

What ? this plugin is just parsing GooglePlay website to try to find version ? this is really not a great design... I use this plugin in a lot of projects (and I didn't browse the source until yet... my fault), and all are currently raising error on each startup foreach user... cause of this plugin (and initialy cause of the Google website changes... but you will never be able to know the google changes on his website... never). So this plugin/architecture is useless by design ;-)

For Android, to correctly get the version, we have to use Xamarin.Google.Android.Play.Core and IAppUpdateManager...

Let me know if people are interested, I'll do a PR that use IAppUpdateManager (if I found some time available...)

Jerome-Liger commented 2 years ago

And for iOS, I think it'll be better to use AppStoreConnectAPI (better than itunesconnect website/request, wich needs region...). An API has an explicit version and will never change (theorically) for the same version. A Website... you don't kown, you can't know ;-)

https://developer.apple.com/documentation/appstoreconnectapi/list_all_app_store_versions_for_an_app

If I have all platform implementations to change, I'll surely not update this plugin with a PR... but do a new plugin on my name ;-)

marcelovargas commented 2 years ago

Me too. I have this problem.

gintriago91 commented 2 years ago

Hi! I have the same problem. Any answer to fix this problem?

Jerome-Liger commented 2 years ago

yes, idealy, "someone" have to create a plugin that is based on IAppUpdateManager (for Android) and AppstoreConnectAPI (for iOS).

But if you're really stucked, you can just create your own custom platform service implementation directly in your project :

1 - Based on the "dependency injection/IOC" fundamentals : https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/dependency-service/introduction

2a - Create the custom implementation on Android : https://developer.android.com/guide/playcore/in-app-updates/kotlin-java#java

2b - Create the custom implementation on iOS : https://developer.apple.com/documentation/appstoreconnectapi/list_all_app_store_versions_for_an_app

Or another (easier) solution is that maybe you can fork and update this plugin to find the version number on the "new GooglePlay website" ? (I even don't know if the version is anymore available anywhere on the current new website)... I do not recommand this approach (see my previous posts), but it may work again for some times (at least until Google change again it's website) with just few changes... all the logic of the "currently broken code" is here : https://github.com/edsnider/latestversionplugin/blob/master/src/LatestVersion.android.cs#L72

Note that nobody can "force" OSS developer to do this job or to complain about their contribution (even if it's outdated)... Every single OSS developer is doing it for free and for the community... community plugins are not products supported by companies.

But if you (or your company) have any budget to spend on this, I can develop the "ideal plugin" quickly, and professionnaly (on my company work hours with a french/€ invoice...) Sadly I don't have "personal OSS free time" at this moment... and on work hours it's customers first ! ;-)

wtheronjones commented 2 years ago

I am experiencing this one too. It appears the regex no matter matches the results returned by the play store URL.

Seems like a plan B Implementation is needed for Android.

taublast commented 2 years ago

Workaround https://stackoverflow.com/a/72643625/7149454

Jerome-Liger commented 2 years ago

Thanks @taublast for doing the most of the work, your workaround works great ! :-)

I've merge your code in the #44 PR... I hope @edsnider will accept & merge soon...

For those who can wait, I've made a temporary nuget package here... (No support and I'll delete it when PR will be merged !) https://www.nuget.org/packages/Xam.Plugin.LatestVersion.Forked/0.1.1

edsnider commented 2 years ago

Beta nuget is available here: https://www.nuget.org/packages/Xam.Plugin.LatestVersion/2.1.1-beta.107

Welchen commented 2 years ago

Beta nuget is available here: https://www.nuget.org/packages/Xam.Plugin.LatestVersion/2.1.1-beta.107

@edsnider I'm using this version and seeing the problem again.