iOS - 应用内购买 - 订阅
我的应用程序中有应用内购买订阅。我能够成功集成并进行订阅。有 3 种不同的订阅方式,每月、每季度和每年。 因此,如果用户按月订阅,则可以使用该功能 30 天。我的情况下没有服务器。根据订阅,仅激活/停用某些功能的可用性。
当应用程序启动时,我想检查用户是否付费订阅。如果我在订阅中维护一些布尔值,如果用户已从设置中停用订阅怎么办?如何检测订阅是否有效?
I'm having in-app purchase subscriptions in my app. I'm able to integrate and make subscriptions successfully. There are 3 different subscriptions, monthly, quarter and yearly.
So if user subscribes to monthly user can use that feature for 30 days. There's no server in my case. Only availability of some features will be activated/deactivated according to subscription.
When ever the app starts, i want to check whether user paid for subscription or not. If I'm maintaining some bool value in subscriptions, what if the user has deactivated the subscriptions from settings? How can I detect whether the subscriptions are valid or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以添加计数器并将该计数器值添加到必须位于应用程序内部的数据库中。每当用户尝试访问订阅时,您都可以从数据库进行验证。
You can add counter and add that counter value in a database that must be inside your app. Whenever user tries to access subscriptions you can verify from the database.
您必须将收据寄回苹果服务器,从我们收到的响应中,我们可以确定到期日期。然后我会知道订阅是否已过期或续订等。
访问 苹果文档
You have to post the receipt back to apple server and from the response we receive, we can identify the expiry date. Then I'll know whether the subscription is expired or renewed etc.
Visit Apple documentation