分享

iap更新翻译

 3dC 2015-12-09
继承    符合
The SKPayment class defines a request to the Apple App Store to process payment for additional functionality offered by your application. A payment encapsulates a string that identifies a particular product and the quantity of those items the user would like to purchase.


    的skpayment类定义了苹果App Store的应用程序提供附加功能处理支付请求。付款将字符串,标识一个特定的产品,这些物品的用户愿意购买的数量。

    Declaration

    SWIFT

    convenience init(product productSKProduct)

    OBJECTIVE-C

    + (instancetype)paymentWithProduct:(SKProduct *)product

    Parameters

    product

    The product the user wishes to purchase.

    Return Value

    A new payment object.

    Discussion

    This factory method uses the productIdentifier property obtained from the product parameter to create and return a new payment with that identifier. The quantity property defaults to 1.

    To create a SKPayment object with a quantity greater than 1, create a SKMutablePayment object, adjust its quantity property and then add it to the payment queue 


    product :用户希望购买的产品。

    返回值:一种新的支付对象。



    讨论

    本厂采用从产品参数创建并返回一个新的支付与productidentifier属性标识符。数量属性默认为1。

    创建一个大于1的数量skpayment对象,创建一个skmutablepayment对象,调整其quantity数量属性然后将它添加到付款队列.



    .



    1. SKMutablePayment
      *myPayment = [SKMutablePayment paymentWithProduct: myProduct];
    2. myPayment.quantity = 2;
    3. [[SKPaymentQueue defaultQueue] addPayment:myPayment];

    Availability

    Available in iOS 3.0 and later.


    _____________________________________

    SKProduct

    SKProduct objects are returned as part of an SKProductsResponse object. Each product object provides information about a product you previously registered in iTunes Connect.

    ________________________________________________________

      本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
      转藏 分享 献花(0

      0条评论

      发表

      请遵守用户 评论公约

      类似文章 更多