简体   繁体   English

iOS中的耗材与非耗材

[英]Consumable vs. non-consumable in iOS

We are three guys, who have made a free game for iPhone, which has been available on the App Store for almost a year. 我们是三个人,他们为iPhone制作了一款免费游戏 ,已经在App Store上推出了近一年。

The app is a board game, where you create a user or login using your Facebook credentials. 该应用程序是一款棋盘游戏,您可以使用Facebook凭据创建用户或登录。 You are able to log out of the game and log back in with another account. 您可以退出游戏并使用其他帐户重新登录。

Now we have updated the app with the ability to upgrade the user to a premium user. 现在我们已经更新了应用程序,可以将用户升级为高级用户。 Allowing personal and global game statistics. 允许个人和全球游戏统计。

But Apple is giving us a headache in the approval process, and refuses to accept our In-App Purchase. 但Apple在审批过程中让我们头疼,并拒绝接受我们的应用程序内购买。 First they would not approve it, as it had no restore button. 首先,他们不会批准它,因为它没有恢复按钮。 Then when we told them, a restore button was not required, as it was a consumable purchase, they now demand we change it to a non-consumable and add the restore button. 然后,当我们告诉他们时,不需要恢复按钮,因为它是消耗品购买,他们现在要求我们将其更改为非消耗品并添加恢复按钮。

Consider this scenario if purchase was non-consumable. 如果购买是非消耗品,请考虑这种情况。

  1. User logs in. 用户登录。
  2. User upgrades account to premium 用户升级帐户为premium
  3. User logs out. 用户注销。
  4. User logs in with a different account. 用户使用其他帐户登录。
  5. User restores the previous purchase. 用户恢复以前的购买。

This would allow you to upgrade two accounts to premium, but with just one purchase. 这样您就可以将两个帐户升级为高级帐户,但只需一次购买即可。

Apple's argument is, that our users need to be able to restore purchases, if a new device is setup, or a device is restored. Apple的论点是,如果设置了新设备或设备已恢复,我们的用户需要能够恢复购买。

But that is not the way it works. 但这不是它的工作方式。 Users upgrade their accounts to premium accounts. 用户将其帐户升级为高级帐户。 Now when they buy a new device or restores an existing device, they just log in with their existing game account, and the upgrade will be available, because we on the server-side has marked the account as a premium account. 现在,当他们购买新设备或恢复现有设备时,他们只需使用现有游戏帐户登录,并且升级将可用,因为我们在服务器端已将该帐户标记为高级帐户。

So my question is basically. 所以我的问题基本上就是。 Were we totally wrong, when we choose to use a consumable instead of a non-consumable. 当我们选择使用消耗品而不是非消耗品时,我们完全错了。 And if so, how should a non-consumable be implemented in order to be (potentially) purchased more than once with different game accounts on the same device? 如果是这样,为了(可能)在同一设备上使用不同的游戏帐户多次购买非消耗品,应如何实施?

And secondly, if we are correct about the usage of a consumable in-app purchase, what should we say to convince Apple, that we are on the right path? 其次,如果我们对消费品应用程序内购买的使用是正确的,那么我们应该说服苹果,我们走在正确的道路上?

If your premium account is something that your users have to buy only once then Apple is definitely right to ask you to switch to non-consumable in-app. 如果您的高级帐户是您的用户必须只购买一次,那么Apple肯定会要求您切换到非消费类应用程序。

The scenario you described is quite possible (i had to face it too) but if you add server-side verification of in-app receipts before unlocking the premium feature (saving all transactions associated to a user) you have the chance to verify that the purchase is new or restored checking the fields original_transaction_id and original_purchase_date in the receipt data. 您描述的场景很可能(我也必须面对它)但如果您在解锁高级功能(保存与用户关联的所有交易)之前添加应用内收据的服务器端验证,您有机会验证购买是新的或恢复的,检查收据数据中的字段original_transaction_idoriginal_purchase_date This way you can see if the user restoring the purchase is the same that originally bought it (maybe checking its facebook user id). 通过这种方式,您可以查看恢复购买的用户是否与最初购买的用户相同(可能会检查其Facebook用户ID)。

Anyway, experience showed me that the chance of this happening is not really high and i wouldn't recommend implementing this check (although server side validation is almost always a must ;-) ) 无论如何,经验告诉我,这种情况发生的可能性并不高,我不建议实施此检查(尽管服务器端验证几乎总是必须的;-))

According to the 'Restoring Transactions' section of the In-App Purchase Programming Guide: 根据应用程序内购买编程指南的“恢复事务”部分

If your application supports product types that must be restorable, you must include an interface that allows users to restore these purchases. 如果您的应用程序支持必须可恢复的产品类型,则必须包含允许用户恢复这些购买的界面。

If your app contains non-consumable purchase, and if you don't include a restore button apple will not approve your app. 如果您的应用包含非消耗品购买,并且如果您不包含恢复按钮,则Apple将不会批准您的应用。

This has been made necessary by apple after June 2012. 这是2012年6月之后苹果所必需的。

So to answer your question: No, it seems that you must use restoreCompletedTransactions . 所以回答你的问题:不,似乎你必须使用restoreCompletedTransactions

Hope it helps you. 希望它能帮到你。

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

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