在Ionic 2中获得Play商店应用版本 [英] get play store app version in Ionic 2

查看:71
本文介绍了在Ionic 2中获得Play商店应用版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查我在playstore上载的应用程序版本,以进行强制更新.我应该怎么办 ?我试图达到http请求,但出现cors问题,它将在html中给出结果.我尝试了api调用

I want to check app version which i have uploaded on playstore for force update. What should i do ? I tried to hit http request but getting cors issue and it will give result in html . I tried following api call

this.http.get("https://play.google.com/store/apps/details?id=com.moglix.vendor").subscribe(data => {警报(数据);});

我检查了其他解决方案,例如如何获取应用程序版本游戏商店对我不起作用.

I checked other solution like How get the app version on the play store it is not working for me.

我可以使用rest api,但是我只想研究play store中的任何功能.

I have alternative of rest api but i want to look into any functionality from play store only .

推荐答案

使用JQuery,您可以在与ionicjs项目结合的ionic1中使用它:

Using JQuery you can use it in your ionic1 with angularjs projects:

$.get("https://play.google.com/store/apps/details?id=--bundleID--", function(data){
            htmlContentsArray=$('<div/>').html(data).contents();
            htmlContents=htmlContentsArray['prevObject']['0']['childNodes']['141'].outerText;
            if(htmlContents == ''){
                htmlContents=htmlContentsArray['prevObject']['0']['childNodes']['144'].outerText;
            }
            latest_version_array=htmlContents.split('Current Version');
                var latest_version_string=latest_version_array['1'];
                var latest_version=latest_version_string.substr(0,5);
});

这篇关于在Ionic 2中获得Play商店应用版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