Subscription renewals, cancellations, and other status changes are tracked using server-to-server data from the App Store. See the following sections for setup.
In order to be able to track status changes for subscriptions that were issued prior to the devtodev SDK integration, you must send the history of previously purchased user subscriptions to devtodev.
The SDK keeps track of the need to send this historical data so that it does not make “unnecessary” requests to the App Store. Use the isRestoreTransactionHistoryRequired method to check whether it is necessary to send data about previously purchased subscriptions to devtodev.
The isRestoreTransactionHistoryRequired method returns a BOOL value.
Here is an example of a purchase history request with the check:
DTDPurchases service will get the information about previously purchased subscriptions automatically from SKPaymentQueue. Sending the data via the subscriptionHistory method is not required.
Settings on the App Store Connect side
To get detailed information about the transaction, devtodev requires access to the App Store Server API. To grant this access, you will need to generate an In-App Purchase API key.
When the integration is complete, the status will change to Active.
Subcriptions
In order for IAP auto tracking to work correctly with subscriptions, you need to integrate App Store Server Notification. Go to Settings → Payments integration → Subscriptions → Integrate.
Fill in the iOS Bundle ID and copy the Endpoint URL.
Navigate to App Store Connect. In the left menu column, under General, go to App information. Paste the copied endpoint URL into the Production Server URL and Sandbox Server URL fields.
Click Save to confirm your changes.