Skip to content

API Rererences

im-ade edited this page Oct 7, 2025 · 2 revisions

Welcome to the MaioSDK-v2-Android wiki!

API References

MaioRequest

2.0.0 +

class MaioRequest

広告リクエストを表すクラス。

constructor(zoneId: String, testMode: Bool)

2.0.0 +

constructor(zoneId: String, testMode: Bool)

Parameters

  • zoneId
    • maio の管理画面から発行されるゾーン識別子
  • testMode
    • テストモードとしてリクエストするかどうかのフラグ。true: テストモード有効 false: 本番稼働

val zoneId: String

2.0.0 +

val zoneId: String

パラメータに与えた、maio の管理画面から発行されるゾーン識別子。

val testMode

2.0.0 +

val testMode : Boolean

パラメータに与えた、テストモードとしてリクエストするかどうかのフラグ。 true: テストモード有効 false: 本番稼働

MaioInterstitial

2.0.0 +

class Interstitial

インタースティシャル広告の読み込みと表示を管理するクラス。

static fun loadAd(request: MaioRequest, context: Context, callback: IInterstitialLoadCallback?) -> Interstitial

2.0.0 +

static fun loadAd(request: MaioRequest, context: Context, callback: IInterstitialLoadCallback?) -> Interstitial

広告を非同期にロードします。ロードに関するイベントは callback パラメーターに通知されます。

Parameters

  • request
    • 広告リクエスト。
  • context
    • 広告の読み込みに使われる context
  • callback
    • 広告の読み込みに関するイベントのコールバック。

Return Value

生成された Interstitial オブジェクト。

fun show(context: Context, callback: MaioInterstitialShowCallback?)

2.0.0 +

fun show(context: Context, callback: IInterstitialShowCallback?)

広告を非同期に表示します。表示に関するイベントは callback パラメーターに通知されます。

Parameters

  • context
    • 広告表示に使われる context
  • callback
    • 広告の表示に関するイベントのコールバック。

IInterstitialShowCallback

2.0.0 +

interface IInterstitialShowCallback

インタースティシャル広告の読み込みに関するコールバックを処理するプロトコル。

fun loaded(interstitial: Interstitial)

2.0.0 +

fun loaded(interstitial: Interstitial)

広告の読み込みが完了した時に呼ばれるイベント。

Parameters

  • interstitial
    • 呼び出し元の広告インスタンス。

fun failed(interstitial: Interstitial, errorCode: Int)

2.0.0 +

fun failed(interstitial: Interstitial, errorCode: Int)

広告の読み込みが完了した時に呼ばれるイベント。

Parameters

  • interstitial
    • 呼び出し元の広告インスタンス。
  • errorCode
    • エラー理由を示す値。詳細は ErrorCode を参照。

IInterstitialShowCallback

2.0.0 +

interface IInterstitialShowCallback

インタースティシャル広告の表示に関するコールバックを処理するプロトコル。

fun opened(interstitial: Interstitial)

2.0.0 +

fun opened(interstitial: Interstitial)

広告がオープンされた時に呼ばれるイベント。

Parameters

  • interstitial
    • 呼び出し元の広告インスタンス。

fun closed(interstitial: Interstitial)

2.0.0 +

fun closed(interstitial: Interstitial)

広告がクローズされた時に呼ばれるイベント。

Parameters

  • interstitial
    • 呼び出し元の広告インスタンス。

fun failed(interstitial: Interstitial)

2.0.0 +

fun failed(interstitial: Interstitial)

広告の表示に失敗した時に呼ばれるイベント。

Parameters

  • interstitial
    • 呼び出し元の広告インスタンス。
  • errorCode
    • エラー理由を示す値。詳細は ErrorCode を参照。

Rewarded

2.0.0 +

class Rewarded

リワード広告の読み込みと表示を管理するクラス。

static fun loadAd(request: MaioRequest, context: Context, callback: MaioRewardedLoadCallback?) -> MaioRewarded

2.0.0 +

static fun loadAd(request: MaioRequest, context: Context, callback: MaioRewardedLoadCallback?) -> MaioRewarded

広告を非同期にロードします。ロードに関するイベントは callback パラメーターに通知されます。

Parameters

  • request
    • 広告リクエスト。
  • context
    • 広告の読み込みに使われる context
  • callback
    • 広告の読み込みに関するイベントのコールバック。

