问题标签 [billingclient]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
in-app-purchase - 在 BillingClient 设置中 .setListener(this) 引用我的调用活动而不是 PurchasesUpdatedListener
文档显示了以下设置 Billingclient 的内容。
在 .setListener(this) 中,“this”部分应该引用一个 PurchasesUpdatedListener,即使您没有明确地创建一个放入这些括号中。显然只使用“this”就足够了。在文档和我见过的所有示例中,从未创建过 PurchasesUpdatedListener 放在此处,它只是使用“this”,显然是自引用正在创建的 billingclient。不过,这对我没有用,而且我不断得到:
我应该为(活动)部分使用其他东西而不是(getApplicationContext())吗?我在这里尝试过(这个)和其他各种事情,因为“活动”这个词无法识别。
android - 检查 SkuDetails 订阅计费频率
在使用 Google Billing 的 Android 开发中,我如何获得一个计费频率Subscription
SkuDetails.subscriptionPeriod()返回一个日期字符串。例如,有没有办法获得计费频率,monthly或者yearly我是否必须巧妙地编写代码以匹配我在控制台中的内容?
android - 如何在第二台设备上恢复购买(INAPP 和 SUBS)
我有以下情况:
用户在其设备 A上的应用程序上购买订阅。稍后,他购买了设备 B并使用设备 A的相同帐户对其进行配置。他在设备 B上安装了相同的应用程序,但他在设备 A 上进行的购买在设备 A上不可用。
如何让设备 B识别购买?我尝试使用BillingClient#purchaseHistoryResponseListener,但即使它确实返回了最近的购买,也无法说购买是否处于活动状态(如果它作为 SUBS)或者它是否还没有被消费(如果它是 INAPP) .
java - Android Studio - BillingClient 不支持错误
运行我的应用程序时,我的日志中出现此错误:
我最近添加了应用程序购买。在模拟器中运行。
任何想法为什么会这样?这是我已经实现的build.gradle:
android - Android 应用内购买计费客户端在构建时崩溃
我是 Android 应用内购买的新手。我已遵循官方文档,并且在尝试构建 BillingClient 时应用程序崩溃,因此我无法超越构建 BillingClient。非常感谢任何帮助或对 Java 中的 android 应用内购买的任何参考。我的 MainActivity.java 代码如下:
崩溃日志如下:
android - Android Google Billing Client - onSkuDetailsResponse Always Empty List
I was wondering could you help. I followed the instructions at https://developer.android.com/google/play/billing/integrate, but I cannot seem to get the purchase flow working. The billing seems to setup ok, but when I try to query for my in-app products, the list is always returning empty. Can someone please help?
In my app level build.gradle file, I have included the Google Billing SDK:
Then I have created an activity to test out the code. It first initialises the BillingClient and starts the connection. The connection seems to finish the setup correctly. Once setup correctly, I then try to query the products that I have available in my Google Play Console under 'Store presence' > 'In-app products' > 'Manage products'
The following is then the code in the Activity that should kick off the process and return the SkuDetails list, but unfortunately it is returning back empty.
android - 何时调用 BillingClient.endConnection()?
从谷歌文档,它提到
完成此对象后,不要忘记调用 endConnection() 以确保正确清理。该对象绑定到应用内计费服务和管理器以处理广播事件,除非您正确处理它,否则它将泄漏。如果您在 onCreate(Bundle) 方法中创建了对象,那么推荐的处置位置是 onDestroy() 方法。
在我的应用程序中,它会在加载页面(LoadingActivity)中检查谷歌的购买状态,然后如果用户想要购买更多产品,他必须去购物页面(ShoppingActivity)。
如上所述,我应该在 LoadingActivity 和 ShoppingActivity 中添加BillingClient.endConnection() 。每次去购物页面,都要调用BillingClient.startConnection(this);离开购物页面时调用BillingClient.endConnection() 。
java - querySkuDetailsAsync 正在返回带有 BillingResult 代码 SERVICE_UNAVAILABLE 的空列表
将 BillingClient 升级到 3.0.0 后,我开始让大约 20% 的用户SERVICE_UNAVAILABLE在查询应用内购买时看到。skuDetailsList 也是空的。根据文档,SERVICE_UNAVAILABLE意味着网络已关闭,但客户端在尝试查询 SKU 详细信息后如何返回并发送此信息OK?startConnection此外,我看到了一些ERROR,即代码 6。我是否有一些不正确的实现,或者我只是向用户显示一些“发生错误。稍后再试”消息?我也没有在 Play 管理中心看到任何国家或任何可能导致这种情况的警告。
android - 查询 Google Play Developer API 时出现意外错误。请检查您是否使用了正确的服务帐号
我正在实施Android Billing 客户端 Library V 3.0。在 Billing Client v 3.0 中,您必须使用后端服务器来处理订阅状态。为此,您必须将您的谷歌云帐户与您的游戏控制台帐户相关联。所以我创建了服务帐户并将其与 Google Play 控制台相关联。我已获得已发布经理的许可。现在我面临的问题是,当谷歌云查询通过我的 Firebase 服务器的云功能播放控制台时,它说“查询 Google Play Developer API 时出现意外错误。请检查您是否使用正确的服务帐户”和“当前用户没有足够的权限来执行请求的操作“一种解决方案(”https://github.com/android/play-billing-samples/issues/350 “)这个问题是我在堆垛机上看到的溢出和谷歌成员的建议是“我必须等待24-48小时后将服务帐户链接到游戏控制台并授予访问权限。”我已经等了 4 天,但这个解决方案对我不起作用。
如果有人有与我的问题相关的解决方案,我将非常感谢。谢谢你。
#android-studio #billingclient_V3.0 #android #play-blling-library #in-app-billing
android - 为什么 Android 无法识别“BillingClient”
我正在遵循本指南。
https://developer.android.com/google/play/billing/integrate
我的 build.gradle 看起来像这样:
依赖{
}
Android Studios 4 中的 Java 代码没有针对 BillingClient 的推荐导入
如果我尝试这个:import android.billingclient ...“billingclient”显示为红色/无法识别。
如果我尝试这个:import androidx.billingclient ...“billingclient”显示为红色/无法识别。
如果我尝试这个:import import com.android.billingclient ...“android”显示为红色/无法识别。
我正在尝试将游戏移植到 Android。我已经坚持了好几天了。任何帮助是极大的赞赏!!!
请帮忙!!谢谢!!

