Android Google Play In-App购买返回错误代码-1008:null puchaseData或数据签名

Android Google Play In-App购买返回错误代码-1008:null puchaseData或数据签名,android,in-app-purchase,google-play,in-app-billing,Android,In App Purchase,Google Play,In App Billing,在v2中成功实现之后,我正在尝试实现它。但是,每次我尝试购买一款真正的应用内产品时,我都会收到以下后续错误: IAB返回空purchaseData或dataSignature(响应-1008:未知错误) 这是来自: 我已验证a)我的应用程序已签名,b)我的应用程序版本与Google Play store上的草稿版本匹配,以及c)尝试购买的用户已添加为测试用户。我已经在3个测试帐户和4个应用内购买订阅类型中尝试了这一点 我应该关心这个错误代码吗 这是一个仅限于非生产版本的问题吗 如果/当我发布此

在v2中成功实现之后,我正在尝试实现它。但是,每次我尝试购买一款真正的应用内产品时,我都会收到以下后续错误:

IAB返回空purchaseData或dataSignature(响应-1008:未知错误)

这是来自:

我已验证a)我的应用程序已签名,b)我的应用程序版本与Google Play store上的草稿版本匹配,以及c)尝试购买的用户已添加为测试用户。我已经在3个测试帐户和4个应用内购买订阅类型中尝试了这一点

  • 我应该关心这个错误代码吗
  • 这是一个仅限于非生产版本的问题吗
  • 如果/当我发布此版本时,这会影响我在该领域的客户吗
  • 你真的可以只在实际发布IAB版本3时对应用内购买进行端到端测试吗?我意识到我可以使用ANDROID.Test.Excel项目类型,我有(它工作),但我不认为这是一个有效的端到端测试。

    • 我自己也有这个问题。过了一会儿,我发现我做错了什么。我在服务器上调用了错误的方法

      如果使用在Google Developer Console上注册为订阅的SKU调用
      mHelper.launchPurchaseFlow(…)
      ,将导致以下错误: IAB返回空purchaseData或dataSignature(响应-1008:未知错误)


      如果您的SKU注册为订阅,则必须使用以下方法:
      mHelper.launchSubscriptionPurchaseFlow(…)

      希望这有帮助

      采购错误:IAB结果:IAB返回空采购数据或数据 签名(响应:-1008未知错误)


      如果在使用launchPurchaseFlow()方法并获得此错误时出现上述错误,请检查产品类型。我创建了订阅,但我需要托管产品,例如非耗材产品类型。我的意思是,对于Cordova和Hybrid应用程序,您需要使用
      this.iap.subscribe(this.productId)
      方法来订阅
      InAppPurchase
      ,请谨慎购买或订阅

      以下代码对我来说运行良好:

       getProdutIAP() {
              this.navCtrl.push('subscribeDialogPage');
              this.iap
                  .getProducts(['productID1']).then((products: any) => {
                      this.buy(products);
                      // alert('getProdutIAP' + JSON.stringify(products));
                  })
                  .catch((err) => {
                      console.log(JSON.stringify(err));
                      alert('Finished Purchase' + JSON.stringify(err));
                      console.log(err);
                  });
          }
      
          buy(products: any) {
              // this.getProdutIAP();
              // alert(products[0].productId);
              this.iap.subscribe(products[0].productId).then((buydata: any) => {
                  alert('buy Purchase' + JSON.stringify(buydata));
                  // this.sub();
              }).catch((err) => {
                  // this.navCtrl.push('subscribeDialogPage');
                  alert('buyError' + JSON.stringify(err));
              });
          }
      
          sub() {
              this.platform.ready().then(() => {
                  this.iap
                      .subscribe(this.productId)
                      .then((data) => {
                          console.log('subscribe Purchase' + JSON.stringify(data));
                          alert('subscribe Purchase' + JSON.stringify(data));
                          this.getReceipt();
                      }).catch((err) => {
                          this.getReceipt();
                          alert('subscribeError' + JSON.stringify(err));
                          console.log(err);
                      });
              })
          }
      

      非常感谢。就这样。Google Play开发者确实回复了我,但从未向我回复解决方案。我欠你一个人情!虽然我使用了正确的项目类型和方法,但还是出现了相同的错误。应用程序内购买有效,订阅无效。launchSubscriptionPurchaseFlow()方法依次调用launchPurchaseFlow(),itemType为“IabHelper.ITEM\u TYPE\u INAPP”。因此,如果您在launchPurchaseFlow()中传递了正确的itemType,则没有什么区别。我正在使用正确的项目类型,但仍然得到相同的错误!!!!繁荣很高兴看到这个答案,我担心我会调试几个小时。Sree——不正确,launchSubscriptionPurchaseFlow()使用itemType IabHelper.ITEM_TYPE_SUBS调用launchPurchaseFlow()。
       getProdutIAP() {
              this.navCtrl.push('subscribeDialogPage');
              this.iap
                  .getProducts(['productID1']).then((products: any) => {
                      this.buy(products);
                      // alert('getProdutIAP' + JSON.stringify(products));
                  })
                  .catch((err) => {
                      console.log(JSON.stringify(err));
                      alert('Finished Purchase' + JSON.stringify(err));
                      console.log(err);
                  });
          }
      
          buy(products: any) {
              // this.getProdutIAP();
              // alert(products[0].productId);
              this.iap.subscribe(products[0].productId).then((buydata: any) => {
                  alert('buy Purchase' + JSON.stringify(buydata));
                  // this.sub();
              }).catch((err) => {
                  // this.navCtrl.push('subscribeDialogPage');
                  alert('buyError' + JSON.stringify(err));
              });
          }
      
          sub() {
              this.platform.ready().then(() => {
                  this.iap
                      .subscribe(this.productId)
                      .then((data) => {
                          console.log('subscribe Purchase' + JSON.stringify(data));
                          alert('subscribe Purchase' + JSON.stringify(data));
                          this.getReceipt();
                      }).catch((err) => {
                          this.getReceipt();
                          alert('subscribeError' + JSON.stringify(err));
                          console.log(err);
                      });
              })
          }