d954mas / defold-yodo1-mas

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yodo1 MAS for Defold

MAS is the world’s highest-performing game monetization platform.

Grow revenue, get paid quickly, and focus on what you love: making great games.

Installing MAS instantly powers up your game with 15 ad networks and mediators. MAS will always show the ads that bring you the most revenue.

If you try it. Please use my refferal link :)

MAS Android sdk integration

This is experimental project.

WARNING

  1. Only android
  2. Not all api binding
  3. Callback not save script instance.
  4. Not test in production.
  5. Banner and interstitial not visible in test mode(problem with sdk. For test ads sdk trying to get root view cast it to frame layaout and add ad view. It not worked with native view of defold).
  6. Only android is supported.

If you like the extension you can support me on patreon. It will help me make more items for defold.

Installation

1) Add defold-yodo1-mas in your own project as a Defold library dependency. Open your game.project file and in the dependencies field under project add: https://github.com/d954mas/defold-yodo1-mas/archive/refs/tags/0.5.0.zip

2) Use /yodo1-mas/yodo1-mas.appmanifest.

3) Add admob key from mas [yodo1_mas] app_id_android = ca-app-pub-...

EMMYLUA

Supports emmylua. yodo1_mas_header

EXAMPLE

main.script

API

---@class Yodo1Mas  
local MAS = {}  
  
MAS.ALIGN = {  
  BannerLeft = 1,  
  BannerHorizontalCenter = 2,  
  BannerRight = 4,  
  BannerTop = 8,  
  BannerVerticalCenter = 16,  
  BannerBottom = 32,  
}  
  
  
---@class Yodo1MasAdBuildConfig  
---@field enableAdaptiveBanner boolean|nil  
---@field enableUserPrivacyDialog boolean|nil  
---@field userAgreementUrl string|nil  
---@field privacyPolicyUrl string|nil  
  
---@param config Yodo1MasAdBuildConfig  
function MAS.setAdBuildConfig(config) end  
  
---@param appKey string  
---@param cb_success function|nil  
---@param cb_error function|nil  
function MAS.init(appKey, cb_success, cb_error) end  
  
  
function MAS.setBannerListener(onAddOpened, onAddError, onAddClosed) end  
  
function MAS.setInterstitialListener(onAddOpened, onAddError, onAddClosed) end  
  
function MAS.setRewardListener(onAddOpened, onAdvertRewardEarned, onAddError, onAddClosed)  
end  
  
function MAS.showBannerAd(placement, align, offsetX, offsetY) end  
  
---@return boolean  
function MAS.isInterstitialAdLoaded() end  
  
---@param placement string|nil  
function MAS.showInterstitialAd(placement) end  
  
function MAS.isRewardedAdLoaded() end  
  
---@param placement string|nil  
function MAS.showRewardedAd(placement) end  
  
  
return MAS

About


Languages

Language:C++ 44.4%Language:Lua 34.0%Language:Java 18.3%Language:Python 2.3%Language:Batchfile 0.5%Language:C 0.5%