iOS 在 TestFlight 中恢复购买 [英] iOS Restore Purchases in TestFlight

查看:68
本文介绍了iOS 在 TestFlight 中恢复购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于 iOS 的移动应用,我正在使用 TestFlight 进行测试.

I have a mobile app, which for iOS I am testing with TestFlight.

在我成功进行非续订订阅"购买后,我希望在调用 Restore Purchases 时看到购买历史记录.当我通过 TestFlight 应用进行购买时,我看不到任何历史购买记录.

After I make a successful "Non-Renewing Subscription" purchase, I would expect to see the purchase history when I call Restore Purchases. When I make a purchase through the TestFlight app, I do not see any historic purchases.

问题

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

Is this normal behaviour because this is a test environment, and the purchases don't really exist? Or, should I expect to see the historic purchases?

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

If one cannot see the historic purchases, how do you test Restore Purchases?

代码:

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

get Products 确实成功返回了产品.

The get Products does return the products successfully.

  this.iap.getProducts(this.PRODUCT_IDS).then((products: any[]) => {
     ...
  });

ps.当我在 Android 中运行相同的代码时,restorePurchases 会返回历史购买.

ps. When I run this same code in Android restorePurchases does return the historic purchases.

推荐答案

如果您参考 In App Purchase Programming Guide 你会看到非系统不会恢复可续订的订阅;您的应用有责任在您自己的服务器上跟踪用户的订阅状态.

If you refer to table 1-2 and the accompanying text in the In App Purchase Programming Guide you will see that non-renewable subscriptions are not restored by the system; it is your app's responsibility to track the user's subscription status on your own server.

  • 不可续订的订阅.不涉及提供情节内容的订阅.示例包括访问历史照片数据库或飞行地图集.您的应用有责任在所有用户的设备上提供订阅并让用户恢复购买.当您的用户在您的服务器上已有一个帐户时,通常会使用此产品类型,您可以在恢复内容时使用该帐户来识别他们.订阅的到期和持续时间也由您的应用(或您的服务器)来实施和强制执行.
  • 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.

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

Accordingly you will not see a non-renewing subscription in the restored purchases, so what you are seeing is expected both in test and production.

自动续订订阅是可恢复的,因为 Apple 的服务器正在为您跟踪有效订阅.

Auto renewing subscriptions are restorable since Apple's server is tracking the active subscription for you.

这篇关于iOS 在 TestFlight 中恢复购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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