{"id":20643892,"url":"https://github.com/adjust/aepricematrix","last_synced_at":"2025-05-10T08:31:09.859Z","repository":{"id":14685635,"uuid":"17405083","full_name":"adjust/AEPriceMatrix","owner":"adjust","description":"Tier based currency conversion for iOS","archived":true,"fork":false,"pushed_at":"2015-02-09T12:50:40.000Z","size":208,"stargazers_count":4,"open_issues_count":2,"forks_count":10,"subscribers_count":77,"default_branch":"master","last_synced_at":"2025-03-22T07:51:26.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adjust.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-04T14:34:43.000Z","updated_at":"2024-09-05T11:46:23.000Z","dependencies_parsed_at":"2022-09-23T22:12:54.869Z","dependency_job_id":null,"html_url":"https://github.com/adjust/AEPriceMatrix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2FAEPriceMatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2FAEPriceMatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2FAEPriceMatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2FAEPriceMatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adjust","download_url":"https://codeload.github.com/adjust/AEPriceMatrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253389741,"owners_count":21900805,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T16:14:13.942Z","updated_at":"2025-05-10T08:31:09.564Z","avatar_url":"https://github.com/adjust.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AEPriceMatrix\n\nTier based currency conversion for iOS based on the [App Store Pricing Matrix][priceMatrix].\n\n## Overview\n\nExample usage:\n```objc\nNSNumber *converted = [AEPriceMatrix convert:@0.99 from:@\"USD\" to:@\"EUR\"];\nNSLog(@\"converted to %@\", converted);\n```\nOutput:\n```\nconverted to 0.89\n```\n\n## In-App Purchase Tracking\n\nThis can be used for In-App Purchase tracking in a specific currency regardless\nof the local currency that the purchase was paid in. The following example\ntracks all revenue in `EUR`.  See [the In-App Purchase Programming\nGuide][inAppGuide] for details on how to implement a method like\n`productForId:` that finds an `SKProduct` by its product identifier.\n\n```objc\n- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions {\n    for (SKPaymentTransaction *transaction in transactions) {\n        switch (transaction.transactionState) {\n            case SKPaymentTransactionStatePurchased:\n                [self finishTransaction:transaction];\n\n                NSString *productId = transaction.payment.productIdentifier;\n                SKProduct *product = [self productForId:productId];\n                NSString *currency = [product.priceLocale objectForKey:NSLocaleCurrencyCode];\n                NSNumber *price = product.price;\n\n                NSNumber *revenue = [AEPriceMatrix convert:price from:currency to:@\"EUR\"];\n                [self trackRevenue:revenue];\n\n                break;\n            // more cases\n        }\n    }\n}\n```\n\n## Available Currency Codes\n\nInstead of plain currency code strings like `@\"USD\"` you can also use the\nfollowing string constants:\n\n```objc\nkAECurrencyUSD    // U.S.\nkAECurrencyCAD    // Canada\nkAECurrencyMXN    // Mexico\nkAECurrencyAUD    // Australia\nkAECurrencyNZD    // New Zealand\nkAECurrencyJPY    // Japan\nkAECurrencyEUR    // Europe\nkAECurrencyCHF    // Switzerland\nkAECurrencyNOK    // Norway\nkAECurrencyGBP    // U.K\nkAECurrencyDKK    // Denmark\nkAECurrencySEK    // Sweden\nkAECurrencyCNY    // China\nkAECurrencySGD    // Singapore\nkAECurrencyHKD    // Hong Kong\nkAECurrencyTWD    // Taiwan\nkAECurrencyRUB    // Russia\nkAECurrencyTRY    // Turkey\nkAECurrencyINR    // India\nkAECurrencyIDR    // Indonesia\nkAECurrencyILS    // Isreal\nkAECurrencyZAR    // South Africa\nkAECurrencySAR    // Saudi Arabia\nkAECurrencyAED    // UAE\n```\n\n[priceMatrix]: http://forecomm.mptw.fr/templates/PriceMatrix.html\n[inAppGuide]: https://developer.apple.com/Library/ios/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/ShowUI.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Faepricematrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadjust%2Faepricematrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Faepricematrix/lists"}