通过应用内支付查看付费应用版本

Check the paid app version through in-app billing

我的应用在 Google Play 中有两个版本 免费付费

我想将 inappbillingv3 添加到免费版本并从 Google Play 中删除付费版本。

如果用户安装了免费版并购买了升级到PRO版的项目,那么我能知道他们是否已经安装了付费版吗?

您可以使用 PackageManagergetApplicationInfo 方法

检查应用是否已安装
public abstract ApplicationInfo getApplicationInfo (String packageName, int flags)

Retrieve all of the information we know about a particular package/application.

Throws PackageManager.NameNotFoundException if an application with the given package name cannot be found on the system. Parameters packageName The full name (i.e. com.google.apps.contacts) of an application. flags Additional option flags. Use any combination of GET_META_DATA, GET_SHARED_LIBRARY_FILES, GET_UNINSTALLED_PACKAGES to modify the data returned. Returns

ApplicationInfo Returns ApplicationInfo object containing information about the package. If flag GET_UNINSTALLED_PACKAGES is set and if the package is not found in the list of installed applications, the application information is retrieved from the list of uninstalled applications(which includes installed applications as well as applications with data directory ie applications which had been deleted with DONT_DELETE_DATA flag set).