3

我有一个使用应用内购买的 iOS 应用程序。

我已经设置了环境:

  • 设置协议税务和银行业务部分,
  • 创建iap产品
  • 在功能选项卡中打开“应用内购买”
  • 实现了我的代码来检索产品列表并执行购买验证收据服务器端

我还使用沙盒环境对所有产品进行了测试,所有产品都按预期工作:商店正确接收了产品列表,我可以购买验证相应收据的产品。

我还使用testflight测试了应用程序,它会自动为所有测试人员创建一个沙盒用户,并且所有工作都按预期工作

我向苹果商店提交了我的申请,并且修改已经通过,所以在申请处于“等待开发者发布”状态的那一刻,所有的产品都已经被批准了:

在此处输入图像描述

为了尝试实际购买(使用真正的信用卡),我使用 iTunes connect 生成了一个促销代码,并在我的 iPhone 上安装了该应用程序。但是,当使用以这种方式下载的应用程序时,我在应用程序的 IAP 部分看不到任何产品。该应用程序似乎下载了一个空的或无效的产品列表。相同的应用程序版本适用于 Testflight。IAP 是否允许使用促销代码?为什么我只能使用沙盒用户下载正确的产品列表?由于我无法调试我的应用程序,我该如何找到问题所在?

编辑

我在这里发现了有关无效产品标识符问题的以下几点:

  1. 您是否为新的 App ID 生成并安装了新的配置文件?
  2. 您是否已将项目配置为使用此新的配置文件进行代码签名?

我已经生成了使用 XCode 自动管理签名的 App Id。

在此处输入图像描述

在开发者门户中,我有这种形式的 App ID

在此处输入图像描述

目前,我没有生成任何配置文件,实际上我在开发人员门户的“Provisionig Profile”部分找不到它。而且,如上图所示,在 Xcode 中,我将“XCode Managed Profile”视为配置文件:

在此处输入图像描述

这是一个问题吗?如果是,我应该如何解决?手动生成新的配置文件并将其安装在我的机器上就足够了吗?我应该为我的应用程序上传一个新版本吗?

如果缺少配置文件,为什么我的应用程序使用沙盒用户和 Testflight 环境可以正常工作?

4

1 回答 1

2

The problem was that, actually, you can't download a list of product until the application is in the "ready for sale" state. As stated in the In app Purchase FAQ:

"When an application is approved, the developer must also approve the application for release to the App Store. On approval, the application ID is activated to the App Store. The same activation is required for the in-app purchase identifiers and can only take place once the application is activated. In some cases, the activation of the In-App Purchase identifiers may lag up to 48 hours following the activation of the application. If the developer does not approve the release of the production application to the App Store, then any new in-app purchase identifiers will not be activated. This is an issue when a developer wants to verify the application prior to activating it on the App Store. If the desire is to test the in-app purchase process for the new items, the application must be activated to the App Store. This is only an issue for new in-app purchase identifiers in a corresponding application submission. Once these in-app purchase identifiers have been activated, application updates to the submission will find that these in-app purchase identifiers are validated, even if the update is not activated."

So if your application is in "pending developer release" status, you can't get the product list with an application downloaded through promotional codes. Once the app has been released on the store, the product list has shown correctly.

The problem was not related to provisioning profiles: the auto-generated provisioning profile is valid to submit applications with in-app purchases functionalities.

于 2018-11-28T16:04:51.340 回答