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

restoreTransactions generates too many calls to onPurchaseStateChanged #66

Open
pfjborg opened this issue May 7, 2012 · 2 comments
Open

Comments

@pfjborg
Copy link

pfjborg commented May 7, 2012

I have a test installation of a working app with 3 purchases and 2 cancellations of the same managed item.

However, a call to restoreTransactions results in 10 calls to onPurchaseStateChanged: I get 4 purchase notices and 6 cancellation notices.

Billing debug shows 4 PURCHASE_STATE_CHANGED messages received from Play.

As this is a restoreTransactions test I am forced to use a non-debug signed version of the app so can't trace or break to see what's going on.

Any suggestions greatly appreciated...!

@pfjborg
Copy link
Author

pfjborg commented May 7, 2012

More information: I inserted as line 381 of BillingController a line to log product, state, notification ID and order ID.

It seems that the messages coming back from Play include results for more than one order.

Of the four messages sent by Play 1 contains a "purchased" response with a notification id of Null but a valid order ID, and the other 3 all contain details of all 3 orders, 2 cancelled and 1 purchased in each message. Each results in a call to "onPurchaseStateChanged". Is this intended behaviour?

@ludocrazy
Copy link

i'm new to using AndroidBillingLibrary and i may be mistaken, but are you aware of what the official google documentation says about the fact that NOTIFICATIONS can come multiple times and your code must be able to hand that fact. the docs give several examples.

http://developer.android.com/guide/google/play/billing/index.html

if i am right, and you simply missed a detail from the docs, then please close this issue! thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants