現在、私はSwiftを使用しているiOSアプリケーションで作業しています。 InApp Purchasedを有効にしています。お支払いは完全には行っていますが、iTunes Connectからデータを表示しているときは、完全に表示されている月々の購読データが表示されますが、毎月のタブの価格を月額形式で表示しておき、ユーザーがカードをタップすると、私はこれをすることができません。説明は画像に示されています。前もって感謝します。数ヶ月の面で年間サブスクリプションを表示InApp Purchase swift iosで年間価格を表示
// Currently i am getting product info with this method
// MARK: - REQUEST IAP PRODUCTS
func productsRequest (_ request:SKProductsRequest, didReceive response:SKProductsResponse) {
if (response.products.count > 0) {
iapProducts = response.products
// showHUD("Loading...")
let indexPath = IndexPath.init(row: 0, section: 0)
guard let cell = collectionView.cellForItem(at: indexPath) as? CollectionViewCell else { return }
let numberFormatter = NumberFormatter()
let firstProduct = response.products[0] as SKProduct
print("localizedDescription", firstProduct.localizedDescription)
print("localizedTitle", firstProduct.localizedTitle)
// Get its price from iTunes Connect
numberFormatter.formatterBehavior = .behavior10_4
numberFormatter.numberStyle = .currency
numberFormatter.locale = firstProduct.priceLocale
let price1Str = numberFormatter.string(from: firstProduct.price)
// Show its description
cell.monthlyLabel.text = "\(firstProduct.localizedTitle)"
cell.rupeesLabel.text = "\(price1Str!)"
cell.perMonthLabel.text = "\(firstProduct.localizedDescription)"
let indexPath1 = IndexPath.init(row: 1, section: 0)
guard let cell2 = collectionView.cellForItem(at: indexPath1) as? CollectionViewCell else { return }
let secondProd = response.products[1] as SKProduct
// Get its price from iTunes Connect
numberFormatter.locale = secondProd.priceLocale
let price2Str = numberFormatter.string(from: secondProd.price)
// Show its description
cell2.monthlyLabel.text = "\(secondProd.localizedTitle)"
cell2.rupeesLabel.text = "\(price2Str!)"
cell2.perMonthLabel.text = "\(secondProd.localizedDescription)"
// ------------------------------------
}
}
あなたが求めていることは明確ではありません。単にiTunesConnectで設定されている価格を表示するだけでよく、それはあなたがやっているようです。年間購買の月額料金を表示するのは間違いです – Paulw11
返信ありがとうPaulw115。私の編集されたqueを見てください。 –
それを示すコードを書いてください。年間製品の価格を12で割る必要があります。$ 4.99 * 12は実際に$ 59.88であるので、丸めに注意してください。これは少し誤解を招く理由です。 – Paulw11