如何区分百度商店/ Google Play商店安装的应用商店? [英] How do I differentiate from which store app is installed from i.e Baidu Store / Google Play Store?
问题描述
我的应用部署在Play商店以及百度商店中。对于通知,需要与应用程序的区别。
当我使用getInstallerPackageName()方法时,Redmi Note 3返回正确的值,但HTC返回null。
为什么会观察到这种差异?
有没有其他更好的方法?
: https://stackoverflow.com/a/13293534/2724879
i建议,当它为空时,它从百度,当它的 com.android.vending
那么它来自谷歌xD
My app. is deployed in Play Store as well as Baidu Store. For notificatiions, need to differentiate from where app. is installed.
When I used getInstallerPackageName() method, Redmi Note 3 returns correct value but HTC returns null.
Why is this difference observed ?
Is there any other better way ?
Regarding this answer: https://stackoverflow.com/a/13293534/2724879
i suggest that when its null then its from Baidu and when its com.android.vending
then its from google xD
这篇关于如何区分百度商店/ Google Play商店安装的应用商店?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!