简体   繁体   English

iOS StoreKit-通过应用程序登录进行应用程序内购买

[英]iOS StoreKit - in-App Purchase by App Login

This is the scenario for the application right now: 这是当前应用程序的场景:

The application I am working on has it's own login service, ie, the user can register on the app and login to it too. 我正在处理的应用程序具有其自己的登录服务,即用户也可以在该应用程序上注册并登录。

A user logs into the application (by the application's credentials) and then gets options to buy any of the 10 books listed there. 用户登录到该应用程序(通过应用程序的凭据),然后可以选择购买那里列出的10本书中的任何一本。 After the book is bought, it will be registered with his application's userID and every time the user logs in with the ID, on any device, he will have that book available. 购买该书后,该书将使用其应用程序的用户ID注册,并且每次用户在任何设备上使用该ID登录时,他都可以使用该书。

Now, since in this scenario, a user should be able to purchase a book again and again (but with different app credentials), I am thinking of using the "consumable" product option and adding a condition in the application itself that checks what books the logged in user has bought and not display to them the books they have bought (again, by app-credentials). 现在,由于在这种情况下,用户应该能够一次又一次(但使用不同的应用程序凭据)购买一本书,因此我正在考虑使用“消耗性”产品选项,并在应用程序本身中添加一个条件来检查哪些书籍登录的用户已经购买了并且不向他们显示他们购买的书籍(同样,通过应用凭据)。 This way, the won't be able to buy the same book again. 这样,将无法再次购买同一本书。

Is that possible? 那可能吗?

Please advise. 请指教。

我认为您想实现非消耗性产品,如果用户从一台设备购买任何书籍,那么其他用户也应该可以使用它.Store Kit提供了内置支持,可以在多台设备上恢复非消耗性产品。要还原交易,您的应用程序将调用付款队列的restoreCompletedTransactions方法。

If I understood you correctly, you just don't want to let user buy the same book more than one time. 如果我正确地理解了您的意思,那么您就是不想让用户多次购买同一本书。 If so, you just need to check on application start which books user has already purchased and then correct the list of available for purchase books removing from it already purchased. 如果是这样,您只需要在应用程序启动时检查用户已购买的图书,然后更正可购买的图书列表,从已购买的图书中删除。

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

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