How to test the “renew” component of auto-renew subscriptions in iOS App Store Sandbox?

前端 未结 3 1290
北恋
北恋 2021-01-31 09:24

Folks,

I am attempting to verify that auto-renew subscriptions are actually renewing in the sandbox environment. First, it appears that auto-renew subscriptions in sandb

3条回答
  •  心在旅途
    2021-01-31 10:14

    @Lata Sadhwani, App developer

    For testing auto-renew subscriptions, the expiration time is 5 minutes in sandbox (at least for the monthly subscriptions, not sure if this is different for different periods). So when testing an auto-renew subscription in sandbox, it should auto-renew every 5 mins and you know they are working correctly.

    But there is one problem. These subscriptions auto-renew only 5 times (i.e. the purchase happens 6 times). After that you'll get an error when verifying the receipt. So if you want to test after that, you will need to test with another IAP test account (yes it is a pain testing, especially if you have been doing this for quite some time!)

    To check if a subscription has been cancelled or is valid, your receipt verification code will need to parse the response from Apple servers and they say you should verify each receipt. If the subscription has expired or has been cancelled, the appropriate error code will be returned (a non-zero status). If it has been renewed by a user, the most current receipt is returned by the Apple servers.

提交回复
热议问题