├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── GodotAppodeal.gdap
├── godotappodeal
├── src
│ └── main
│ │ ├── res
│ │ └── xml
│ │ │ └── network_security_config.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ └── ru
│ │ └── poqxert
│ │ └── godotappodeal
│ │ └── GodotAppodeal.java
└── build.gradle
├── LICENSE
├── gradle.properties
├── .gitignore
├── gradlew.bat
├── gradlew
└── README.md
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':godotappodeal'
2 | rootProject.name = "Godot Appodeal Plugin"
3 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PoqXert/godot-appodeal-android-plugin/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/GodotAppodeal.gdap:
--------------------------------------------------------------------------------
1 | [config]
2 |
3 | name="GodotAppodeal"
4 | binary_type="local"
5 | binary="GodotAppodeal.1.0.1.release.aar"
6 |
7 | [dependencies]
8 |
9 | remote=["com.appodeal.ads:sdk:2.7.1.+"]
10 | custom_maven_repos=["https://artifactory.appodeal.com/appodeal"]
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jul 03 19:52:34 VLAT 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
7 |
--------------------------------------------------------------------------------
/godotappodeal/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 127.0.0.1
11 |
12 |
--------------------------------------------------------------------------------
/godotappodeal/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/godotappodeal/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | ext.pluginVersionCode = 1
4 | ext.pluginVersionName = "1.1.0"
5 |
6 | android {
7 | compileSdk 31
8 | buildToolsVersion "30.0.3"
9 | compileOptions {
10 | sourceCompatibility JavaVersion.VERSION_1_8
11 | targetCompatibility JavaVersion.VERSION_1_8
12 | }
13 | defaultConfig {
14 | minSdkVersion 14
15 | targetSdkVersion 30
16 | versionCode pluginVersionCode
17 | versionName pluginVersionName
18 | multiDexEnabled true
19 | }
20 | ndkVersion '21.4.7075529'
21 | libraryVariants.all { variant ->
22 | variant.outputs.all { output ->
23 | output.outputFileName = "GodotAppodeal.$pluginVersionName.${variant.name}.aar"
24 | }
25 | }
26 | }
27 |
28 | dependencies {
29 | implementation 'androidx.appcompat:appcompat:1.1.0'
30 | implementation 'com.appodeal.ads:sdk:2.11.1.+'
31 | implementation 'androidx.multidex:multidex:2.0.1'
32 | compileOnly fileTree(dir: 'libs', includes: ['godot-lib*.aar'])
33 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Poq Xert
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.aar
4 | *.ap_
5 | *.aab
6 |
7 | # Files for the ART/Dalvik VM
8 | *.dex
9 |
10 | # Java class files
11 | *.class
12 |
13 | # Generated files
14 | bin/
15 | gen/
16 | out/
17 | # Uncomment the following line in case you need and you don't have the release build type files in your app
18 | # release/
19 |
20 | # Gradle files
21 | .gradle/
22 | build/
23 |
24 | # Local configuration file (sdk path, etc)
25 | local.properties
26 |
27 | # Proguard folder generated by Eclipse
28 | proguard/
29 |
30 | # Log Files
31 | *.log
32 |
33 | # Android Studio Navigation editor temp files
34 | .navigation/
35 |
36 | # Android Studio captures folder
37 | captures/
38 |
39 | # IntelliJ
40 | *.iml
41 | .idea/workspace.xml
42 | .idea/tasks.xml
43 | .idea/gradle.xml
44 | .idea/assetWizardSettings.xml
45 | .idea/dictionaries
46 | .idea/libraries
47 | # Android Studio 3 in .gitignore file.
48 | .idea/caches
49 | .idea/modules.xml
50 | # Comment next line if keeping position of elements in Navigation Editor is relevant for you
51 | .idea/navEditor.xml
52 |
53 | # Keystore files
54 | # Uncomment the following lines if you do not want to check your keystore files in.
55 | #*.jks
56 | #*.keystore
57 |
58 | # External native build folder generated in Android Studio 2.2 and later
59 | .externalNativeBuild
60 | .cxx/
61 |
62 | # Google Services (e.g. APIs or Firebase)
63 | # google-services.json
64 |
65 | # Freeline
66 | freeline.py
67 | freeline/
68 | freeline_project_description.json
69 |
70 | # fastlane
71 | fastlane/report.xml
72 | fastlane/Preview.html
73 | fastlane/screenshots
74 | fastlane/test_output
75 | fastlane/readme.md
76 |
77 | # Version control
78 | vcs.xml
79 |
80 | # lint
81 | lint/intermediates/
82 | lint/generated/
83 | lint/outputs/
84 | lint/tmp/
85 | # lint/reports/
86 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # godot-appodeal-android-plugin
2 | Appodeal Android SDK for Godot
3 |
4 | API Compatible with [Godot Appodeal iOS module](https://github.com/PoqXert/godot-appodeal-ios-module) (exclude [platform specific](#android-only)).
5 |
6 | ## Setup
7 |
8 | If not already done, make sure you have enabled and successfully set up Android Custom Builds. Grab the``GodotAppodeal`` plugin binary and config from the releases page and put both into res://android/plugins. The plugin should now show up in the Android export settings, where you can enable it.
9 |
10 | Add to ``res://android/build/build.gradle`` in ``android -> defaultConfig``:
11 | ```
12 | multiDexEnabled true
13 | ```
14 | By default, the plugin uses all networks and all ad types. You can use [Mediation Wizart](https://wiki.appodeal.com/en/android/2-6-5-android-sdk-integration-guide/mediation-wizard) and change dependencies in ``GodotAppodeal.gdap``.
15 | For example:
16 | ```ini
17 | [dependencies]
18 |
19 | remote=["com.appodeal.ads.sdk:core:2.6.5",
20 | "com.appodeal.ads.sdk.networks:a4g:2.6.5.2",
21 | "com.appodeal.ads.sdk.networks:adcolony:2.6.5.4",
22 | "com.appodeal.ads.sdk.networks:applovin:2.6.5.4",
23 | "com.appodeal.ads.sdk.networks:appodealx:2.6.5.1",
24 | "com.appodeal.ads.sdk.networks:chartboost:2.6.5.1",
25 | "com.appodeal.ads.sdk.networks:facebook:2.6.5.3",
26 | "com.appodeal.ads.sdk.networks:admob:2.6.5.2",
27 | "com.appodeal.ads.sdk.networks:inmobi:2.6.5.1",
28 | "com.appodeal.ads.sdk.networks:ironsource:2.6.5.3",
29 | "com.appodeal.ads.sdk.networks:my_target:2.6.5.3",
30 | "com.appodeal.ads.sdk.networks:ogury:2.6.5.3",
31 | "com.appodeal.ads.sdk.networks:startapp:2.6.5.5",
32 | "com.appodeal.ads.sdk.networks:tapjoy:2.6.5.2",
33 | "com.appodeal.ads.sdk.networks:vast:2.6.5.1"]
34 | ```
35 |
36 | You can add the optional permissions to AndroidManifest.xml (res://android/build) file under the manifest tag to improve ad targeting:
37 | ```xml
38 |
39 |
40 |
41 |
42 |
43 | ```
44 |
45 | ### AdMob
46 |
47 | If you use AdMob, add meta-data to AndroidManifest.xml in ````:
48 | ```xml
49 |
50 |
53 | ```
54 |
55 | ## Usage
56 |
57 | To use the ``GodotAppodeal`` API you first have to get the ``GodotAppodeal`` singleton:
58 | ```gdscript
59 | var _appodeal
60 |
61 | func _ready():
62 | if Engine.has_singleton("GodotAppodeal"):
63 | _appodeal = Engine.get_singeton("GodotAppodeal")
64 | ```
65 | ### Initialization
66 |
67 | To initialization Appodeal SDK call ``initialize`` method:
68 | ```gdscript
69 | func initialize(app_key: String, ad_types: int, consent: bool) -> void
70 | ```
71 | For example:
72 | ```gdscript
73 | _appodeal.initialize("YOU_ANDROID_APPODEAL_APP_KEY", 8, false)
74 | ```
75 | ### Ad Types
76 |
77 | The adTypes parameter in the code is responsible for the ad formats you are going to implement into your app.
78 | You can define enum for it:
79 | ```gdscript
80 | enum AdType {
81 | INTERSTITIAL = 1,
82 | BANNER = 2,
83 | NATIVE = 4,
84 | REWARDED_VIDEO = 8,
85 | NON_SKIPPABLE_VIDEO = 16,
86 | }
87 | ```
88 | Ad types can be combined using "|" operator.
89 |
90 | ### Show Styles
91 |
92 | The showStyles parameter use for show ad.
93 | You can define enum for it:
94 | ```gdscript
95 | enum ShowStyle {
96 | INTERSTITIAL = 1,
97 | BANNER_TOP = 2,
98 | BANNER_BOTTOM = 4,
99 | REWARDED_VIDEO = 8,
100 | NON_SKIPPABLE_VIDEO = 16,
101 | }
102 | ```
103 |
104 | ### Methods
105 |
106 | #### Initialization
107 |
108 | ```gdscript
109 | # Initialization Appodeal SDK
110 | func initialize(app_key: String, ad_types: int, consent: bool) -> void
111 | ```
112 | ```gdscript
113 | # Checking initialization for ad type
114 | func isInitializedForAdType(ad_type: int) -> bool
115 | ```
116 |
117 | #### Display ad
118 |
119 | ```gdscript
120 | # Display ad
121 | func showAd(show_style: int) -> bool
122 | ```
123 | ```gdscript
124 | # Display ad for specified placement
125 | func showAdForPlacement(show_style: int, placement: String) -> bool
126 | ```
127 | ```gdscript
128 | # Check ability to display ad
129 | func canShow(show_style: int) -> bool
130 | ```
131 | ```gdscript
132 | # Check ability to display ad for specified placement
133 | func canShowForPlacement(ad_type: int, placement: String) -> bool
134 | ```
135 | ```gdscript
136 | # Hide banner
137 | func hideBanner()
138 | ```
139 |
140 | #### Configure SDK
141 |
142 | ```gdscript
143 | # Enable/Disable testing
144 | func setTestingEnabled(enabled: bool) -> void
145 | ```
146 | ```gdscript
147 | # Disable specified networks
148 | func disableNetworks(networks: Array) -> void
149 | ```
150 | ```gdscript
151 | # Disable specified networks for ad type
152 | func disableNetworksForAdType(networks: Array, ad_type: int) -> void
153 | ```
154 | ```gdscript
155 | # Disable specified network
156 | func disableNetwork(network: String) -> void
157 | ```
158 | ```gdscript
159 | # Disable specified network for ad type
160 | func disableNetworkForAdType(network: String, ad_type: int) -> void
161 | ```
162 | ```gdscript
163 | # Disable location tracking (use before initialization).
164 | # setLocationTracking(true) don't have effect on Android.
165 | func setLocationTracking(enabled: bool) -> void
166 | ```
167 | ```gdscript
168 | # Disable data collection for kids apps
169 | func setChildDirectedTreatment(for_kids: bool) -> void
170 | ```
171 | ```gdscript
172 | # Change GDPR consent status
173 | func updateConsent(consent: bool) -> void
174 | ```
175 | ```gdscript
176 | # Disable write external storage permission check (Android-only)
177 | func disableWriteExternalStoragePermissionCheck() -> void
178 | ```
179 | ```gdscript
180 | # Set logging
181 | func setLogLevel(log_level: int) -> void
182 | ```
183 | ```gdscript
184 | # Mute videos if call volume is muted (Android-only)
185 | func muteVideosIfCallsMuted(mute: bool) -> void
186 | ```
187 | ```gdscript
188 | # Send extra data
189 | func setExtras(data: Dictionary) -> void
190 | ```
191 | ```gdscript
192 | # Set segment filter
193 | func setSegmentFilter(filter: Dictionary) -> void
194 | ```
195 | ```gdscript
196 | # Enable/Disable smart banners
197 | func setSmartBannersEnabled(enabled: bool) -> void
198 | ```
199 | ```gdscript
200 | # Enable/Disable banner animation
201 | func setBannerAnimationEnabled(enabled: bool) -> void
202 | ```
203 | ```gdscript
204 | # Enable/Disable 728x90 banners
205 | # Enable if 1, otherwise disable
206 | func setPreferredBannerAdSize(size: int) -> void
207 | ```
208 |
209 | #### Caching
210 |
211 | ```gdscript
212 | # Enable/Disable autocache
213 | func setAutocache(enabled: bool, ad_type: int) -> void
214 | ```
215 | ```gdscript
216 | # Check autocache enabled
217 | func isAutocacheEnabled(ad_type: int) -> bool
218 | ```
219 | ```gdscript
220 | # Check cache
221 | func isPrecacheAd(ad_type: int) -> bool
222 | ```
223 | ```gdscript
224 | # Cache
225 | func cacheAd(ad_type: int) -> void
226 | ```
227 |
228 | #### User Settings
229 |
230 | ```gdscript
231 | # Set user ID for S2S callbacks
232 | func setUserId(user_id: String) -> void
233 | ```
234 | ```gdscript
235 | # Set user age
236 | func setUserAge(age: int) -> void
237 | ```
238 | ```gdscript
239 | # Set user gender
240 | func setUserGender(gender: int) -> void
241 | ```
242 |
243 | #### Other
244 |
245 | ```gdscript
246 | # Get predicted eCPM for ad type
247 | func getPredictedEcpmForAdType(ad_type: int) -> float
248 | ```
249 | ```gdscript
250 | # Get Reward info for placement
251 | func getRewardForPlacement(placement: String) -> Dictionary
252 | ```
253 | Reward Dictionary have ``currency`` and ``amount`` keys.
254 | ```gdscript
255 | # Track in-app purchases
256 | func trackInAppPurchase(amount: float, currency: String) -> void
257 | ```
258 |
259 | ## Signals
260 |
261 | ### Interstitial
262 |
263 | ```gdscript
264 | # Emit when interstitial is loaded
265 | signal interstitial_loaded(precached: bool)
266 | ```
267 | ```gdscript
268 | # Emit when interstitial failed to load
269 | signal interstitial_load_failed()
270 | ```
271 | ```gdscript
272 | # Emit when interstitial is shown
273 | signal interstitial_shown()
274 | ```
275 | ```gdscript
276 | # Emit when interstitial show failed
277 | signal interstitial_show_failed()
278 | ```
279 | ```gdscript
280 | # Emit when interstitial is clicked
281 | signal interstitial_clicked()
282 | ```
283 | ```gdscript
284 | # Emit when interstitial is closed
285 | signal interstitial_closed()
286 | ```
287 | ```gdscript
288 | # Emit when interstitial is expired
289 | signal interstitial_expired()
290 | ```
291 |
292 | ### Banner
293 |
294 | ```gdscript
295 | # Emit when banner is loaded
296 | signal banner_loaded(precached: bool)
297 | ```
298 | ```gdscript
299 | # Emit when banner failed to load
300 | signal banner_load_failed()
301 | ```
302 | ```gdscript
303 | # Emit when banner is shown
304 | signal banner_shown()
305 | ```
306 | ```gdscript
307 | # Emit when banner show failed
308 | signal banner_show_failed()
309 | ```
310 | ```gdscript
311 | # Emit when banner is clicked
312 | signal banner_clicked()
313 | ```
314 | ```gdscript
315 | # Emit when banner is expired
316 | signal banner_expired()
317 | ```
318 |
319 | ### Rewarded Video
320 |
321 | ```gdscript
322 | # Emit when rewarded video is loaded
323 | signal rewarded_video_loaded(precache: bool)
324 | ```
325 | ```gdscript
326 | # Emit when rewarded video failed to load
327 | signal rewarded_video_load_failed()
328 | ```
329 | ```gdscript
330 | # Emit when rewarded video is shown
331 | signal rewarded_video_shown()
332 | ```
333 | ```gdscript
334 | # Emit when rewarded video show failed
335 | signal rewarded_video_show_failed()
336 | ```
337 | ```gdscript
338 | # Emit when rewarded video is viewed until the end
339 | signal rewarded_video_finished(amount: float, currency: String)
340 | ```
341 | ```gdscript
342 | # Emit when rewarded video is closed
343 | signal rewarded_video_closed(finished: bool)
344 | ```
345 | ```gdscript
346 | # Emit when rewarded video is expired
347 | signal rewarded_video_expired()
348 | ```
349 | ```gdscript
350 | # Emit when rewarded video is clicked
351 | signal rewarded_video_clicked()
352 | ```
353 |
354 | ### Non-Skippable Video
355 |
356 | ```gdscript
357 | # Emit when non-skippable video is loaded
358 | signal non_skippable_video_loaded(precache: bool)
359 | ```
360 | ```gdscript
361 | # Emit when non-skippable video failed to load
362 | signal non_skippable_video_load_failed()
363 | ```
364 | ```gdscript
365 | # Emit when non-skippable video is shown
366 | signal non_skippable_video_shown()
367 | ```
368 | ```gdscript
369 | # Emit when non-skippable video show failed
370 | signal non_skippable_video_show_failed()
371 | ```
372 | ```gdscript
373 | # Emit when non-skippable video is viewed until the end
374 | signal non_skippable_video_finished()
375 | ```
376 | ```gdscript
377 | # Emit when non-skippable video is closed
378 | signal non_skippable_video_closed(finished: bool)
379 | ```
380 | ```gdscript
381 | # Emit when non-skippable video is expired
382 | signal non_skippable_video_expired()
383 | ```
384 | ## Android-only
385 | This methods available on Android only.
386 | ### Methods
387 | ```gdscript
388 | # Request Android M permissions
389 | func requestAndroidMPermissions() -> void
390 | ```
391 |
--------------------------------------------------------------------------------
/godotappodeal/src/main/java/ru/poqxert/godotappodeal/GodotAppodeal.java:
--------------------------------------------------------------------------------
1 | package ru.poqxert.godotappodeal;
2 |
3 | import android.app.Activity;
4 | import android.util.Pair;
5 | import android.view.View;
6 | import android.widget.FrameLayout;
7 |
8 | import com.appodeal.ads.Appodeal;
9 | import com.appodeal.ads.BannerCallbacks;
10 | import com.appodeal.ads.InterstitialCallbacks;
11 | import com.appodeal.ads.NonSkippableVideoCallbacks;
12 | import com.appodeal.ads.RewardedVideoCallbacks;
13 | import com.appodeal.ads.UserSettings;
14 | import com.appodeal.ads.utils.Log;
15 |
16 | import org.godotengine.godot.Dictionary;
17 | import org.godotengine.godot.Godot;
18 | import org.godotengine.godot.plugin.GodotPlugin;
19 | import org.godotengine.godot.plugin.SignalInfo;
20 | import org.godotengine.godot.plugin.UsedByGodot;
21 |
22 | import androidx.annotation.NonNull;
23 | import androidx.annotation.Nullable;
24 |
25 | import java.util.HashSet;
26 | import java.util.Set;
27 |
28 | public class GodotAppodeal extends GodotPlugin {
29 | private Activity activity;
30 |
31 | private FrameLayout layout = null;
32 |
33 | public GodotAppodeal(Godot godot) {
34 | super(godot);
35 | activity = getActivity();
36 | }
37 |
38 | @Nullable
39 | @Override
40 | public View onMainCreate(Activity activity) {
41 | layout = new FrameLayout(activity);
42 | return layout;
43 | }
44 |
45 | @NonNull
46 | @Override
47 | public String getPluginName() {
48 | return "GodotAppodeal";
49 | }
50 |
51 | @NonNull
52 | @Override
53 | public Set getPluginSignals() {
54 | Set signalInfoSet = new HashSet<>();
55 | // Interstitial
56 | signalInfoSet.add(new SignalInfo("interstitial_loaded", Boolean.class));
57 | signalInfoSet.add(new SignalInfo("interstitial_load_failed"));
58 | signalInfoSet.add(new SignalInfo("interstitial_show_failed"));
59 | signalInfoSet.add(new SignalInfo("interstitial_shown"));
60 | signalInfoSet.add(new SignalInfo("interstitial_closed"));
61 | signalInfoSet.add(new SignalInfo("interstitial_clicked"));
62 | signalInfoSet.add(new SignalInfo("interstitial_expired"));
63 | // Banner
64 | signalInfoSet.add(new SignalInfo("banner_loaded", Boolean.class));
65 | signalInfoSet.add(new SignalInfo("banner_load_failed"));
66 | signalInfoSet.add(new SignalInfo("banner_shown"));
67 | signalInfoSet.add(new SignalInfo("banner_clicked"));
68 | signalInfoSet.add(new SignalInfo("banner_expired"));
69 | // Rewarded video
70 | signalInfoSet.add(new SignalInfo("rewarded_video_loaded", Boolean.class));
71 | signalInfoSet.add(new SignalInfo("rewarded_video_load_failed"));
72 | signalInfoSet.add(new SignalInfo("rewarded_video_shown"));
73 | signalInfoSet.add(new SignalInfo("rewarded_video_show_failed"));
74 | signalInfoSet.add(new SignalInfo("rewarded_video_clicked"));
75 | signalInfoSet.add(new SignalInfo("rewarded_video_finished", Double.class, String.class));
76 | signalInfoSet.add(new SignalInfo("rewarded_video_closed", Boolean.class));
77 | signalInfoSet.add(new SignalInfo("rewarded_video_expired"));
78 | // Non-Skippable video
79 | signalInfoSet.add(new SignalInfo("non_skippable_video_loaded", Boolean.class));
80 | signalInfoSet.add(new SignalInfo("non_skippable_video_load_failed"));
81 | signalInfoSet.add(new SignalInfo("non_skippable_video_shown"));
82 | signalInfoSet.add(new SignalInfo("non_skippable_video_show_failed"));
83 | signalInfoSet.add(new SignalInfo("non_skippable_video_finished"));
84 | signalInfoSet.add(new SignalInfo("non_skippable_video_clicked"));
85 | signalInfoSet.add(new SignalInfo("non_skippable_video_closed", Boolean.class));
86 | signalInfoSet.add(new SignalInfo("non_skippable_video_expired"));
87 | return signalInfoSet;
88 | }
89 |
90 | private int getAdType(int value) {
91 | int res = Appodeal.NONE;
92 | if((value&1) != 0) {
93 | res |= Appodeal.INTERSTITIAL;
94 | }
95 | if((value&2) != 0) {
96 | res |= Appodeal.BANNER;
97 | }
98 | if((value&4) != 0) {
99 | res |= Appodeal.NATIVE;
100 | }
101 | if((value&8) != 0) {
102 | res |= Appodeal.REWARDED_VIDEO;
103 | } else if((value&16) != 0) {
104 | res |= Appodeal.NON_SKIPPABLE_VIDEO;
105 | }
106 | return res;
107 | }
108 |
109 | private int getShowStyle(int value) {
110 | int res = Appodeal.NONE;
111 | if((value&1) != 0) {
112 | res |= Appodeal.INTERSTITIAL;
113 | }
114 | if((value&2) != 0) {
115 | res |= Appodeal.BANNER_TOP;
116 | }
117 | if((value&4) != 0) {
118 | res |= Appodeal.BANNER_BOTTOM;
119 | }
120 | if((value&8) != 0) {
121 | res |= Appodeal.REWARDED_VIDEO;
122 | } else if((value&16) != 0) {
123 | res |= Appodeal.NON_SKIPPABLE_VIDEO;
124 | }
125 | return res;
126 | }
127 |
128 | private void setCallbacks(int types) {
129 | if((types&Appodeal.INTERSTITIAL) != 0) {
130 | Appodeal.setInterstitialCallbacks(new InterstitialCallbacks() {
131 | @Override
132 | public void onInterstitialLoaded(boolean b) {
133 | emitSignal("interstitial_loaded", b);
134 | }
135 |
136 | @Override
137 | public void onInterstitialFailedToLoad() {
138 | emitSignal("interstitial_load_failed");
139 | }
140 |
141 | @Override
142 | public void onInterstitialShown() {
143 | emitSignal("interstitial_shown");
144 | }
145 |
146 | @Override
147 | public void onInterstitialShowFailed() {
148 | emitSignal("interstitial_show_failed");
149 | }
150 |
151 | @Override
152 | public void onInterstitialClicked() {
153 | emitSignal("interstitial_clicked");
154 | }
155 |
156 | @Override
157 | public void onInterstitialClosed() {
158 | emitSignal("interstitial_closed");
159 | }
160 |
161 | @Override
162 | public void onInterstitialExpired() {
163 | emitSignal("interstitial_expired");
164 | }
165 | });
166 | }
167 | if((types&Appodeal.BANNER) != 0) {
168 | Appodeal.setBannerCallbacks(new BannerCallbacks() {
169 | @Override
170 | public void onBannerLoaded(int i, boolean b) {
171 | emitSignal("banner_loaded", b);
172 | }
173 |
174 | @Override
175 | public void onBannerFailedToLoad() {
176 | emitSignal("banner_load_failed");
177 | }
178 |
179 | @Override
180 | public void onBannerShown() {
181 | emitSignal("banner_shown");
182 | }
183 |
184 | @Override
185 | public void onBannerShowFailed() {
186 | emitSignal("banner_show_failed");
187 | }
188 |
189 | @Override
190 | public void onBannerClicked() {
191 | emitSignal("banner_clicked");
192 | }
193 |
194 | @Override
195 | public void onBannerExpired() {
196 | emitSignal("banner_expired");
197 | }
198 | });
199 | }
200 | if((types&Appodeal.REWARDED_VIDEO) != 0) {
201 | Appodeal.setRewardedVideoCallbacks(new RewardedVideoCallbacks() {
202 | @Override
203 | public void onRewardedVideoLoaded(boolean b) {
204 | emitSignal("rewarded_video_loaded", b);
205 | }
206 |
207 | @Override
208 | public void onRewardedVideoFailedToLoad() {
209 | emitSignal("rewarded_video_load_failed");
210 | }
211 |
212 | @Override
213 | public void onRewardedVideoShown() {
214 | emitSignal("rewarded_video_shown");
215 | }
216 |
217 | @Override
218 | public void onRewardedVideoShowFailed() {
219 | emitSignal("rewarded_video_show_failed");
220 | }
221 |
222 | @Override
223 | public void onRewardedVideoFinished(double v, String s) {
224 | emitSignal("rewarded_video_finished", v, s);
225 | }
226 |
227 | @Override
228 | public void onRewardedVideoClosed(boolean b) {
229 | emitSignal("rewarded_video_closed", b);
230 | }
231 |
232 | @Override
233 | public void onRewardedVideoExpired() {
234 | emitSignal("rewarded_video_expired");
235 | }
236 |
237 | @Override
238 | public void onRewardedVideoClicked() {
239 | emitSignal("rewarded_video_clicked");
240 | }
241 | });
242 | }
243 | if((types&Appodeal.NON_SKIPPABLE_VIDEO) != 0) {
244 | Appodeal.setNonSkippableVideoCallbacks(new NonSkippableVideoCallbacks() {
245 | @Override
246 | public void onNonSkippableVideoLoaded(boolean b) {
247 | emitSignal("non_skippable_video_loaded", b);
248 | }
249 |
250 | @Override
251 | public void onNonSkippableVideoFailedToLoad() {
252 | emitSignal("non_skippable_video_load_failed");
253 | }
254 |
255 | @Override
256 | public void onNonSkippableVideoShown() {
257 | emitSignal("non_skippable_video_shown");
258 | }
259 |
260 | @Override
261 | public void onNonSkippableVideoShowFailed() {
262 | emitSignal("non_skippable_video_show_failed");
263 | }
264 |
265 | @Override
266 | public void onNonSkippableVideoFinished() {
267 | emitSignal("non_skippable_video_finished");
268 | }
269 |
270 | @Override
271 | public void onNonSkippableVideoClosed(boolean b) {
272 | emitSignal("non_skippable_video_closed", b);
273 | }
274 |
275 | @Override
276 | public void onNonSkippableVideoExpired() {
277 | emitSignal("non_skippable_video_expired");
278 | }
279 | });
280 | }
281 | }
282 |
283 | @UsedByGodot
284 | public void setTestingEnabled(boolean testing) {
285 | Appodeal.setTesting(testing);
286 | }
287 |
288 | @UsedByGodot
289 | public void disableNetworks(String[] networks) {
290 | int len = networks.length;
291 | for(int i = 0; i < len; i++) {
292 | disableNetwork(networks[i]);
293 | }
294 | }
295 |
296 | @UsedByGodot
297 | public void disableNetworksForAdType(String[] networks, int adType) {
298 | int len = networks.length;
299 | for(int i = 0; i < len; i++) {
300 | disableNetworkForAdType(networks[i], adType);
301 | }
302 | }
303 |
304 | @UsedByGodot
305 | public void disableNetwork(String network) {
306 | Appodeal.disableNetwork(activity, network);
307 | }
308 |
309 | @UsedByGodot
310 | public void disableNetworkForAdType(String network, int adType) {
311 | Appodeal.disableNetwork(activity, network, getAdType(adType));
312 | }
313 |
314 | @UsedByGodot
315 | public double getPredictedEcpmForAdType(int adType) {
316 | return Appodeal.getPredictedEcpm(getAdType(adType));
317 | }
318 |
319 | @UsedByGodot
320 | public void setAutocache(boolean enabled, int adType) {
321 | Appodeal.setAutoCache(getAdType(adType), enabled);
322 | }
323 |
324 | @UsedByGodot
325 | public boolean isAutocacheEnabled(int adType) {
326 | return Appodeal.isAutoCacheEnabled(getAdType(adType));
327 | }
328 |
329 | @UsedByGodot
330 | public void initialize(String appId, int adTypes, boolean consent) {
331 | int types = getAdType(adTypes);
332 | setCallbacks(types);
333 | Appodeal.initialize(activity, appId, types, consent);
334 | }
335 |
336 | @UsedByGodot
337 | public boolean isInitializedForAdType(int adType) {
338 | return Appodeal.isInitialized(getAdType(adType));
339 | }
340 |
341 | @UsedByGodot
342 | public void setLogLevel(int level) {
343 | Appodeal.setLogLevel(Log.LogLevel.fromInteger(level));
344 | }
345 |
346 | @UsedByGodot
347 | public void setExtras(Dictionary extras) {
348 | String[] keys = extras.get_keys();
349 | int len = keys.length;
350 | for(int i = 0; i < len; i++) {
351 | String key = keys[i];
352 | Object val = extras.get(key);
353 | if(val instanceof Integer) {
354 | Appodeal.setExtraData(key, (int)val);
355 | } else if(val instanceof Double) {
356 | Appodeal.setExtraData(key, (double)val);
357 | } else if(val instanceof Boolean) {
358 | Appodeal.setExtraData(key, (boolean)val);
359 | } else if(val instanceof String) {
360 | Appodeal.setExtraData(key, (String)val);
361 | }
362 | }
363 | }
364 |
365 | @UsedByGodot
366 | public void setChildDirectedTreatment(boolean value) {
367 | Appodeal.setChildDirectedTreatment(value);
368 | }
369 |
370 | @UsedByGodot
371 | public void updateConsent(boolean consent) {
372 | Appodeal.updateConsent(consent);
373 | }
374 |
375 | @UsedByGodot
376 | public void setUserId(String userId) {
377 | Appodeal.setUserId(userId);
378 | }
379 |
380 | @UsedByGodot
381 | public void setUserAge(int age) {
382 | Appodeal.setUserAge(age);
383 | }
384 |
385 | @UsedByGodot
386 | public void setUserGender(int gender) {
387 | UserSettings.Gender g = UserSettings.Gender.fromInteger(gender);
388 | if(g != null) {
389 | Appodeal.setUserGender(g);
390 | }
391 | }
392 |
393 | @UsedByGodot
394 | public boolean canShow(int style) {
395 | return Appodeal.canShow(getShowStyle(style));
396 | }
397 |
398 | @UsedByGodot
399 | public boolean canShowForPlacement(int adType, String placementName) {
400 | return Appodeal.canShow(adType, placementName);
401 | }
402 |
403 | @UsedByGodot
404 | public boolean showAd(int style) {
405 | boolean can = canShow(style);
406 | activity.runOnUiThread(new Runnable() {
407 | @Override
408 | public void run() {
409 | Appodeal.show(activity, getShowStyle(style));
410 | }
411 | });
412 | return can;
413 | }
414 |
415 | @UsedByGodot
416 | public boolean showAdForPlacement(int style, String placementName) {
417 | boolean can = canShowForPlacement(getShowStyle(style), placementName);
418 | activity.runOnUiThread(new Runnable() {
419 | @Override
420 | public void run() {
421 | Appodeal.show(activity, getShowStyle(style), placementName);
422 | }
423 | });
424 | return can;
425 | }
426 |
427 | @UsedByGodot
428 | public void cacheAd(int adType) {
429 | Appodeal.cache(activity, getAdType(adType));
430 | }
431 |
432 | @UsedByGodot
433 | public boolean isPrecacheAd(int adType) {
434 | return Appodeal.isPrecache(getAdType(adType));
435 | }
436 |
437 | @UsedByGodot
438 | public void setSegmentFilter(Dictionary filter) {
439 | String[] keys = filter.get_keys();
440 | int len = keys.length;
441 | for(int i = 0; i < len; i++) {
442 | String key = keys[i];
443 | Object val = filter.get(key);
444 | if(val instanceof Integer) {
445 | Appodeal.setCustomFilter(key, (int)val);
446 | } else if(val instanceof Double) {
447 | Appodeal.setCustomFilter(key, (double)val);
448 | } else if(val instanceof Boolean) {
449 | Appodeal.setCustomFilter(key, (boolean)val);
450 | } else if(val instanceof String) {
451 | Appodeal.setCustomFilter(key, (String)val);
452 | }
453 | }
454 | }
455 |
456 | @UsedByGodot
457 | public void setPreferredBannerAdSize(int size) {
458 | Appodeal.set728x90Banners(size == 1);
459 | }
460 |
461 | @UsedByGodot
462 | public void hideBanner() {
463 | Appodeal.hide(activity, Appodeal.BANNER);
464 | }
465 |
466 | @UsedByGodot
467 | public void setSmartBannersEnabled(boolean enabled) {
468 | Appodeal.setSmartBanners(enabled);
469 | }
470 |
471 | @UsedByGodot
472 | public void setBannerAnimationEnabled(boolean enabled) {Appodeal.setBannerAnimation(enabled);}
473 |
474 | @UsedByGodot
475 | public Dictionary getRewardForPlacement(String placement) {
476 | Pair reward = Appodeal.getRewardParameters(placement);
477 | Dictionary res = new Dictionary();
478 | res.put("currency", reward.second);
479 | res.put("amount", reward.first);
480 | return res;
481 | }
482 |
483 | @UsedByGodot
484 | public void muteVideosIfCallsMuted(boolean mute) {
485 | Appodeal.muteVideosIfCallsMuted(mute);
486 | }
487 |
488 | @UsedByGodot
489 | public void trackInAppPurchase(double amount, String currencyCode) {
490 | Appodeal.trackInAppPurchase(activity.getApplicationContext(), amount, currencyCode);
491 | }
492 | }
493 |
--------------------------------------------------------------------------------