Closed Yohandah closed 6 years ago
same issue here :s
hmmmm, i am not sure how that works with a promo code works.
What is the ConsumptionState of the original purchase?
You should also really use: ConsumePurchaseAsync(string productId, string purchaseToken)
It is the only reliable method here.. and you HAVE THE TOKEN! Use it! Else I just try to find the first one in the list.
I could probably check the state for not consumed as an optimization.
@jamesmontemagno The ConsumptionState of the original purchase was NotYetConsumed, but using ConsumePurchaseAsync(string productId, string purchaseToken) is working !
On the other hand, PurchaseAsync(productId, ItemType.InAppPurchase, "payload") returns null when using a promo code .. :s using a credit card is ok
@meepou so ConsumePurchaseAsync worka for both promocode and other payment methods? can we safely call it instead of PurchaseAsync? actually PurchaseAsync also works but return object is just null but when I check with GetPurchasesAsync, i can see that it is in the list.
This makes no sense. I just went through the code and ConsumePurchaseAsync just just checkes if you have purchase and uses the token from the found purchase token. even in another case, I need promotion code to be working for non-consumable products. ConsumePurcahseAsync only works for consumables I believe. how can we resolve this please?
normal purchaseasync should work just fine I think. Else would need to debug through
It is unfortunately not working. i mean that purchase is working but result from purchaseasync is always null. it could be some serialization problem in the application. I recognized that although i am passing payload for that action, when using redeem code, response has no payload but same purchase with credit card has payload. I wanted to debug attaching source code on my .net standard 2.0.2 project but i am getting error for current activity plugin is not recognized somehow. i will try with a fresh project. please let me know if you can test it faster :)
are you passing it a "" payload? i just fixed a bug that was returning null here. Update to the latest beta if that is the case or pass it a payload, which is best practice.
hmmm the Id is null?
Please comment: https://github.com/jamesmontemagno/InAppBillingPlugin/issues/143
Version Number of Plugin: Last Device Tested On: Samsung Galaxy S8 Oreo Simulator Tested On: Version of VS: Last Version of Xamarin: Last Versions of other things you are using:
Steps to reproduce the Behavior
Create a product and create a promotion code, redeem the code in the app, purchase returns null and consume also for this productId
Expected Behavior
It should not return null
Actual Behavior
It returns null
Code snippet
Screenshotst