【问题标题】:What is the use or meaning of restore functionality in app billing v3 in androidandroid中app billing v3中恢复功能的用途或意义是什么
【发布时间】:2013-11-21 12:54:22
【问题描述】:

我正在android应用程序中实现应用内计费v3。我可以成功购买测试产品。 但是在我的应用程序中也有恢复功能,我有点困惑。

在其他设备应用程序中加载我们应用程序中所有拥有的项目是否正确?

【问题讨论】:

  • 我认为这是必须的。您必须能够在另一台设备上恢复您拥有的产品。它必须独立于设备!
  • 感谢@osayilgan,我认为google play会根据用户的google电子邮件地址维护应用内购买的项目。对吗?
  • 嘿@jagdish 看看我编辑的答案。

标签: android restore billing


【解决方案1】:

由于您正在使用与您的 gmail 帐户相关联的 google play 中的应用内产品,因此这一切都与您的 google play 帐户有关。

这是一个示例方法,可让您了解它的工作原理。我在我的一个应用程序中使用它。

/**
 * Gets the list of available inventories in GooglePlay for this application
 * 
 * @param productIdList             list of product id's in the store
 *                                  if null, will return owned items only
 * @param inventoryListListener     OnQueryInventoryFinishedListener
 */
public void getInventoryList(List<String> productIdList, InvetoryListInterface inventoryListListener) {

    final InvetoryListInterface listener = inventoryListListener;

    inAppBillingHelper.queryInventoryAsync(productIdList, new QueryInventoryFinishedListener() {

        @Override
        public void onQueryInventoryFinished(IabResult result, Inventory inventroy) {

            if (result.isFailure()) {
                // Failure getting inventory list.
                listener.onInventoryListFailure(result.getMessage());
                return;
            } else {
                // Success getting inventory list.
                listener.onInventoryListSuccess(inventroy);
            }
        }
    });
}

【讨论】:

  • 非常感谢@osayilgan,我会试试的。
  • 它应该可以工作,我在现有应用程序中使用相同的方式。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-11-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-12-17
  • 1970-01-01
  • 2013-09-07
相关资源
最近更新 更多