Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v1.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.document
.gitignore
.rspec
Gemfile
Gemfile.lock
LICENSE.txt
README.rdoc
Rakefile
VERSION
app_store_pricing_matrix.gemspec

README.rdoc

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
Something went wrong with that request. Please try again.