简体   繁体   English

iOS在TestFlight中还原购买的商品

[英]iOS Restore Purchases in TestFlight

I have a mobile app, which for iOS I am testing with TestFlight. 我有一个移动应用程序,正在使用TestFlight对iOS进行测试。

After I make a successful "Non-Renewing Subscription" purchase, I would expect to see the purchase history when I call Restore Purchases . 成功完成“非续订订阅”购买后,我希望在致电Restore Purchases时看到购买历史记录。 When I make a purchase through the TestFlight app, I do not see any historic purchases. 通过TestFlight应用进行购买时,看不到任何历史性购买。

Question

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? 或者,我应该期待看到历史性的购买吗?

If one cannot see the historic purchases, how do you test Restore Purchases ? 如果看不到历史购买,您如何测试Restore Purchases

Code: 码:

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

The get Products does return the products successfully. get Products确实成功返回了产品。

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

ps. PS。 When I run this same code in Android restorePurchases does return the historic purchases. 当我在Android运行相同的代码时, restorePurchases确实会返回历史购买。

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; 如果您参考表1-2和《 应用程序内购买编程指南》中的随附文本,您将看到系统无法恢复不可更新的订阅; 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. 因此,在还原的购买中您不会看到非续订的订阅,因此您在测试和生产中所看到的都是预期的。

Auto renewing subscriptions are restorable since Apple's server is tracking the active subscription for you. 由于Apple的服务器正在为您跟踪活动的订阅,因此可以恢复自动续订的订阅。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM