question

pitup3 avatar image
pitup3 asked

inapp product price

how to get inApp product price corresponding to country code
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.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Pitup3, Thank you for writing to us. I think you meant currency by "country code". https://images-na.ssl-images-amazon.com/images/G/01/mobile-apps/devportal2/content/sdk/iap/javadoc-v103/com/amazon/inapp/purchasing/Item.html#getPrice%28%29 public java.lang.String getPrice() Returns the localized price of the item as a String. The price will include the currency symbol and be formatted appropriately based on the locale, i.e. in US $X.YZ and in France X,YZ€. Note that in the case of a subscription parent item, this value will be null. Please note this would be true when your app is live (i.e the app is not using SDK Tester to get IAP items)
10 |5000

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

pitup3 avatar image
pitup3 answered
thanx @ sujoy but how to use getprice(), i am using the sample code i.e SampleIAPEntitlementsApp, in that i am not able to get the purchased price of inApp, please suggest some refrence code or example to it,
10 |5000

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

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Pitup3, Thank you for writing back. You can certainly track the price of a purchased item with the currently available SDK. I have modified the MainActivity of the SampleIAPEntitlementsApp to meet this requirement below: private Map purchasableItems; public void onItemDataResponseSuccessful(Map itemData) { purchasableItems = itemData; //..... } public void onPurchaseResponseSuccess(String userId, String sku,String purchaseToken) { Log.i(TAG, ""onPurchaseResponseSuccess: sku ""+""( "" + sku + "" ) price ( "" + purchasableItems.get(sku).getPrice() + "" )""); //..... }
10 |5000

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

pitup3 avatar image
pitup3 answered
thanx @sujoy thanx for your support & response, & saved my time :)
10 |5000

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