尝试使用 AppsFlyer 的 SDK 进行应用内购买服务器收据验证。validateAndTrackInAppPurchase
在 SKStoreKit 的completeTransaction:
回调中调用方法。但是它失败并总是返回以下响应。
{
environment = Sandbox;
status = 21004;
}
21004
回应说The shared secret you provided does not match the shared secret on file for your account.
但我对此没有太多想法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;
}
}];