iappmaker
iappmaker

Reputation: 3005

How to check the Google Play store app version

I am trying out the In-App Billing V3 from Google play. In the document below mentioned guidelines were given. I am not sure how to use the method isBillingSupported. Could you point me to any sample code.

enter image description here

enter image description here

Upvotes: 1

Views: 5861

Answers (1)

peguerosdc
peguerosdc

Reputation: 964

You can check the version of the GooglePlayStore app in your device like this:

PackageManager mPm = getPackageManager();
try{
    PackageInfo info = mPm.getPackageInfo("com.android.vending", PackageManager.GET_META_DATA);
    int versionCode = info.versionCode;
    String versionName = info.versionName;
}
catch( PackageManager.NameNotFoundException e) {
    // Play Store not installed
}

I don't know how to send the isBillingSupported request, but I found this example on GitHub. I think it is what you are looking for.

Upvotes: 1

Related Questions