How do I differentiate from which store app is ins

2019-03-05 10:24发布

问题:

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 ?

回答1:

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