简体   繁体   English

在已安装的应用上回调Google Play

[英]callback google play on installed app

We are creating an app where you can share an app, which sends the user to the google play store to download another app. 我们正在创建一个可以共享一个应用程序的应用程序,该应用程序会将用户发送到Google Play商店以下载另一个应用程序。 My question is, how can I know if some user actually downloaded and installed that app? 我的问题是,我怎么知道某个用户是否实际下载并安装了该应用程序? Is there a some sort of callback you get from the play store? 从Play商店获得某种回调吗?

Try calling startActivityForResult() with the Play Store intent. 尝试以Play商店意图调用startActivityForResult()。 Then, override the onActivityResult() method in your Activity and check if the app is installed. 然后,在Activity中重写onActivityResult()方法,并检查是否已安装该应用程序。 This might help: How to check programmatically if an application is installed or not in Android? 这可能会有所帮助: 如何以编程方式检查Android中是否安装了应用程序?

isAppInstalledBefore("com.example.anappblabla");

private boolean isAppInstalledBefore(String packageName) {
    PackageManager pm = getPackageManager();
    boolean installed = false;
    try {
       pm.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES);
       installed = true;
    } catch (PackageManager.NameNotFoundException e) {
       installed = false;
    }
    return installed; //returns boolean
}

No, but: 不是,但:

What I would do is trying to get the package name (generally in the URL for example: https://play.google.com/store/apps/details?id= dev.laurentmeyer.contactautocompleteview of the target app (which is unique): something like dev.laurentmeyer.whateverApp (it's the one I'm personally using). Then scan the installed apps with this Helper and you'll be sure if it has been installed or not. 我要做的是尝试获取程序包名称(例如,通常在URL中: https : //play.google.com/store/apps/details? id = dev.laurentmeyer.contactautocompleteview (目标应用程序的唯一名称) ):类似dev.laurentmeyer.whateverApp (这是我个人使用的),然后使用此Helper扫描已安装的应用程序,您将确定它是否已安装。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何知道是否通过Facebook促销或Google Play安装了应用程序? - How to know whether app is installed from Facebook promotion or Google play? 如何将Play Framework与Google App Engine和本地安装的Java 7结合使用? - How to use the Play Framework with Google App Engine with locally installed Java 7? Google Play - 已安装应用内更新,但它一次又一次显示更新可用 - Google Play - In App Update is installed but it shows update available again and again 是否有可能在运行时可靠地检测安装了Android应用程序(Google Play或亚马逊市场)的商店? - Is it possible to reliably detect at runtime which store installed an Android App (Google Play or Amazon Market)? Google Play游戏成就onClose回调 - Google Play Games Achievements onClose callback 谷歌分析图表安装的应用程序到网络应用程序 - google analytics chart installed app to web app 如果未安装应用程序,如何检查是否已从我的应用程序安装了应用程序? - how to check whether an app is installed from my app if the app is not installed go to play store? 深层链接 - 从 Play 商店安装应用时获取数据 - Deep linking - Fetch data when app installed from play store Branch io - 通过 Play 商店安装应用后没有参考参数 - Branch io - No referringParams after app is installed via play store 手动安装时 APK 文件运行正常,但从 Google Play 商店安装时无法打开 - APK file runs properly when installed manually but does not open when installed from google play store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM