мое приложение с покупкой в приложении, есть 3 предмета для покупки, скажем: 1. купить 50 кредитов 2. купить 100 кредитов 2. купить 500 кредитов
, но я протестировал с вышеупомянутыми предметами, все предметы дают мне 100 кредитов. Я проверяю код, кажется, нет проблем, кто-нибудь может мне помочь, что не так с моим кодом? спасибо
let lowProduct = response.products[0] as SKProduct
let numberFormatter = NumberFormatter()
numberFormatter.formatterBehavior = .behavior10_4
numberFormatter.numberStyle = .currency
numberFormatter.locale = lowProduct.priceLocale
let price1Str = numberFormatter.string(from: lowProduct.price)
let normalProduct = response.products[1] as SKProduct
let price2Str = numberFormatter.string(from: normalProduct.price)
let hightProduct = response.products[2] as SKProduct
let price3Str = numberFormatter.string(from: hightProduct.price)
DispatchQueue.main.async {
self.buyButton3.setTitle(hightProduct.localizedDescription + " \(price3Str!)", for: .normal)
self.buyButton1.setTitle(lowProduct.localizedDescription + " \(price1Str!)", for: .normal)
self.buyButton2.setTitle(normalProduct.localizedDescription + " \(price2Str!)", for: .normal)
}
кажется, не могу вставить слишком много кода здесь. полный код, пожалуйста, проверьте здесь: http://txt.do/16clc