KivMob

class kivmob.KivMob(appID)

Allows access to AdMob functionality on Android devices.

add_test_device(device)

Add test device ID, which will tigger test ads to be displayed on that device

Parameters:device (string) – The test device ID of the Android device.
destroy_banner()

Destroys current banner ad.

destroy_interstitial()

Destroys current interstitial ad.

hide_banner()

Hide current banner ad.

is_interstitial_loaded()

Check if the interstitial ad has loaded.

load_rewarded_ad(unitID)

Load rewarded video ad.

Parameters:unitID (string) – AdMob rewarded video ID for mobile application.
new_banner(unitID, top_pos=True)

Create a new mobile banner ad.

Parameters:
  • unitID (string) – AdMob banner ID for mobile application.
  • top_pos (boolean) – Positions banner at the top of the page if True, bottom if otherwise.
new_interstitial(unitID)

Create a new mobile interstitial ad.

Parameters:unitID (string) – AdMob interstitial ID for mobile application.
request_banner(options={})

Request a new banner ad from AdMob.

request_interstitial(options={})

Request a new interstitial ad from AdMob.

set_rewarded_ad_listener(listener)

Set listener object for rewarded video ads.

Parameters:listener (AdMobRewardedVideoAdListener) – Handles callback functionality for rewarded video ads.
show_banner()

Displays banner ad, if it has loaded.

show_interstitial()

Displays interstitial ad, if it has loaded.

show_rewarded_ad()

Display rewarded video ad.

class kivmob.RewardedListenerInterface

Interface for objects that handle rewarded video ad callback functions

on_rewarded(reward_name, reward_amount)

Called when the video completes

Parameters:
  • reward_name (string) – Name of the reward.
  • reward_amount (string) – Amount of the reward.
on_rewarded_video_ad_closed()

Called when the user manually closes the ad before completion.

on_rewarded_video_ad_completed()

Called when the rewarded video ad completes.

on_rewarded_video_ad_failed_to_load(error_code)

Called when the rewarded video ad fails to load.

Parameters:error_code (int) – Integer code that corresponds to the error.
on_rewarded_video_ad_left_application()

Called when the user closes the application while the video is playing.

on_rewarded_video_ad_loaded()

Called when the rewarded ad finishes loading.

on_rewarded_video_ad_opened()

Called when the rewarded ad is opened.

on_rewarded_video_ad_started()

Called when the rewarded video ad starts.

class kivmob.TestIds

Enum of test ad ids provided by AdMob. This allows developers to test displaying ad without setting up an AdMob account.

APP = 'ca-app-pub-3940256099942544~3347511713'

Test Banner Ad ID

BANNER = 'ca-app-pub-3940256099942544/6300978111'

Test Interstitial Ad ID

INTERSTITIAL = 'ca-app-pub-3940256099942544/1033173712'

Test Interstitial Video Ad ID

INTERSTITIAL_VIDEO = 'ca-app-pub-3940256099942544/8691691433'

Test Rewarded Video Ad ID