If you’ve enabled purchase verification, you must send additional information with your purchase events to verify them. When Adjust’s servers receive this information in an ADJEvent
object, they forward it to Apple to verify the purchase.
To verify a purchase, instantiate an ADJEvent
object with your event token and set the following properties:
transactionId
(NSString
): ThetransactionIdentifier
value of the successfully completed purchaseproductId
(NSString
): The product identifier of the item that was successfully purchasedreceipt
(NSData
): The signed receipt containing the information about the successfully completed purchase
let receiptURL = Bundle.main.appStoreReceiptURL;let receipt = try Data(contentsOf: receiptURL, options: .alwaysMapped)
let event = ADJEvent(eventToken: "abc123")event?.setRevenue(6.0, currency: "EUR");event?.setTransactionId("transaction-id");event?.setProductId("product-id");event?.setReceipt(receipt);Adjust.trackEvent(event)
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];ADJEvent *event = [ADJEvent eventWithEventToken::@"your-event-token"];[event setRevenue:6.0 currency:@"EUR"];[event setTransactionId:@"transaction-id"];[event setProductId:@"product-id"];[event setReceipt:receipt];[Adjust trackEvent:event];