Return Value

生成された MaioRewarded オブジェクト。

fun show(context: Context, callback: MaioRewardedShowCallback?)

2.0.0 +

fun show(context: Context, callback: MaioRewardedShowCallback?)

広告を非同期に表示します。表示に関するイベントは callback パラメーターに通知されます。

Parameters

  • context
    • 広告表示に使われる Context
  • callback
    • 広告の表示に関するイベントのコールバック。

RewardData

2.0.0 +

class RewardData

ユーザーに与える報酬に関するデータを扱うクラス。

val value: String

2.0.0 +

val: String

maio 管理画面にて当該ゾーンに設定したリワード データ文字列。 未設定の場合は空文字。

IRewardedLoadCallback

2.0.0 +

interface IRewardedLoadCallback

リワード広告の読み込みに関するコールバックを処理するプロトコル。

fun loaded(rewarded: Rewarded)

2.0.0 +

fun loaded(rewarded: Rewarded)

広告の読み込みが完了した時に呼ばれるイベント。

Parameters

  • rewarded
    • 呼び出し元の広告インスタンス。

fun failed(rewarded: Rewarded, errorCode: Int)

2.0.0 +

fun failed(rewarded: Rewarded, errorCode: Int)

広告の読み込みが完了した時に呼ばれるイベント。

Parameters

  • rewarded
    • 呼び出し元の広告インスタンス。
  • errorCode
    • エラー理由を示す値。詳細は ErrorCode を参照。

MaioRewardedShowCallback

2.0.0 +

interface IRewardedShowCallback

リワード広告の表示に関するコールバックを処理するプロトコル。

fun opened(rewarded: Rewarded)

2.0.0 +

fun opened(rewarded: Rewarded)

広告がオープンされた時に呼ばれるイベント。

Parameters

  • rewarded
    • 呼び出し元の広告インスタンス。

fun closed(rewarded: Rewarded)

2.0.0 +

fun closed(rewarded: Rewarded)

広告がクローズされた時に呼ばれるイベント。

Parameters

  • rewarded
    • 呼び出し元の広告インスタンス。

fun rewarded(rewarded: Rewarded, reward: RewardData)

2.0.0 +

fun rewarded(rewarded: Rewarded, reward: RewardData)

リワード付与のタイミングで通知されるイベント。 リワード動画広告の場合は視聴完了時、リワードプレイアブル広告の場合は広告で定められたタイミングで通知されます。

Parameters

  • rewarded
    • 呼び出し元の広告インスタンス。
  • reward
    • maio 管理画面にてゾーンに設定したリワード データ。

fun failed(rewarded: Rewarded, errorCode: Int)

2.0.0 +

fun failed(rewarded: Rewarded, errorCode: Int)

広告の表示に失敗した時に呼ばれるイベント。

Parameters

  • rewarded
    • 呼び出し元の広告インスタンス。
  • errorCode
    • エラー理由を示す値。詳細は ErrorCode を参照。

Version

2.0.0 +

class Version

maio SDK のバージョンを表すオブジェクト。

static fun Version.Instance.toString() : String

2.0.0 +

static fun Version.Instance.toString() : String

SDK のバージョンを表す String を返す。

Return Value

SDK のバージョンを示す、Semantic Versioning 2.0.0 形式の文字列。

MaioBannerSize

2.0.6 +

data class MaioBannerSize

バナー広告のサイズを表すクラス。

val BANNER: MaioBannerSize

2.0.6 +

val BANNER: MaioBannerSize

320 x 50 の大きさを表す。

val BIG_BANNER: MaioBannerSize

2.0.6 +

val BIG_BANNER: MaioBannerSize

320 x 100 の大きさを表す。

val MEDIUM_RECTANGLE: MaioBannerSize

2.0.6 +

val MEDIUM_RECTANGLE: MaioBannerSize

300 x 250 の大きさを表す。

MaioBannerView

2.0.6 +

class MaioBannerView : FrameLayout

バナー広告の読み込みと表示を管理するクラス。

var zoneId: String?

2.0.6 +

var zoneId: String?

maio の管理画面から発行されるゾーン識別子。

var size: MaioBannerSize?

2.0.6 +

var size: MaioBannerSize?

要求するバナーのサイズ。

var listener: MaioBannerListener?

2.0.6 +

