Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Purchased Failed Notifications #82

Closed
kenyu73 opened this issue Jul 30, 2012 · 3 comments
Closed

Purchased Failed Notifications #82

kenyu73 opened this issue Jul 30, 2012 · 3 comments
Labels

Comments

@kenyu73
Copy link

kenyu73 commented Jul 30, 2012

Problem: If an in-app purchase fails or an order is cancelled/refunded, there is a recurring "Purchased Failed" error in the notification bar. Even if the user fixed the credit card and purchases it successfully, this notification still occurs even though the billing code does get the final PURCHASED id. This occurs over and over again it appears. The only fix is to remove the app for good.

This appears reproducible.

  1. Purchase in-app item
  2. Cancel item
  3. Reboot device (being out of data service for an extended time can do this too)
  4. Note Purchased Failed notification shortly after reboot.

I know that the full purchase history for an app is piped through the code. Is it the Market that generates this notification or the BillingLibrary? Can it be fixed or is this a Play Store issue?

Similar to #49

@hpique
Copy link
Member

hpique commented Jul 30, 2012

I believe the problem here is that you need to manually confirm the cancel/refund notification. See also #28.

@kenyu73
Copy link
Author

kenyu73 commented Jul 30, 2012

Looks like this is the fix!

BillingController.confirmNotifications(this, itemId);

@Override
public void onPurchaseStateChanged(String itemId, PurchaseState state) {
    Log.d(TAG, "AbstractBillingLibrary::onPurchaseStateChanged(): " + itemId + ":" + state);

    SharedPreferences prefs = getPreferences(Context.MODE_PRIVATE);
    SharedPreferences.Editor edit = prefs.edit();

    if (state == PurchaseState.PURCHASED) {
        edit.putBoolean(itemId, true);
        makePremiumView();
    } else {
        BillingController.confirmNotifications(this, itemId);
        edit.putBoolean(itemId, false);
    }

    edit.commit();
}

@hpique
Copy link
Member

hpique commented Jul 30, 2012

Yes, that should work. We will add auto-confirmations for cancellations and refunds in a future update.

@hpique hpique closed this as completed Jul 30, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants