Git Product home page Git Product logo

more-ads's Introduction

GodotAds

Godot all in one ads module for Android. (Customizable)

Platform GodotEngine LICENCE PATREON

Cloning

cd ${GODOT_ROOT}/modules/
git clone https://github.com/FrogSquare/GodotAds GodotAds

and you must configure your module by editing ${GODOT_ROOT}/modules/GodotAds/config.py

build = {
"admob"         : True,
"adcolony"      : True,
"chartboost"    : True,
"vungle"        : True,
"mopub"         : True,
"unity_ads"     : True,
}

Setting up

sdk and dependency for (Chartboost and Vungle) Download the sdk to ${GODOT_ROOT}/modules/GodotAds/libs/

Chartboost: Android SDk Vungle: Android SDK UnityAds: Android SDK

Initialize AdMob

var AdMob = Globals.get_singleton("AdMob")

var _dict = Dictionary()
_dict["BannerAd"] = false
_dict["InterstitialAd"] = false
_dict["RewardedVideoAd"] = false
_dict["BannerGravity"] = "BOTTOM" # or TOP
_dict["BannerAdId"] = "your banner ad id"
_dict["InterstitialAdId"] = "your interstitial ad id"
_dict["RewardedVideoAdId"] = "rewarded video ad id"

AdMob.init(_dict, get_instance_ID())

Initialize AdColony

var AdColony = Globals.get_singleton("GDAdColony")

var _dict = Dictionary()
_dict["app_id"] = "adcolotn app id"
_dict["zone_ids"] = "adcolony interstitial zone ids" # (e.g) "jkedbciujdcoidcj,iyhfecujncuofevef,ikyvejcnilnuvel"
_dict["reward_ids"] = "adcolony rewarded zone id" # (e.g) "jkedbciujdcoidcj,iyhfecujncuofevef,ikyvejcnilnuvel"
_dict["dialog"] = true # or false

AdColony.init(_dict, get_instance_ID())

Initialize Chartboost

var Chartboost = Globals.get_singleton("GDChartboost")
var _dict = Dictionary()
_dict["app_id"] = "Your chartboost app id" 
_dict["app_signature"] = "your chartboost signature"

Chartboost.init(_dict, get_instance_ID())

Initialize Vungle

var Vungle = Globals.get_singleton("GDVungle")

var _dict = Dictionary()
_dict["app_id"] = "your vungle app"

Vungle.init(_dict, get_instance_ID())

Initialize MoPub

var Mopub = Globals.get_singleton("GDMopub")

var _dict = Dictionary()
_dict["BannerAd"] = true
_dict["InterstitialAd"] = true
_dict["BannerGravity"] = "BOTTOM" # or TOP
_dict["BannerAdId"] = "your banner unit id"
_dict["InterstitialAdId"] = "your interstitial unit id"

Mopub.init(_dict, get_instance_ID())

Initialize UnityAds

var Unityads = Globals.get_singleton("GDUnityAds")

var _dict = Dictionary()
_dict["GameId"] = "Your game ID"

Unityads.init(_dict, get_instance_ID())

Callbacks

adding the callback funtion so we can recive event log/states from the module

func _receive_message (from, key, value) {
	# Receive message
}

API

AdMob

AdMob.show_banner_ad(true) # show banner ad
AdMob.show_banner_ad(false) # hide banner ad

AdMob.show_interstitial_ad() # Show Interstitial Ad

AdMob.show_rewarded_video() # Show Rewarded Ad

AdColony

AdColony.show(String zone_id) # Show AdColony for the zone id

Chartboost

Chartboost.show_interstitial_ad()
Chartboost.show_rewarded_video()

Vungle

Vungle.show()

MoPub

AdMob.show_banner_ad(true) # show banner ad
AdMob.show_banner_ad(false) # hide banner ad

AdMob.show_interstitial_ad() # Show Interstitial Ad

Unity Ads

Unityads.show("Location id")

Log adb

adb -d logcat godot:V GoogleService:V GodotAds:V DEBUG:V AndroidRuntime:V ValidateServiceOp:V *:S

and if using our GodotFireBase module replace GodotAds with FireBase

adb -d logcat godot:V GoogleService:V FireBase:V DEBUG:V AndroidRuntime:V ValidateServiceOp:V *:S

more-ads's People

Contributors

rameshravone avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.