App Store Pricing Matrix
A simple module that holds currencies and prices from the Apple's iOS App Store.
gem install app_store_pricing_matrix
v2.0.0 (July 18, 2012)
- Based on v13.
- Added SGD, HKD and TWD.
REVERSE_CURRENCY_MAPare removed. They are all self-referential now.
DEVELOPER_CURRENCIESare removed. Use
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
EUR, and this library expects them as a key.
Some constants, useful for validation:
AppStorePricingMatrix::CURRENCIES => ["USD", "CAD", "MXN", "AUD", "NZD", "JPY", "EUR", "DKK", "SEK", "CHF", "NOK", "GBP", "CNY", "SGD", "HKD", "TWD"]
To retrieve a customer price, query with the currency and the tier number:
AppStorePricingMatrix::CUSTOMER_PRICES['USD'] => "0.99" AppStorePricingMatrix::CUSTOMER_PRICES['JPY'] => "85"
For developer proceeds:
AppStorePricingMatrix::DEVELOPER_PROCEEDS['GBP'] => "12.78"
Updating the price table
The price table was generated by parsing the exhibit C part of the paid app contract PDF file. As of July 18, 2012, it was versioned as v13.
Since the PDF file was malformed, PDF parsing wasn't feasible. My current method to extract out the data semi-automatically is as follows, using Mac OS X 10.7:
- Select a column vertically using mouse / trackpad from tier 0 through tier 87, covering pairs of a currency and its commission
- Save it into a text file, naming with the currency - e.g. "usd.txt" under the "input" folder
rake aspm:generateto compile the input files into pricing data
- Then run the spec to verify the generated content by