TestFlight 中的 iOS 恢复购买

标签 ios angular ionic-framework applet testflight

我有一个移动应用程序,用于 iOS我正在使用 TestFlight 进行测试。

在我成功进行“非续订订阅”购买后,我希望在调用 Restore Purchases 时看到购买历史记录。 .当我通过 TestFlight 应用程序进行购买时,我没有看到任何历史购买记录。

问题

这是正常的行为,因为这是一个测试环境,并且购买并不存在吗?或者,我应该期待看到历史性的购买吗?

如果看不到历史购买记录,如何测试 Restore Purchases ?

代码:

  this.iap.restorePurchases().then((purchases: any[]) => {
      // purchases are empty
  });

get Products 确实成功返回了产品。
  this.iap.getProducts(this.PRODUCT_IDS).then((products: any[]) => {
     ...
  });

附言。当我在 Android 中运行相同的代码时restorePurchases确实返回了历史购买。

最佳答案

如果您引用表 1-2 和 In App Purchase Programming Guide 中的随附文本您会看到系统不会恢复不可续订的订阅;在您自己的服务器上跟踪用户的订阅状态是您的应用程序的责任。

  • Non-renewable subscriptions. Subscriptions that don’t involve delivering episodic content. Examples include access to a database of historic photos or a collection of flight maps. It’s your app’s responsibility to make the subscription available on all of the user’s devices and to let users restore the purchase. This product type is often used when your users already have an account on your server that you can use to identify them when restoring content. Expiration and the duration of the subscription are also left to your app (or your server) to implement and enforce.


因此,您不会在恢复的购买中看到非续订订阅,因此您在测试和生产中看到的都是预期的。

自动续订订阅是可恢复的,因为 Apple 的服务器正在为您跟踪事件订阅。

关于TestFlight 中的 iOS 恢复购买,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45079214/

相关文章:

ios - SwiftUI 文本字段 + 步进器

android - 适用于 Unity3d Windows 应用程序的 Firebase

android - 边框半径在三星 Galaxy j7 中不起作用

Angular5 - 类型错误 : Cannot read property 'template' of undefined

angular - Ionic 与 Firebase 数据库 Ref 被多次调用

javascript - 预缓存模板是否值得?

ios - 在 UICollectionView 中隐藏搜索栏

javascript - CSS 变量和 Angular 5

javascript - 如何制作点 "adder"按钮

ios - swift 中文本字段的前景色