pythonandroidkivyadmobkivmob

Python, Kivy and KivMob - not showing test AdMob ads


I have a simple code using test IDS for AdMob. It uses test add and app IDs to run a test banner code. I have successfully compiled and uploaded it. But, nothing happens - no ads, whatsoever.

What am I doing wrong? Code:

Banner Ad Test Program

`
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivmob import KivMob, TestIds


class AdApp(App):
    def build(self):
        self.kivmob = KivMob("ca-app-pub-3940256099942544~3347511713")  # Test App ID
        self.kivmob.new_banner("ca-app-pub-3940256099942544/6300978111")  # Test Banner ID
        self.kivmob.request_banner()

        layout = BoxLayout(orientation='horizontal')
        exit_button = Button(text='Exit', size_hint=(0.1, 0.1))
        exit_button.bind(on_press=self.exit_app)

        layout.add_widget(exit_button)
        return layout

    def exit_app(self, instance):
        App.get_running_app().stop()


if __name__ == '__main__':
    AdApp().run()`

Tried on various phones (both old and new). No ads show.


Solution

  • This the way you can use kivmob . https://github.com/Sahil-pixel/Youtube-Kivy-Kivymd/tree/main/ADMOB_KIVY_UPDATED