adjust-icon

Purchase verification

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:

  1. Create an ADJEvent object 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.
  2. Create an ADJAppStorePurchase object with your transaction ID and product ID.

When you send purchase information with the Adjust SDK, Adjust does the following:

  1. Sends the information to the App Store and waits for a status response.
  2. 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

Method signature
- (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:

  1. Instantiate an ADJEvent object 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.
  2. Call the Adjust.verifyAndTrackPlayStorePurchase method with the following arguments:
    • event (ADJEvent): Your instantiated event object.
    • callback (ADJVerificationResultBlock): A delegate callback function that receives an ADJPurchaseVerificationResult object as an argument.

In this example, the purchase verification response is output to the logging daemon.

Only verify purchase

Method signature
- (void)verifyAppStorePurchase:(nonnull ADJAppStorePurchase *)purchase
withCompletionHandler:(nonnull ADJVerificationResultBlock)completion;

To send a standalone purchase and listen for the purchase verification status, follow these steps:

  1. Instantiate an ADJAppStorePurchase with 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.
  2. Call the Adjust.verifyAppStorePurchase method with the following arguments:
    • purchase (ADJAppStorePurchase): Your instantiated purchase object.
    • callback (ADJVerificationResultBlock): A delegate callback function that receives an ADJPurchaseVerificationResult object as an argument.

In this example, the purchase verification response is output to the logging daemon.