如何进行应用内购买删除广告 [英] how to make in-app purchase remove ads
问题描述
我有一个Android游戏项目,并且正在使用ad-mob广告。但是,如果要删除广告的人必须先付款。
I have Android game project and I'm using ad-mob for ads. But, how to make if someone wants to remove ads must pay first.
您能给我教程吗,因为我是Android和Java的新手。
Can you give me the tutorial, as I'm a newbie in Android and Java
推荐答案
您只需在应用程序中进行按钮即可进行应用内购买。并且,一旦用户按下按钮,就开始了应用内流程,并删除了广告。
You can simply make a button to make in-app purchase in your application. And, once the user presses the button, starts the in-app process, and removes the ads.
标记。它可以在您的共享首选项
中,并且可以在应用内购买成功时标记为true。
Make a flag. It can be in your shared preferences
and can be marked true on successful in-app purchase.
在显示广告的所有地方都完成购买后,请检查该标志,如果该标志为假,则不显示广告。
Once the purchase is done on all places where the ad is displayed, check the flag, and if it's false then don't display ad.
关注此链接:
将Google Play应用内结算集成到Android应用中
这篇关于如何进行应用内购买删除广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!