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

market crashes on restoreTransactions #51

Open
larsa71 opened this issue Nov 8, 2011 · 0 comments
Open

market crashes on restoreTransactions #51

larsa71 opened this issue Nov 8, 2011 · 0 comments

Comments

@larsa71
Copy link

larsa71 commented Nov 8, 2011

Hi,

I don't think that the closed issue#37 is correctly fixed, looking at the code I think it might be something wrong in the case for manual confirmations:

What I have seen from my testing, restore transactions do not always provide a notification id. Hence, it should not internally in the BillingController be added to the manual confirmation array at all?

So a suggestion instead of this:

public static void onSignatureValidateResult(Context context, String signedData, String signature, boolean validationSuccessful) {
.

.


for (Transaction p : purchases) {

if (p.notificationId != null && automaticConfirmations.contains(p.productId)) {

confirmations.add(p.notificationId);

} else {

// TODO: Discriminate between purchases, cancellations and
//
refunds.
addManualConfirmation(p.productId, p.notificationId);

}

storeTransaction(context, p);

notifyPurchaseStateChange(p.productId, p.purchaseState);

}

.

.

It could be something like this and in the notifyPurchaseStateChange callback the BillingController.confirmNotifications call would not matter in this case as it will not find the item in the manual confirmation list:

public static void onSignatureValidateResult(Context context, String signedData, String signature, boolean validationSuccessful) {
.

.
for (Transaction p : purchases) {
if (p.notificationId != null) {
if (automaticConfirmations.contains(p.productId)) {
confirmations.add(p.notificationId);
} else {
// TODO: Discriminate between purchases, cancellations and
// refunds.
addManualConfirmation(p.productId, p.notificationId);
}
}

    storeTransaction(context, p);
    notifyPurchaseStateChange(p.productId, p.purchaseState);
}

.
.
.

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

1 participant