Starting with AppsFlyer's iOS SDK version 22.214.171.124, you can perform receipt validation for in-app purchases in the App Store.
Receipt validation flow
The Receipt Validation flow is as follows:
- User performs an in-app purchase.
- Apple store responds with success or fail (authentication).
- Developer calls the SDK Receipt Validation function (validateAndTrackInAppPurchase) with receipt data.
- The SDK calls AppsFlyer's validation service with the receipt data.
- AppsFlyer's validation service validates the transaction with Apple's servers.
- Apple's servers respond with success or failure.
- Upon success AppsFlyer internally creates a regular af_purchase event. Otherwise, the created event is tagged as fraudulent (available via Protect360).
- AppsFlyer's validation service transfers the response to the SDK.
- The SDK transfers the receipt validation response to the App.
For details of the implementation of Receipt Validation, refer to the iOS SDK Integration Guide, here.
Below a sample of a Receipt Validation response:
validateAndTrackInAppPurchase automatically generates an af_purchase in-app event. This saves you the need to send the event yourself from the SDK. If you validate the purchase as well as send the event yourself, the purchase is duplicated and so is the revenue.