android - 在 App Billing Subscription 中,检查是否已订阅

标签 android in-app-billing

我想检查用户是否订阅了该应用,

我的问题是 - 是否可以在不输入 sku 的情况下进行检查?

这就是我现在正在做的:

  IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
    public void onQueryInventoryFinished(IabResult result, final Inventory inventory) {
        if(inventory.hasPurchase(skutmp)) {
            return true;
}

我想做的是检查是否有任何购买(不使用 sku)

有什么办法吗?

编辑:

主要想法是在不从我的服务器获取列表的情况下执行此操作,那么有没有办法在商店中获取可用的产品以便我可以检查它们?

最佳答案

如果有人需要帮助,我设法找到了这个链接

https://developer.android.com/google/play/billing/billing_integrate.html

你基本上需要设置它而不是

Bundle activeSubs = mService.getPurchases(3, "com.example.myapp",
               "subs", null);

位置 0 的 bundle 将包含一个包含您所有购买的 ArrayList,所以我所做的是检查 ArrayList 的大小。

关于android - 在 App Billing Subscription 中,检查是否已订阅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44502070/

相关文章:

android - 如何关闭 Activity 并返回到android中的上一个 Activity

android - 在android中的两个日期值之间获取SQLite表中值的总和

android - 退款到 Android 上的应用内购买

android - 谷歌播放控制台 : App doesn't have any in-app products yet.

android - 使用 Android In-App Billing V3 续订订阅时,purchaseToken 是否保持不变?

Android In App Purchase Order Status 收费

Android:旋转整个布局

Android Dagger 2 和整洁的架构实现,范围错误

android - Android NDK 支持区域设置吗?

Android In App Billing - 从服务器检索信息时出错