var listener: MaioBannerListener?

PlayStore をアプリ内で表示する際のベースとなる 。

var isReady: Bool

2.0.6 +

var isReady: Bool

バナー広告が読み込み済みかどうかを示すフラグ。true: 読み込み済み false: 未読み込み。

init(Context: context, zoneId: String, size: MaioBannerSize? = null)

2.0.6 +

init(Context: context, zoneId: String, size: MaioBannerSize? = null)

コードベースで MaioBannerView を生成する際に用いるコンストラクタ。

Parameters

  • zoneId
    • maio の管理画面から発行されるゾーン識別子
  • size
    • 要求するバナーのサイズ

func load(test: Boolean= false)

2.0.6 +

func load(test: Boolean= false)

Parameters

  • testMode
    • テストモードとしてリクエストするかどうかのフラグ。true: テストモード有効 false: 本番稼働。

fun pause()

2.0.6 +

fun pause()

広告に、一時停止のメッセージを送ります。

fun resume()

2.0.6 +

fun resume()

広告に、再開のメッセージを送ります。

fun destroy()

2.0.6 +

fun destroy()

手動で広告のリソースを破棄します。以後、インスタンスは広告を動作させられません。

MaioBannerListener

2.0.6 +

interface MaioBannerListener

バナー広告に関する通知を受け取るためのプロトコル。

optional fun loaded(ad: MaioBannerView)

2.0.6 +

optional fun loaded(ad: MaioBannerView)

広告の読み込みが完了した時に呼ばれるイベント。

Parameters

  • ad
    • 呼び出し元の広告インスタンス

optional fun failedToLoad(ad: MaioBannerView, errorCode: Int)

2.0.6 +

optional fun failedToLoad(ad: MaioBannerView, errorCode: Int)

広告の読み込みに失敗した時に呼ばれるイベント。

Parameters

  • ad
    • 呼び出し元の広告インスタンス
  • errorCode
    • エラー理由を示す値。詳細は ErrorCode を参照。

optional fun impression(ad: MaioBannerView)

2.0.6 +

optional fun impression(ad: MaioBannerView)

広告のインプレッションが記録された時に呼ばれるイベント。

Parameters

  • ad
    • 呼び出し元の広告インスタンス

optional fun clicked(ad: MaioBannerView)

2.0.6 +

optional fun clicked(ad: MaioBannerView)

広告のクリックが発生した時に呼ばれるイベント。

Parameters

  • ad
    • 呼び出し元の広告インスタンス

optional fun leftApplication(ad: MaioBannerView)

2.0.6 +

optional fun leftApplication(ad: MaioBannerView)

アプリケーションからの離脱が発生した時に呼ばれるイベント。

Parameters

  • ad
    • 呼び出し元の広告インスタンス

optional fun failedToShow(ad: MaioBannerView, errorCode: Int)

2.0.6 +

optional fun failedToShow(ad: MaioBannerView, errorCode: Int)

広告の表示に失敗した時に呼ばれるイベント。

Parameters

  • ad
    • 呼び出し元の広告インスタンス
  • errorCode
    • エラー理由を示す値。詳細は ErrorCode を参照。

ErrorCode

2.0.0 +

ErrorCode = Int

コールバックから得られるエラーコード。

  • 先頭の数字は発生する場面を表しています。
    • 1xxxx : 広告の読み込み時に起こるもの
    • 2xxxx : 広告の表示時に起こるもの
  • 各エラーコードの末尾にある xx は、発生箇所やエラー要因の特定に用います。
ErrorCode 意味
0 不明、あるいは公開を想定していないもの。包括的なエラー処理などによって発生する。
101xx ネットワーク接続がありません。
102xx ネットワーク接続がタイムアウトしました。
103xx 広告の取得中に中断されました。
104xx サーバーから正しくないレスポンスが返ってきました。
105xx 存在しないゾーンが指定されました。
106xx 無効なゾーンが指定されました。
107xx 表示可能な広告がありません。
108xx MaioRequestnull でした。
109xx ディスク容量が不十分でした。
110xx 対応していない Android バージョンです。
111xx バナーサイズがありません。
201xx 広告の有効期限が切れました。
202xx 広告の準備ができていません。
203xx 広告はすでに表示されています。
204xx 広告の再生中に問題が発生しました。
205xx Contextnull でした。

Clone this wiki locally