应用内购买:滞留在paymentWithProductIdentifiers - 已弃用 [英] In-App Purchases: Stuck at paymentWithProductIdentifiers - which is deprecated

查看:590
本文介绍了应用内购买:滞留在paymentWithProductIdentifiers - 已弃用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难设置我的应用内购买。

I am stuck with setting up my in-app purchases.

我无法做到这一点:

SKPayment *paymentRequest = [SKPayment paymentWithProduct: @"co.za.nideo.100shotsbuybeer"];

我是从

SKPayment *paymentRequest = [SKPayment paymentWithProductIdentifiers: @"co.za.nideo.100shotsbuybeer"];

但这似乎已被弃用。如何让第一段代码工作?

but this seems to be deprecated. How can I get the first piece of code to work?

它似乎是一个SKProduct但我不知道如何创建/ init这样的对象。

It seems to nee a SKProduct but I don't know how to create/init such an object.

推荐答案

根据StoreKit文档和[1],您必须:

According to the StoreKit docs and [1] you'd have to:


  1. 使用您的商品标识符( initWithProductIdentifiers:)创建 SKProductsRequest

  2. 将自己设置为委托

  3. 将此请求发送给Apple( start 方法)

  4. 响应将调用您的代理 productsRequest:didReceiveResponse:其中包含 SKProductsResponse object

  5. 您从产品中提取 SKProduct 对象属性并显示它们,保存对象以供进一步购买。

  1. Create an SKProductsRequest with your product identifiers (initWithProductIdentifiers:)
  2. Set yourself as the delegate
  3. Send this request to Apple (start method)
  4. The Response will call your delegates productsRequest:didReceiveResponse: which contains an SKProductsResponse object
  5. You extract the SKProduct objects from the products property and display them, saving the objects for further purchase.

这似乎符合重要提示:在允许用户购买之前,您必须提出特定产品标识符的产品请求那个产品。从App Store检索产品信息可确保您使用有效的产品标识符来标记可在iTunes Connect中标记的产品。来自[1]

This seems in line with Important: You must make a product request for a particular product identifier before allowing the user to purchase that product. Retrieving product information from the App Store ensures that you are using a valid product identifier for a product you have marked available for sale in iTunes Connect. from [1]

[1] http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RetrievingStoreInformation/RetrievingStoreInformation.html#//apple_ref/doc/uid/TP40008267-CH2-SW1

这篇关于应用内购买:滞留在paymentWithProductIdentifiers - 已弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