2

Introduction

I've deployed the first version of my app to the Play Store and now I'm going to change the version code and publish the next version. So, in general case, the Google Play will notify users about the update. But I want my app itself to check for the updates and take user to the Play Store.

Studies till now

I have read about the workaround , here , where the app checks for the latest version with your server but I don't want that.

Requirement

I just want my app itself to directly compare its version with version available on the Play Store, and if it is different, then prompt user to update the app. On confirmation, it will take the user to the Play Store.

Is there any way to achieve this?

Community
  • 1
  • 1
Sagar Nayak
  • 2,138
  • 2
  • 19
  • 52
  • Use GCM and push your new version and compare it with current running version – Amy Mar 14 '16 at 11:33
  • Use a push notification? – OneCricketeer Mar 14 '16 at 11:33
  • any brief example please ? – Sagar Nayak Mar 14 '16 at 11:34
  • 3
    Possible duplicate of [Programmatically check Play Store for app updates](http://stackoverflow.com/questions/25201349/programmatically-check-play-store-for-app-updates) – Pararth Mar 14 '16 at 11:35
  • i dont want to use method where you check for new version through checking version code from your server. – Sagar Nayak Mar 14 '16 at 11:39
  • there must be some way to directly check it from google play itself. – Sagar Nayak Mar 14 '16 at 11:39
  • Simple Method here is to check for the version of app on playstore when the application starts , if it is different from current version show the confirmation view and re-direct to playstore – Vihar Mar 14 '16 at 11:47
  • yup thats the theory and i know it. i am asking for some code .any api ? any sample ?? please .. – Sagar Nayak Mar 14 '16 at 11:48
  • Since there is no official api from Google to do this, I have trouble seeing why you reject the proposed solution of simply storing the version number of the latest version of your app somewhere on your own server, query it from your app, and compare it? If this is rejected because it sounds complex, well, it doesn't even have to be an api server, you could upload a static text file containing a single integer, if you can live with manually updating it whenever you deploy a new version. That is, if you really must do this at all, which I wouldn't recommend. – JHH Mar 14 '16 at 12:08
  • yes sir. what i get is i have to use my server anyhow. there is no other concrete way to get it compared through google play. – Sagar Nayak Mar 14 '16 at 12:13

3 Answers3

1

Is there any way to achieve this?

Probably, but I would not try to implement this if I were you and here is why.

Users configure update settings themselves through google play app settings.
If they want app updates right way they can say so. If they want to confirm first they can say so. If they don't want to be notified of updates at all, they can say so.

In most cases users are already notified of an update of your app through google play notifications. There is no need to add a 2nd notification. Even worse - users that don't want to be notified of updates will be annoyed when you notify them yourself. You want to avoid that.

Tim
  • 41,901
  • 18
  • 127
  • 145
  • yes , i agree. but for proper functionality of my application this is a must to update this as soon as possible. so the user might miss or ignore the google play notification to update the app. and therefore i want to explicitly give him/her an alert to do so. – Sagar Nayak Mar 14 '16 at 11:54
  • My thought exactly. Don't try to invent the wheel, it's already there. What you are trying to do will likely be quite intrusive. – JHH Mar 14 '16 at 11:55
  • 1
    @SagarNayak the notification from google play is already explicit, your extra notification won't be of much help – Tim Mar 14 '16 at 11:55
  • hey i was using this app some time before . https://play.google.com/store/apps/details?id=in.startv.hotstar&hl=en this gives a dialog to user if it the app version is different then app in play store. so how so it checks it ? i wander . is it through its own server or directly interacting with play store. – Sagar Nayak Mar 14 '16 at 12:03
  • 1
    How could we know how someone else does it, without downloading the apk and reverse engineering it and/or logging network traffic from it? Is it relevant? Your problem is easy to solve by having your own server return the latest version. – JHH Mar 14 '16 at 12:12
  • yup i think i have to use my own server. – Sagar Nayak Mar 14 '16 at 12:16
0

You will need a service call to

 https://androidquery.appspot.com/api/market?app=YourPackageNameOnPlaystore

for example:

https://androidquery.appspot.com/api/market?app=com.google.android.youtube

the respnse which will be returned by playstore will contain version information which is present on playstore.

compare it with local app version and take further steps

Hope this helps!

Good luck!

Vihar
  • 3,626
  • 2
  • 24
  • 47
  • Note that this is a proprietary 3rd party api, not an official Google api. When trying it now, the server wasn't even responding. I'm not sure I would rely on this. – JHH Mar 14 '16 at 12:02
  • yup buddy . me too . i was just trying it now and i din't get any response. – Sagar Nayak Mar 14 '16 at 12:09
0

Short answer: No. There is no such official API yet. But you can go for an unofficial one.

But still as you have mentioned you can go for your own API implementation and prompt the user to update the app. But take into consideration that users have their own preferences about updating the app and they may find such prompts annoying. @Tim Castelijns's answer explains it in detail.

Mangesh
  • 5,491
  • 5
  • 48
  • 71