ios - AppsFlyer 的 SDK 收据验证失败
问题描述
尝试使用 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;
}
}];
解决方案
如你所知,Auto-Renewable Subscription
要求App-Specific Shared Secret
,
请参阅appstoreconnect.apple.com
-> My Apps
->Features
选项卡 -> In-App Purchases
->Auto-Renewable Subscription
项目部分:
共享秘密如下所示:e21e428f20db4d6d90c9192b9b7b2a75
1)21004
表示您尝试测试 Auto-Renewable Subscription 并且 AppsFlyer 没有共享密钥。
请联系 support@appsflyer.com 以获取更多详细信息。
如果您不使用Auto-Renewable Subscription
但仍然出现此错误会发生什么: 21004
:
Apple 在沙盒模式下的测试存在一些问题。尝试创建一个新的测试人员帐户并再次进行测试。过去,一旦您使用帐户A
进行测试Auto-Renewable Subscription
,所有其他尝试使用帐户测试其他类型的购买,例如 Consumable、Non-Consumable、Non-Renewing Subscription A
- Apple 都会返回相同的错误21004
。
希望能帮到你
推荐阅读
- aws-lambda - 我想使用 python lamda 函数从事件日志中选择文件名
- operating-system - 为什么程序在内存而不是硬盘上执行?
- php - 即使使用 cookie 传输,Codeigniter Ajax 请求中也禁止 403
- xamarin - 如何显示所有页面通用的导航栏“TitleView”
- java - 如何在 Spring Boot 中启用 H2 数据库服务器模式
- arrays - 无法使用 Java 解决 IntelliJ 中 JSONArray 的符号错误
- gridview - VerticalGridView的焦点处理
- .net - FTP 传输代码失败并显示“[System.IO.FileStream] 不包含名为“CopyTo”的方法”
- java - 双向数据绑定:从内部类更新值时无法更改 EditText 值
- r - 对时间相关的配对观察运行线性回归