且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Android中删除Admob的应用内购买

更新时间:2023-02-02 20:31:14

好的,我将实现同样的事情,计划为 @reverse 告诉,但想确认其他开发人员的想法。但是,他的回答本身就是完整的,我只是给出了步骤:

ok, I am going to implement the same thing and planning it as @reverse has told but wanted to confirm how other developers are thinking. However, his answer is complete in itself, I am just giving the steps:


  1. 你已经实施了AdMob。

  2. 转到Playstore开发者帐户,然后在您的应用中添加应用内购买项目。让我们说:没有广告,名称在这里无关紧要,ID也很重要。

  3. 使用谷歌提供的IAB帮助文件,并按照如何使用它的步骤进行操作。请参阅此链接: http://developer.android .com / training / in-app-billing / preparation-iab-app.html

  4. 提供一个链接,用户可以为应用内元素支付无广告元素。

  5. 在应用程序启动检查时,通过使用上面的类检查用户是否已经支付/购买了应用内元素,将该标志标记为true。对于一致性和不重复检查,请将此变量保持为共享首选项为null。

  6. Null表示,您必须与Google Play一起检查以供用户购买。

  7. 如果购买,请将其标记为true,否则为false。

  8. 如果此标志为true:不显示广告。

  1. You already have AdMob implemented.
  2. Go to playstore developer account and in your app, Add an in-app purchase item. let's say: "No Ads", name doesn't matter here, an ID would matter.
  3. Use the IAB helper file provided by google and follow the steps how to use it. Refer to this link: http://developer.android.com/training/in-app-billing/preparing-iab-app.html
  4. Provide a link to pay for "No ads" in-app element by the user.
  5. On application startup check, by using the above class check whether user has already paid/purchased the in-app element, mark the flag to true. For consistency and unrepeated check, keep this variable in shared preference as null.
  6. Null means, You have to check with google play for purchase by the user.
  7. If purchased, mark it true else false.
  8. if this flag is true: do not show ads.