user2914699
user2914699

Reputation: 265

How can I set the notification in android application to update next version

I have upload apk with version 1.0.0.0. I want to upload next version 1.0.0.1.how can I set the notification to inform the user that my application has a newer version available on Google play. Can any one suggest me how to do it?

Upvotes: 0

Views: 49

Answers (3)

rbashish
rbashish

Reputation: 2153

For that you have to configure something called Firebase Cloud Messaging and enable notification. Here is the complete guide on how to.

Upvotes: 0

scottt
scottt

Reputation: 8371

I understand your question to be "How does one determine if the play store has a newer version than the one installed".

I don't know of an official way to lookup an app's version in the Play Store. The most common solution I've seen for this requirement is to host the version number on a server somewhere and do a web request to get it.

There's a library at https://code.google.com/p/android-market-api/ that purports to do the Play Store lookup, (among other things) but I don't have any experience with it.

Upvotes: 0

Andynedine
Andynedine

Reputation: 441

Found in stackoverflow (duplicated??)

public int getVersion() {
    int v = 0;
    try {
        v = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
    } catch (NameNotFoundException e) {
        // Huh? Really?
    }
    return v;
}

Upvotes: 1

Related Questions