AppsFlyer的SDK收据验证失败

时间:2019-05-24 08:55:58

标签: ios objective-c in-app-purchase receipt-validation appsflyer-ios-sdk

尝试使用AppsFlyer的SDK进行应用内购买服务器收据验证。在SKStoreKit的validateAndTrackInAppPurchase回调中调用了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;
                                                                }
                                                            }];

1 个答案:

答案 0 :(得分:1)

您知道Auto-Renewable Subscription要求App-Specific Shared Secret

请参见appstoreconnect.apple.com-> My Apps-> Features标签-> In-App Purchases-> Auto-Renewable Subscription项目部分:

enter image description here

共享机密看起来像:e21e428f20db4d6d90c9192b9b7b2a75

1)21004表示您尝试测试自动更新订阅,并且AppsFlyer没有共享密钥。

请联系support@appsflyer.com获取更多详细信息。


如果您不使用Auto-Renewable Subscription,但仍然收到此错误,该怎么办:21004

Apple在沙盒模式下进行测试存在一些问题。尝试创建一个新的测试者帐户,然后再次进行测试。过去,一旦您使用帐户A来测试Auto-Renewable Subscription,其他所有尝试测试其他类型购买的尝试,例如使用帐户A进行的消耗性,非消耗性,非续订订阅-Apple返回相同的错误21004

希望它可以为您提供帮助

相关问题