If you’ve enabled purchase verification, you can use the Adjust SDK to request purchase verification.
There are two ways to verify purchases with the Adjust SDK:
- Create an
ADJEventobject that represents your purchase and add the following properties:transactionId(NSString): The ID of the transaction you want to verify.productId(NSString): The product identifier of the item that was successfully purchased.
- Create an
ADJAppStorePurchaseobject with your transaction ID and product ID.
When you send purchase information with the Adjust SDK, Adjust does the following:
- Sends the information to the App Store and waits for a status response.
- Forwards the status response to the Adjust SDK.
You can access the purchase verification status by using a callback. Results are returned as ADJPurchaseVerificationResult objects containing the following properties:
verificationStatus(NSString): The status of the purchase.code(int): The status code of the purchase.message(NSString): Any message returned by the App Store.
Record event and verify purchase
- (void)verifyAndTrackAppStorePurchase:(nonnull ADJEvent *)event withCompletionHandler:(nonnull ADJVerificationResultBlock)completion;To send a revenue event for verification and listen for the purchase verification status, follow these steps:
- Instantiate an
ADJEventobject with the your event token and set the following parameters:transactionId(NSString): The ID of the transaction you want to verify.productId(NSString): The product identifier of the item that was successfully purchased.
- Call the
Adjust.verifyAndTrackPlayStorePurchasemethod with the following arguments:event(ADJEvent): Your instantiated event object.callback(ADJVerificationResultBlock): A delegate callback function that receives anADJPurchaseVerificationResultobject as an argument.
In this example, the purchase verification response is output to the logging daemon.
Only verify purchase
- (void)verifyAppStorePurchase:(nonnull ADJAppStorePurchase *)purchase withCompletionHandler:(nonnull ADJVerificationResultBlock)completion;To send a standalone purchase and listen for the purchase verification status, follow these steps:
- Instantiate an
ADJAppStorePurchasewith the following arguments:transactionId(NSString): The ID of the transaction you want to verify.productId(NSString): The product identifier of the item that was successfully purchased.
- Call the
Adjust.verifyAppStorePurchasemethod with the following arguments:purchase(ADJAppStorePurchase): Your instantiated purchase object.callback(ADJVerificationResultBlock): A delegate callback function that receives anADJPurchaseVerificationResultobject as an argument.
In this example, the purchase verification response is output to the logging daemon.