How Do I know that auto Renewalbe subscription is cancelled or not?

六眼飞鱼酱① 提交于 2019-12-10 09:44:54

问题


I am implementing In App purchases in my app ,with auto renewable subscription , Now i am confusing that how i know that when the user is cancelled auto-renewable subscription or not


回答1:


When user purchase any subscription using in app purchase, apple provide a Receipt for each purchase or transaction. Now you can anytime verify the subscription of user using this receipt. When you will pass this receipt to apple server it will provide you with the user current subscription (if available) along with the current receipt also.

For learning more about receipt validation go through this apple link. May be it will solve your issue.




回答2:


You need to track the expiration date of the current subscription. If you don't get a new subscription transaction at the start of the next period you can assume that the renewal has been cancelled.

From the In-App Purchase Programming Guide -

After a subscription is successfully renewed, Store Kit adds a transaction for the renewal to the transaction queue. Your app checks the transaction queue on launch and handles the renewal the same way as any other transaction. Note that if your app is already running when the subscription renews, the transaction observer is not called; your app finds out about the renewal the next time it’s launched.



来源:https://stackoverflow.com/questions/26015386/how-do-i-know-that-auto-renewalbe-subscription-is-cancelled-or-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!