Sha256: bd6b84c94d0e1d4decf60a59d96ad2b3fa0a35f0379ab9cfe6c13d5a9e56511a

Contents?: true

Size: 1.65 KB

Versions: 3

Compression:

Stored size: 1.65 KB

Contents

= App Store Pricing Matrix

A simple module that holds currencies and prices from the Apple's iOS App Store.

== Install

 gem install app_store_pricing_matrix

== Usage

Suppose you find a device locale by NSLocale on an iOS device.

 NSString* currency = [[NSLocale currentLocale] objectForKey:NSLocaleCurrencyCode];

That will give you the currency string like "USD" or "EUR", and this library expects them as a key.

Some constants, useful for validation:

 AppStorePricingMatrix::CUSTOMER_CURRENCIES
 => ["USD", "MXN", "CAD", "AUD", "NZD", "JPY", "EUR", "DKK", "NOK", "SEK", "CHF", "GBP"]

 AppStorePricingMatrix::DEVELOPER_CURRENCIES
 => ["USD", "CAD", "AUD", "JPY", "EUR", "GBP"]

To retrieve a customer price, query with the currency and the tier number:

 AppStorePricingMatrix::CUSTOMER_PRICES['USD'][1]
 => "0.99"

 AppStorePricingMatrix::CUSTOMER_PRICES['JPY'][1]
 => "115"

For developer proceeds:

 AppStorePricingMatrix::DEVELOPER_PROCEEDS['GBP'][30]
 => "10.95"

To retrieve a developer currency from a given customer currency:

 AppStorePricingMatrix::REVERSE_CURRENCY_MAP['MXN']
 => "USD"
 
 AppStorePricingMatrix::REVERSE_CURRENCY_MAP['DKK']
 => "EUR"

== Updating the price table

The price table was generated by parsing the exhibit C part of the paid app contract PDF file. As of February 27, 2011, it was versioned as V6.

However Apple haven't changed it much so far, it's reasonable to expect changes in the future. When that happens, strip the PDF down to 2 pages only containing the price table, rename it to "input.pdf", put it in the project root, then run the following rake task.

 rake aspm:generate

Then run the spec to verify the generated content:

 rake

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
app_store_pricing_matrix-1.0.3 README.rdoc
app_store_pricing_matrix-1.0.2 README.rdoc
app_store_pricing_matrix-1.0.1 README.rdoc