0

AdMob ad serving is limited to certain apps due to "invalid traffic concerns". I realized that the apps were getting installed outside of Google Play in certain countries. (For example - https://www.9apps.com/bn/android-apps).

I want to disable ads if the app is not downloaded from Google Play. So is there a way to detect whether or not an app is downloaded from Google Play?

I have gone through multiple threads in stackoverflow, but all suggest us to use PackageManager which doesn't work on Android 11+ (without special permission). Some suggest Mobile App Attestion solution (eg. from Firebase), but that is for securing server APIs from apps that impersonate our mobile app.

So any inputs on how I can differentiate the source from where the apps were downloaded/installed from will he helpful. Thanks.

Shrinidhi K
  • 28
  • 1
  • 8
  • duplicate question refer https://stackoverflow.com/questions/37539949/detect-if-an-app-is-installed-from-play-store – trinadh thatakula Jun 28 '22 at 11:14
  • Does this answer your question? [Detect if an app is installed from Play store](https://stackoverflow.com/questions/37539949/detect-if-an-app-is-installed-from-play-store) – trinadh thatakula Jun 28 '22 at 11:15
  • @trinadhthatakula Thanks for the reply. The accepted answer in the above links point to PackageManager solution which won't work on Android 11+. The other solution is regarding securing server APIs from apps that impersonate our apps. Both of which doesn't solve the problem I stated. – Shrinidhi K Jun 28 '22 at 12:27
  • use app check firebase api – trinadh thatakula Jun 29 '22 at 04:10
  • https://firebase.google.com/docs/app-check check this out and use that in conjunction with remote config to stop ads to load on all other sources except play store version also u can even make your app close automatically I think, use play integrity – trinadh thatakula Jun 29 '22 at 04:12
  • 1
    The first link should work on Android 11 as well as you are not going to be `querying` for installed app packages. You'd simply be checking the installer source. – Darshan Jun 30 '22 at 10:42

0 Answers0