问题描述
对于强制更新,我曾经调用应用程序url并检查html标记值< softwareVersion>< softwareVersion />
,但突然它停止在那里工作在页面中没有softwareVersion标签,因此变为null。是否有任何谷歌API可用来检查谷歌播放应用程序版本。
更新 -
详细信息当我用来调用url的响应是200,但现在我得到405
可能,在3月底,Google改变了Play商店的HTML代码。其他信息的结构也发生了变化。
包括我在内,使用Jsoup检查Play商店中的最新版本。也许您使用的代码如下所示:
Document doc = Jsoup.connect
(https://play.google.com/store/apps/details?id=name.package.your) 。得到();
Elements Version = doc.select(。content);
for(Element v:Version){
if(v.attr(itemprop)。equals(softwareVersion)){
VersionMarket = v.text();
$ b 但是,在存储改变后,你的代码返回null 。
因为itemprop和sofrwareVersion不见了,就像那样。
所以,你需要一种新的方式来解析您的应用在Google Play商店的附加信息中使用Jsoup的版本。 try {
Document doc = Jsoup
.connect(
https://play.google.com/store/apps/details?id=name.package.your)
.get();
元素版本= doc.select(。htlgb);
for(int i = 0; i VersionMarket = Version.get(i).text(); $ {$ b $ if(Pattern.matches(^ [0-9] {1}。[0-9] {1}。[0-9] {1} $,VersionMarket)){
break ;
以上代码的工作原理如下。
- 解析游戏商店的应用程序页面。 选择所有htlgb内容。
- 类似于图片,2018年3月3日,1,000+2.0.4,4.4及以上等。
在[for循环]中,[正则表达式]会找到一个与您的版本模式相匹配的值(如2.0.4)并停止。 >
- VersionMarket是您的应用版本,您可以使用它。
For force update I used to call the app url and check the for the html tag value <softwareVersion><softwareVersion/>
but suddenly it stopped working there is no softwareVersion tag in the page so getting null. Is there any google api available to check the google play app version.
Update -
I investigate in more details when I used to call the url the response was 200 but now I am getting 405
解决方案 Maybe, at the end of march, Google changed Play store's HTML Code.
The structure of additional information has also changed.
Some developers, including me, use Jsoup to check for the latest version in the Play Store.
Perhaps you were using code like this:
Document doc = Jsoup.connect
("https://play.google.com/store/apps/details?id=name.package.your").get();
Elements Version = doc.select(".content");
for (Element v : Version) {
if (v.attr("itemprop").equals("softwareVersion")) {
VersionMarket = v.text();
}
}
but, after play store's change, your code return null.
because, "itemprop" and "sofrwareVersion" is gone, like that.
So, you need a new way to parse the version of your app in Google Play store's ADDITION INFORMATION with Jsoup.
try {
Document doc = Jsoup
.connect(
"https://play.google.com/store/apps/details?id=name.package.your")
.get();
Elements Version = doc.select(".htlgb ");
for (int i = 0; i < 5 ; i++) {
VersionMarket = Version.get(i).text();
if (Pattern.matches("^[0-9]{1}.[0-9]{1}.[0-9]{1}$", VersionMarket)) {
break;
}
}
The above code works as follows.
- Parsing play store's your app page.
Selecting all "htlgb" contents.
- like in image, "3 March 2018", "1,000+" "2.0.4", "4.4 and up, etc."
In [for Loop], [Regex] finds a value matching your version pattern (like 2.0.4) and stops.
- VersionMarket is your "app version" and you can use it.
这篇关于Google playstore应用版本检查不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!