使用应用内购买删除广告

Removing Ad#39;s with in-app-purchase(使用应用内购买删除广告)
本文介绍了使用应用内购买删除广告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关如何通过应用内购买删除应用程序中的广告的教程或说明?

I'm searching for a tutorial or an explanation on how to remove advertisement in my application with in-app purchase?

我会在我的应用中放置一些带有 ad-mob 的广告,但我也希望用户可以在支付一点捐款时禁用这些广告.你知道一个网站或教程,我可以在其中找到如何执行此操作的分步说明吗?

I will put some ads with ad-mob in my app but I also want, that the user can disable the ads when he pays a little donation. Do you know a site or tutorial where I can find a step-by-step explanation how to do this?

或者我需要发布我的应用的 2 个版本吗?一个有广告,一个没有广告付费?

Or do I need to publish 2 versions of my app? One with ads and one without ads for paying?

推荐答案

不要使用 SharedPreferences 方法,因为如果用户刷新应用数据或卸载/重新安装您的应用,他们的无广告状态将丢失.

Don't use the SharedPreferences method because if the user flushes the app data or uninstalls/reinstalls your app their ad-free status will be lost.

几个想法:

  1. 如果您的应用具有任何基于网络的登录或授权,您可以通过更新网络数据库的客户数据来标记用户购买了无广告版本,然后在登录和验证后禁用代码中的广告.这还有一个额外的好处,那就是跟随用户使用新设备.
  2. 使用多种方法之一获取唯一的设备 ID,并将其存储在网络服务器数据库中.启动时,查询数据库以查看设备是否无广告.请参阅 Android 唯一设备 ID.不过,这仅适用于该特定设备.
  1. If your app has any kind of web based login or authorization, you can flag the user as having bought the ad free version by updating the web database's customer data and then disable ads in code following login and verification. This has the added benefit of following the user to new devices.
  2. Use one of the several ways to get a unique device id, and store that in a web server database. On startup, query the DB to see if the device is ad-free. See Android Unique Device ID. This will only work for that particular device though.

两个应用程序的方法很简单,也可以完成工作.:)

The two apps approach is simple enough to get the job done too. :)

这篇关于使用应用内购买删除广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)