项目作者: Bipinoli

项目描述 :
Facebook Audience Network plugin for Godot Engine
高级语言: Java
项目地址: git://github.com/Bipinoli/GodotFacebookAd.git
创建时间: 2020-04-25T08:23:59Z
项目社区:https://github.com/Bipinoli/GodotFacebookAd

开源协议:

下载


GodotFacebookAd

Facebook Audience Network plugin for Godot Engine

It supports:

  • Interstitial
  • Rewarded Video

Note:
It requires Gradle Version >= 5.6.4 so it might not work in gradle version 3.2.1 and below. I tested it in Godot 3.2.2beta1 which uses gradle 5.6.4 and it is working fine.

How to use

  • Configure, install and enable the “Android Custom Template” for your project, just follow the official documentation;
  • download this project
  • drop the facebookAd-plugin directory (from the zip package) inside the res://android/ directory on your Godot project.
  • drop the facebookAd-lib directory (from the zip package) inside the res:// directory on your Godot project.
  • on the Project -> Export -> Android -> Options -> Permissions: check the permissions for Access Network State and Internet
  • on the Project Settings -> Android -> Modules, add the string:

modules

  1. org/godotengine/godot/GodotFacebookAd

Now you’ll able to add an Admob Node to your scene (only one node should be added per scene)

node

Edit ad ids

ids

And connect its signals

signals

Sample code

In the demo directory you’ll find a working sample project where you can see how the things works on the scripting side. But you need to provide your interstitialAdId

API Reference

Properties

  1. interstitialAdId
  2. rewardedVideoAdId

Methods

  1. # show interstitial ad
  2. # next ad will be automatically loaded
  3. # for your next show call
  4. show_interstitial()
  5. # show rewarded video
  6. # next ad will be automatically loaded
  7. # for your next show call
  8. func show_rewarded_video()

Signals

  1. signal interstitial_loaded
  2. signal interstitial_displayed
  3. signal interstitial_dismissed
  4. signal interstitial_error(adError)
  5. signal interstitial_clicked
  6. signal interstitial_impression_logged
  7. signal rewarded_video_loaded
  8. signal rewarded_video_displayed
  9. signal rewarded_video_closed
  10. signal rewarded_video_error(adError)
  11. signal rewarded_video_clicked
  12. signal rewarded_video_impression_logged
  13. signal rewarded_video_completed

Troubleshooting

  • First of all, please make sure you’re able to compile the custom build for Android without the plugin, this way we can isolate the cause of the issue.

  • Using logcat for Android is the best way to troubleshoot most issues. You can filter Godot only messages with logcat using the command:
    ```
    adb logcat -s godot
    adb -d logcat GodotFacebookAd:V FAN:V godot:V *:S

```

  • GodotFacebookAd Java Singleton not found: this module is Android only, so the GodotFacebookAd Java singleton will only exists on Android platform. In other words, you will be able to run it on an Android device (or emulator) only, it will not work on editor or on another platform.

References

Based on the works of:

License

MIT license