Flutter in_app_purchase 卡在 queryProductDetails() 方法

Flutter in_app_purchase stuck at queryProductDetails() method(Flutter in_app_purchase 卡在 queryProductDetails() 方法)

本文介绍了Flutter in_app_purchase 卡在 queryProductDetails() 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#in_app_purchase我在我的颤振应用程序中使用 in_app_purchase.https://pub.dev/packages/in_app_purchase首先,我将 RevenueCat 服务用于我的 IAP 服务,但由于无法从 Revenue Cat 购买代币.我决定使用flutter官方的in_app_purchase.当我从 Google Play 查询我的所有产品时,显然采用这种方法.程序卡在

#in_app_purchase I'm using in_app_purchase in my flutter app. https://pub.dev/packages/in_app_purchase Firstly I was using RevenueCat services for my IAP services but due to the unavailability of purchase tokens from Revenue Cat. I decided to use flutter official's in_app_purchase. Apparently in this approach when I query for all my products from Google Play. The program is stuck at

InAppPurchase.instance.queryProductDetails();

方法并且没有给出任何响应.甚至没有错误.我也启动了 InAppPurchase 实例,但它仍然给我带来了问题.有人可以帮忙解决一下吗?

method and isn't giving any response. Not even an error. I have also initiated the InAppPurchase instance but still, it's getting me the issue. Can anybody please help figure this out?

推荐答案

我一直在与同样的问题作斗争,终于找到了解决方案.

I was battling against the same problem and finally found the solution.

这部分需要从应用级别的build.gradle 文件中移除,以便in_app_purchase 正常工作.一旦我删除了这两行,一切都完美无缺.

This part needs to be removed from the app-level build.gradle file in order for in_app_purchase to work properly. Once I removed these two lines, everything worked flawlessly.

def billing_version = "4.0.0"
implementation "com.android.billingclient:billing:$billing_version"

这非常具有误导性,因为 in_app_purchase 包链接到 "Getting开始"Google Play 指南,其中明确表示要添加这两行.

This it terribly misleading, since the in_app_purchase package links to the "Getting started" guide for Google Play, which explicitly says to add these two lines.

这篇关于Flutter in_app_purchase 卡在 queryProductDetails() 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:Flutter in_app_purchase 卡在 queryProductDetails() 方法

基础教程推荐