Trying to do in‐app purchase server receipt validation using AppsFlyer’s SDK. Called the validateAndTrackInAppPurchase
method inside the SKStoreKit’s completeTransaction:
callback. However it fails and always returns following response.
{
environment = Sandbox;
status = 21004;
}
21004
response says The shared secret you provided does not match the shared secret on file for your account.
But I don't have much idea about this shared secret
[[AppsFlyerTracker sharedTracker] validateAndTrackInAppPurchase:productId price:priceString
currency:@"USD"
transactionId:transaction.transactionIdentifier
additionalParameters:@{@"test": @"val" , @"test1" : @"val 1"}
success:^(NSDictionary *result){
NSLog(@"Purchase succeeded And verified!!! response: %@", result[@"receipt"]);
} failure:^(NSError *error, id response) {
NSLog(@"response = %@", response);
if([response isKindOfClass:[NSDictionary class]]) {
if([response[@"status"] isEqualToString:@"in_app_arr_empty"]){
// retry with 'SKReceiptRefreshRequest' because
// Apple has returned an empty response
// <YOUR CODE HERE>
}
} else {
//handle other errors
return;
}
}];