Android app update, getpurchases () returns nothing

I have an app published on Google Play with In-App Billing features, everything works fine until I upload the new version to the developer console.

If I download the updated google apk servers, it seems to have forgotten about the purchases I made.

If I don't update, everything works fine, Google returns the package with all the purchases I made, what's going on here?

//Service to establish a connection with google play
    mServiceConn = new ServiceConnection() {
        @Override
        public void onServiceDisconnected(ComponentName name) {
            mService = null;
        }

        @Override
        public void onServiceConnected(ComponentName name, IBinder service) {
            mService = IInAppBillingService.Stub.asInterface(service);
            new checkProVersion().execute();
        }
    };

    Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
    serviceIntent.setPackage("com.android.vending");
    bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);

//AsyncTask to check if Pro Version is purchased
class checkProVersion extends AsyncTask<Void, Void, Void> {

    @Override
    protected Void doInBackground(Void... params) {

        Bundle proBundle = new Bundle();

        try {
            proBundle = mService.getPurchases(3, getPackageName(), "inapp", null);
        } catch (RemoteException e) {
            e.printStackTrace();
        }

        int response = proBundle.getInt("RESPONSE_CODE");
        if (response == 0) {
            ArrayList<String> ownedSkus = proBundle.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
            ArrayList<String> purchaseDataList = proBundle.getStringArrayList("INAPP_PURCHASE_DATA_LIST");
            ArrayList<String> signatureList = proBundle.getStringArrayList("INAPP_DATA_SIGNATURE_LIST");

            if (purchaseDataList.size() > 0) {
                for (int i = 0; i < purchaseDataList.size(); i++) {
                    String purchaseData = purchaseDataList.get(i);
                    String signature = signatureList.get(i);
                    String sku = ownedSkus.get(i);

                    if (verifyPurchase(buildPublicKey(), purchaseData, signature)) {
                        if(sku.equals("name_of_the_sku")) {
                            buy_pro_btn.setVisibility(View.GONE);
                        }
                    }
                }
            }
        }

        return null;
    }
}

      

When I update my application PurchaseDataList.size () returns 0.

Thank!!

+3
android empty-list in-app-purchase


source to share


No one has answered this question yet

Check out similar questions:

3606
Close / hide Android soft keyboard
3295
Why is the Android emulator so slow? How can we speed up the development of an Android emulator?
3288
Correct use cases for Android UserManager.isUserAGoat ()?
2609
Is there a unique identifier for an Android device?
2510
How to persist android activity state by persisting instance state?
2097
Is there a way to run Python on Android?
1858
"Debug certificate expired" error in Android Eclipse plugins
1844
What is "Context" on Android?
4
Android: BatteryLevel widget not updating
-2
The activity can still call the unbind method. This is normal?



All Articles
Loading...
X
Show
Funny
Dev
Pics