0

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 => { alert(data); });

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

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

Anuj
  • 640
  • 7
  • 26

2 Answers2

0

Please take a look at this plugin: Ionic Native App Update Plugin

Using this plugin, you're able to check if an update is available for your application. Note: This requires a back-end to store the app version information, and should be updated simultaneously with your APK.

JoeriShoeby
  • 1,374
  • 10
  • 15
  • But in that we will create api to put app version which will check everytime for compare right ? – Anuj Nov 02 '17 at 11:37
  • It is, as I noted. – JoeriShoeby Nov 04 '17 at 18:39
  • hmm thanks but i get one link api http://carreto.pt/tools/android-store-version/?package= . here we put package name and it will give json – Anuj Nov 04 '17 at 18:43
  • and actually my api developer was not ready to create an api for this . if he was ready then i can easily do this , thanks for help ! – Anuj Nov 04 '17 at 18:44
0

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);
});
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68