首页 文章

在app购买测试中(看不到我的产品)

提问于
浏览
2

所以我按照教程尝试用IAP制作测试应用程序 .

1)我创建了新的App ID

2)添加了两个ID为 iapdemo_extra_colors_colect_1iapdemo_extra_colors_colect_2" 的消耗品

3)在iTunes连接中创建测试用户

4)创建和应用程序 .

5)使用tableView视图为购买单独制作页面

6)将App ID包ID复制到info.plist为“Bundle identifier”

7)我的购买页面代码是:

import UIKit
import StoreKit

class IAPurchaceViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, SKProductsRequestDelegate {


  var productIDs: [String!] = []

  var productsArray: [SKProduct!] = []

    @IBOutlet weak var tblProducts: UITableView!

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.


        tblProducts.delegate = self
        tblProducts.dataSource = self

      productIDs.append("iapdemo_extra_colors_colect_1")
      productIDs.append("iapdemo_extra_colors_colect_2")

      requestProductInfo()
    }

  func requestProductInfo() {

    if SKPaymentQueue.canMakePayments() {
      let productIdentifiers = NSSet(array: productIDs)
      let productRequest = SKProductsRequest(productIdentifiers: productIdentifiers as! Set<String>)

      productRequest.delegate = self
      productRequest.start()
    } else {
      print("Cannot perform In App Purchases.")
    }
  }


  func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse) {
    if response.products.count != 0 {
      for product in response.products {
        productsArray.append(product )
      }

      tblProducts.reloadData()
    } else {
      print("There are no products.")
    }

    if response.invalidProductIdentifiers.count != 0 {
      print(response.invalidProductIdentifiers.description)
    }

  }

  func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 1
  }


  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return productsArray.count
  }


  func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
    return 80.0
  }

  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("idCellProduct", forIndexPath: indexPath) 

    let product = productsArray[indexPath.row]
    cell.textLabel?.text = product.localizedTitle
    cell.detailTextLabel?.text = product.localizedDescription

    return cell
  }



  override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */


    // MARK: IBAction method implementation

    @IBAction func dismiss(sender: AnyObject) {
        dismissViewControllerAnimated(true, completion: nil)
    }

    // MARK: UITableView method implementation

}

当我来购买页面时,我希望看到产品列表,但我在控制台中只得到了“ There are no products. ["iapdemo_extra_colors_colect_1", "iapdemo_extra_colors_colect_2"] ” .

我尝试了一些更多的教程和苹果示例代码来检查我的应用内购买,但没有运气 .

在我下载Apple示例代码以检查应用程序内购买之后https://developer.apple.com/library/ios/samplecode/sc1991/StoreKitSuite.zip

我在invalidProductIdentifiers数组中获得了我的单个产品ID . 所以我找到了故障排除列表(来自Apple):

  • 您没有使用显式的App ID .

  • 如果您或App Review在iTunes Connect中拒绝了您最近的二进制文件 .

  • 您未在iTunes Connect中清除待售应用内购买产品 .

  • 您没有使用与您的显式应用ID相关联的配置文件签署您的应用 .

  • 您可能已修改过您的产品,但这些更改尚未可用于所有App Store服务器 .

  • 您没有完成所有财务要求 . 有关详细信息,请参阅 Contract ,税务和银行信息 .

  • 您的产品是Apple托管的产品,其内容尚未上传到iTunes Connect .

我得到了答案

  • 我使用显式应用ID

  • 我的应用程序没有被拒绝,因为它是测试,我没有尝试提交它

  • 我有单品待售

  • 配置文件设置为自动 . 我也尝试制作一个并在xcode中使用它

  • 我没有修改任何东西一小时(可能我需要再等一会儿?)

  • 税和银行账户已满

  • 不是Apple托管的

有什么想法吗?

1 回答

  • 0

    问题出在配置文件中 . 这是由于某种原因不正确所以我自己做了它,它开始运作良好 .

    我发现如果你的证书有问题但是不是我的问题,我可以解决这个问题!

    希望它可以帮到某人!

相关问题