I want the buttons that you have to tap to buy something to show the price of that.
For example: "5 coins €0,99"
But if I create a UIlabel with exactly that text, Americans will also see the price in € instead of usd.
Now how can I set the price where it adjust to the currency the user lives in? I saw it on some games so I am convinced that this is possible.
thank you!
Locate “In-App Purchases” heading and tap it. (If In-App Purchases are available, it will say “Yes” and have a downward-pointing carat beside it.) After tapping the entry, a list will be revealed showing all of the app's In-App Purchases and the price of each one.
Open Play Console and go to the App pricing page (Products > App pricing). Click Set price. Review the table in the "Local prices" section. In the "Price" column, review the local prices for each country.
Question: Q: No prices shown in App store Answer: A: Many, many apps are free to download and then have in-app subscriptions. Those apps show a "Get" button instead of a price on the download button.
If purchases are done via Apple App Store (using StoreKit framework) you need to get price + currency from SKProduct object (prices will vary).
https://developer.apple.com/library/ios/documentation/StoreKit/Reference/SKProduct_Reference/
Update
var productID:NSSet = NSSet(object: “product_id_on_itunes_connect”);
var productsRequest:SKProductsRequest = SKProductsRequest(productIdentifiers: productID);
productsRequest.delegate = self;
productsRequest.start();
func productsRequest (request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {
println("got the request from Apple")
var validProducts = response.products
if !validProducts.isEmpty {
var validProduct: SKProduct = response.products[0] as SKProduct
if (validProduct.productIdentifier == self.product_id) {
println(validProduct.localizedTitle)
println(validProduct.localizedDescription)
println(validProduct.price)
buyProduct(validProduct);
} else {
println(validProduct.productIdentifier)
}
} else {
println("nothing")
}
}
import StoreKit
extension SKProduct {
func localizedPrice() -> String {
let formatter = NSNumberFormatter()
formatter.numberStyle = .CurrencyStyle
formatter.locale = self.priceLocale
return formatter.stringFromNumber(self.price)!
}
}
Information taken from here and here.
import StoreKit
extension SKProduct {
var localizedPrice: String {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
formatter.locale = priceLocale
return formatter.string(from: price)!
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With