【发布时间】:2019-05-24 08:55:58
【问题描述】:
尝试使用 AppsFlyer 的 SDK 进行应用内购买服务器收据验证。在 SKStoreKit 的 completeTransaction: 回调中调用 validateAndTrackInAppPurchase 方法。但是它会失败并总是返回以下响应。
{
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;
}
}];
【问题讨论】:
标签: ios objective-c in-app-purchase receipt-validation appsflyer-ios-sdk