Quick Tutorial: How to Use Appodeal on Godot Engine
Autor: Shin-NiL | Publicado: 2015-12-20T15:49:00-02:00

This is a quick and simple tutorial explaining how to use Appodeal ads on Godot Engine. If you're considering to use ads in your Godot android application, Appodeal is a good alternative, since it allows you to display ads from all major advertising networks such as Admob, Amazon, Unity, etc, with only one SDK.


Step 1Download and compile GodotAppodeal module from this repository. You can find more details on how to compile it here and here.&nbsp; 
Note: if you don't want to compile the module by yourself, here's the binaries files I've compiled, use it at your own risk:
Debug package (Godot 1.1)
Release package (Godot 1.1)
Debug package (Godot 2.0)
Release package (Godot 2.0 untested)&nbsp;
Release package (Godot 2.0.2 &amp; Appodeal 1.14.12)
Release &amp; Debug (Godot 2.1 &amp; Appodeal 1.15.7)&nbsp;
Release &amp; Debug (Godot 2.1.1 &amp; Appodeal 1.15.7 untested)
Release &amp; Debug (Godot 2.1.2 &amp; Appodeal 1.15.7 untested)

Step 2&nbsp;Edit the project engine.cfg file and add the following two lines for Godot 1.1:[android]
modules="com/android/godot/GodotAppodeal"
or for Godot 2.0:
[android]
modules="org/godotengine/godot/GodotAppodeal" 
Step 3On the project export settings, edit the Custom Package and locate the GodotAppodeal module file.Step 4On the same screen you'll need to select the following permissions:Access Network State
Internet
Write External Storage


Step 5
Now you'll be able to use the module functions on your scripts. To see the full functions and callbacks available check the GodotAppodeal repository.

Here's a sample code to show a bottom banner:
func _ready():
 get_node("show_banner_button").connect("pressed", self, "_on_show_banner_button_pressed")
 init_appodeal()

#####

#initialize function
func init_appodeal():
 if (Globals.has_singleton("Appodeal")):
  appodeal = Globals.get_singleton("Appodeal")
  appodeal.init(get_instance_ID(), 'YOUR APPODEAL APP ID', 'banner', true)
  
#####

func _on_show_banner_button_pressed():
 if appodeal != null:
  if appodeal.isBannerLoaded():
   appodeal.showBannerAd('bottom')


This module is Android only, so you'll not be able to run it on your computer. You'll need to export to a real device or Android emulator for that.&nbsp;&nbsp;

If you get any trouble, don't forget, logcat is your friend. Connect to your device and run via command line:
adb logcat -s godot
If you want to see the ads in action, check my published game. If you don't have a Appodeal account yet, please use my affiliate link to create one.

Was this post useful for you? Feel free to buy me a beer, or just download and rate my Numbers Fusion :P

<input name="encrypted" type="hidden" value="-----BEGIN PKCS7-----MIIHNwYJKoZIhvcNAQcEoIIHKDCCByQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYCaLRzDMhywYU2r+N452GrB4IZjEtcpu2/LmPeE/sqNvDu5kRjc5B6lap5hmVFttzjJTiB+LpNIzhUSIDoRqDboXfy1vgMv0O8J/OXPgQ7FtVqzQab1opu5L3s7tZRhTsu/X3OrTjQ4wLl6JJQPaVywsbbGhZZNY5a0YX+FfuMk9TELMAkGBSsOAwIaBQAwgbQGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIjNZKOWj94U+AgZAfeW30o8eoZuL8H2yr/RI+s2O07PWu3GS981tX5ofpfU/5v6c+Z43tcsfVD4E8Tjy58vKQGaO1G5Er/FD2bB8DfvNI7ooHeKUiXmQmjhA01uhtfJ38jvvViOPFMH8MbgBCs/PDiStReSgH1D+MIb9RTvPL5NJJXfx1DxoHYqDXptnyRqteNDGNnsBVYQztesagggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20w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