【问题标题】:AppsFlyer’s SDK receipt validation failsAppsFlyer 的 SDK 收据验证失败
【发布时间】: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


    【解决方案1】:

    如你所知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,所有其他尝试使用帐户A 测试其他类型的购买,例如消耗性、非消耗性、非续订订阅-Apple 返回相同的错误@987654337 @。

    希望对你有帮助,

    【讨论】:

    • 感谢您的回复。然而,appsflyer 支持团队表示他们无法为 iOS 自动续订添加密钥。 appsflyer 是否真的提供 iOS 自动订阅的收据验证?
    猜你喜欢
    • 2012-07-14
    • 2014-10-17
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多