question

Tigerishwillo avatar image
Tigerishwillo asked

currency codes

I'd like to be able to send a currency code to our analytics system once an IAP has been successful. Am I correct in assuming that this is only available by analysing the text string returned in the price member of the items data returned from an itemdatarequest? Thanks in advance for any useful help.
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.

StephenC@Amazon avatar image
StephenC@Amazon answered
Yes, you need to parse the result to get the Currency value.
10 |5000

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

xymaxl avatar image
xymaxl answered
Do you have a suggestion on how to parse the price string?
10 |5000

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

Sachin@Amazon avatar image
Sachin@Amazon answered
Hi, There can be different ways to parse a string. You can get some idea on this at the following forum posts: https://forums.developer.amazon.com/forums/thread.jspa?messageID=890ͺ Hope this helps. Thank You.
10 |5000

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

xymaxl avatar image
xymaxl answered
To parse the String I would then need a grammar definition for the price string. Is something like that available?
10 |5000

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

Dixith@Amazon avatar image
Dixith@Amazon answered
Hi, Thank you for your post. NumberFormat is the abstract base class for all number formats. This class provides the interface for formatting and parsing numbers. You can use the java.text.NumberFormat for parsing the price string. Hope this information helps you.
10 |5000

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

xymaxl avatar image
xymaxl answered
I already looked into that solution. Unfortunately, you need to know the locale of the price to do that. Although I have the locale the user installed on the device, I can not be sure that this matches the locale from the APIs product.
10 |5000

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

td1010101 avatar image
td1010101 answered
this remains an issue - either guidance on how to parse the string or a way to get non-formatted price/currency data is required to be able to report correctly. when will this be available?
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, We generally do not answer questions about future products or services, which this falls under. However, I'm going to forward this feedback/suggestion to the concern team. Please stay tuned on Mobile App Distribution Portal or Blogs ( https://developer.amazon.com/blog/index.html) for any updates related to this. Thanks.
10 |5000

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