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

Using promo code on Android returns null purchase #143

Closed
jamesmontemagno opened this issue Apr 24, 2018 · 3 comments
Closed

Using promo code on Android returns null purchase #143

jamesmontemagno opened this issue Apr 24, 2018 · 3 comments
Labels

Comments

@jamesmontemagno
Copy link
Owner

See #100 for reference.

@DevEddy
Copy link

DevEddy commented May 11, 2018

I've tested this with the nuget 1.4.1.157-beta. Same result.

const string PAYLOAD = "cloudmatic_app_payload_id";
public const string DESIGN = "app_design_id";
var purchase = await billing.PurchaseAsync(DESIGN, ItemType.InAppPurchase, PAYLOAD);

purchase is null when I use a promo code. But the purchase was successfull at the moment.

When I check the purchases with this, it's in the list of purchases.

var purchases = await billing.GetPurchasesAsync(ItemType.InAppPurchase);

Workaround

After purchasing is done with PurchaseAsync and purchase is null, check the purchase again with GetPurchasesAsync ;)

Google docs:

To support promotion codes, your app must call the queryPurchases() method whenever the app starts or resumes.

Also

Your Activity's onPurchasesUpdated() method receives a response intent identifying when a purchase is completed. However, your app should still call queryPurchases() in onStart() and onResume(), in the case the purchase and consumption workflow didn't complete. For example, if the user successfully redeems a promo code and then your app crashes before the item is consumed, your app still receives information about the purchase when the app calls queryPurchases() on its next startup.

Your app should also support the scenario where a user redeems a promo code in the Play Store app while the app is running. Your app can find out about the redemption through the onPurchasesUpdated() listener.

// EDDY

@chrisfoulds
Copy link

Also happens for test subscription purchases

@jamesmontemagno
Copy link
Owner Author

#268 dup

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

3 participants