Skip to content

API Rererences

im-ade edited this page Nov 13, 2024 · 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 形式の文字列。

ErrorCode

2.0.0 +

ErrorCode = Int

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

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

Clone this wiki locally