Flutter in_app_purchase stuck at queryProductDetails() method(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() 方法
基础教程推荐
- Kivy Buildozer 无法构建 apk,命令失败:./distribute.sh -m “kivy"d 2022-01-01
- 如何在 UIImageView 中异步加载图像? 2022-01-01
- 如何让对象对 Cocos2D 中的触摸做出反应? 2022-01-01
- Android:对话框关闭而不调用关闭 2022-01-01
- 如何在 iPhone 上显示来自 API 的 HTML 文本? 2022-01-01
- 如何在没有IB的情况下将2个按钮添加到右侧的UINavigationbar? 2022-01-01
- 在 gmail 中为 ios 应用程序检索朋友的朋友 2022-01-01
- android 应用程序已发布,但在 google play 中找不到 2022-01-01
- 当从同一个组件调用时,两个 IBAction 触发的顺序是什么? 2022-01-01
- UIWebView 委托方法 shouldStartLoadWithRequest:在 WKWebView 中等效? 2022-01-01