question

Dhiren avatar image
Dhiren asked

In-app purchase Need Help : Consumable & Entitlement in same app

Hi, this is my first game on Amazon. I successfully implemented Consumable in-app which is working perfectly fine. Now I am trying to implement both Consumable & Entitlement in same app but not able to do it. I followed the examples which are there along with SDK but those are single in-app type example. How can I do it if I have more then one type of Items? I tried changing MySKU.java to add multiple items but end up with many errors. Please guide me. Thanks.
iap
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Milenine, You could have different Enums to describe consumable and entitlement. You can copy MySKU.java from SampleIAPConsumablesApp and SampleIAPEntitlementsApp in to your project and name them as ConsumableSKU and EntitlementSKU respectively. Note that there is a notion of quantity associated with ConsumableSKU, but not with EntitlementSKU. For example, public enum EntitlementSKU { LEVEL1("com.amazon.sample.iap.entitlement.level1"); LEVEL2("com.amazon.sample.iap.entitlement.level2"); } public enum ConsumableSKU { ORANGE("com.amazon.sample.iap.consumable.orange", 1); APPLE("com.amazon.sample.iap.consumable.apple", 1); }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.