ドキュメント

​
​

Development

User Acquisition

Monetization

産業

Unity Offerwall

Offerwall Android SDK

Offerwall iOS SDK

Offerwall Unity SDK

Unity Offerwall

Tapjoy Offerwall
​
​
概要
  • クイックスタート
  • 手動での統合
  • 変更履歴
  • 更新ガイド
  • SDK リファレンス
  • Offerwall 移行チェックリスト
Placements
  • ゲーム内通貨
  • SDK /SDK
  • Offerwall 移行ガイド
テスト
  • テストデバイス
  • 例
Advanced
  • ユーザープライバシー
  • ユーザープロパティ
Cocos2dx
  • C++ ライブラリ
  • C++ API リファレンス
  1. ゲームの成長
  2. Unity Offerwall
  3. iOS SDK

SDK /SDK

Tapjoy の iOS SDK リファレンスの中を見て回り、プレースメントのリクエスト、コールバックの処理、広告コンテンツの表示、コア SDK 機能の統合を行う方法を確認できます。
読み終わるまでの所要時間 10 分
最終更新 7日前

プレースメントのリクエスト

まず、ファイルの先頭に
TJPlacement.h
をインポートします。
#import <Tapjoy/TJPlacement.h>
// Import already happens automatically through your bridging header
次に、TJPlacement クラスのインスタンスを作成し、プレースメント名で初期化します。コード内のプレースメント名の文字列が、ダッシュボード内のプレースメント名と正確に一致していることを確認します。コールバックを受け取るデリゲートを実装することもできます (後述)。
TJPlacement *p = [TJPlacement placementWithName:@"Main Menu" delegate:self];
let p = TJPlacement(name: "Main Menu", delegate: self)
最後に、コンテンツをリクエストします。
[p requestContent];
p?.requestContent()
コンテンツをリクエストする前に、Tapjoy の接続呼び出しが成功したことを確認してください。TJC_CONNECT_SUCCESS 通知を確認する前にリクエストしないでください。

コンテンツの事前キャッシュ

最高のユーザー体験を提供するために、ユーザーにそのコンテンツが表示されるコンテンツを事前にリクエストします。例えば、プレースメントがメインメニューのボタンの場合、アプリケーションの起動時に、Tapjoy Connect の呼び出しが成功した直後にコンテンツをリクエストすることをお勧めします。コンテンツをリクエストするまで待つと、多くの場合、ユーザーはコンテンツがロードされるまで、ローディングスピナーを見ながら待たされることになります。広告の場合、ユーザーが広告に関与する可能性が低くなり、収益を得る可能性が低くなります。

TJPlacement コールバック

コンテンツリクエストの状態に関するフィードバックを取得するには、以下の TJPlacementDelegate メソッドを実装します。
- (void)requestDidSucceed:(TJPlacement*)placement{} // Called when the content request returns from the Offerwall servers. Does not necessarily mean that content is available.- (void)requestDidFail:(TJPlacement*)placement error:(NSError*)error{}- (void)contentIsReady:(TJPlacement*)placement{} //This is called when the content is actually available to display. - (void)contentDidAppear:(TJPlacement*)placement{} - (void)contentDidDisappear:(TJPlacement*)placement{}
func requestDidSucceed(_ placement: TJPlacement!) {} // コンテンツリクエストが Offerwall のサーバーから返されるときに呼び出されます。Does not necessarily mean that content is available.func requestDidFail(_ placement: TJPlacement!, error:Error!) {}func contentIsReady(_ placement: TJPlacement!) {} //This is called when the content is actually available to display.func contentDidAppear(_ placement: TJPlacement!) {}func contentDidDisappear(_ placement: TJPlacement!) {}

プレースメントの表示

コンテンツを実際に表示するには、以下のように show を呼び出します。
[p showContentWithViewController: nil];
p.showContent(with: nil)
showContentWithViewController
に "nil" を渡すと、Offerwall SDK は広告の表示を処理する独自のビューコントローラーを作成します。ほとんどの場合、これが最も安全なオプションです。複雑なビュー階層があり、何らかの理由で表示を自分で管理する必要がある場合は、任意で独自のビューコントローラーを
showContentWithViewController
に渡すことができます。このメソッドに渡される ViewController が最上位のビューであり、他のビューによって邪魔されず、Tapjoy のコンテンツが削除されるまで他のビューがこのビューの上に配置されないことがきわめて重要です。
show を呼び出す前にコンテンツの準備ができていることを確認します。
if (p.isContentReady) {   [p showContentWithViewController: nil];}else {  //handle situation where there is no content to show, or it has not yet downloaded.}
if (p.isContentReady) { p.showContent(with: nil)} else {  //handle situation where there is no content to show, or it has not yet downloaded.}
お勧めのベストプラクティスは、ビデオを含む可能性のあるプレースメントからコンテンツを表示する前にアプリのオーディオをミュートすることです。ミュートしないと、ビデオとアプリのオーディオが競合する可能性があります。
多くの場合、contentIsReady デリゲートが発生するまで待ってから、ユーザーにコンテンツを表示することをお勧めします。こうすることにより、コンテンツが実際にデバイス上にあること、遅延なくユーザーに表示できることを確認できます。もう 1 つの同等の方法は、上の例のように、
p.isContentReady
が true かどうかを確認することです。

コンテンツの再リクエスト

プレースメントからユーザーにコンテンツを正常に表示したら、コンテンツを再度リクエストして (例えば
[p requestContent];
を再度呼び出し)、別のコンテンツ単位でそのプレースメントを "リロード" する必要があります。
[p showContentWithViewController: self];
を再度呼び出すことはできません。コンテンツをリクエストする前にコンテンツを表示しようとすると、コンテンツの表示に失敗します。

Tapjoy コンテンツアクションリクエストの処理

Reward (ゲーム内報酬) や IAP Promotion (アプリ内課金プロモーション) などの Tapjoy コンテンツタイプでは、そのコンテンツ単位で渡されたパラメーターに基づいてコードがアクションを実行する必要があります。例えば、Reward コンテンツ単位はアイテム名 (string) と数量 (integer) がユーザーに渡されることを指定します。ゲーム内報酬を反映するためにユーザーの広告在庫を実際に調整するのはアプリケーションです。以下の TJActionRequestDelegate メソッドが呼び出され、コンテンツ単位から適切な情報が渡されます。
- (void)placement:(TJPlacement*)placement didRequestPurchase:(TJActionRequest*)request productId:(NSString*)productId { //called when user clicks the product link in IAP promotion content //implement code here to trigger IAP purchase flow for item here}- (void)placement:(TJPlacement*)placement didRequestReward:(TJActionRequest*)request itemId:(NSString*)itemId quantity:(int)quantity { //called when the reward content is closed by the user //implement code here to give the player copies of item }
func placement(_ placement:TJPlacement!, didRequestPurchase request:TJActionRequest!, productId:String!) { //called when user clicks the product link in IAP promotion content //implement code here to trigger IAP purchase flow for item here}func placement(_ placement:TJPlacement!, didRequestReward request:TJActionRequest!, itemId:String!, quantity:Int32) { //called when the reward content is closed by the user //implement code here to give the player copies of item}

エントリーポイントの設定

任意で、各プレースメントの "エントリーポイント" を Tapjoy に伝えることができます。以下のさまざまなプリセット値から選択できます。
TJEntryPointUnknown //Not set, but removes any value that was already setTJEntryPointOtherTJEntryPointMainMenuTJEntryPointHudTJEntryPointExitTJEntryPointFailTJEntryPointCompleteTJEntryPointInbox TJEntryPointInitialisationTJEntryPointStore
TJEntryPoint.unknownTJEntryPoint.otherTJEntryPoint.mainMenuTJEntryPoint.hudTJEntryPoint.exitTJEntryPoint.failTJEntryPoint.completeTJEntryPoint.inboxTJEntryPoint.initialisationTJEntryPoint.store
プレースメントオブジェクトの作成後、かつコンテンツをリクエストする前にエントリーポイントを設定します。
TJPlacement *placement = [TJPlacement placementWithName:@"myPlacement" delegate:nil];[placement setEntryPoint:TJEntryPointMainMenu];[placement requestContent];
let placement = TJPlacement(name: "myPlacement", delegate: nil)placement?.entryPoint = TJEntryPoint.mainMenuplacement?.requestContent()

Copyright © 2026 Unity Technologies
法規事項プライバシーポリシークッキーDocumentation Terms of Use私の個人情報を販売または共有しないプライバシーに関する選択 (クッキー設定)

"Unity" の名称、Unity のロゴ、およびその他の Unity の商標は、米国およびその他の国における Unity Technologies またはその関係会社の商標または登録商標です (詳しくはこちら)。その他の名称またはブランドは該当する所有者の商標です。

一部のページは利便性向上のため機械翻訳を使用しており、内容に不正確な表現が含まれる場合があります。内容に齟齬または不一致が生じた場合は、英語版を正本とします。

  • このページ
    • プレースメントのリクエスト

    • コンテンツの事前キャッシュ

    • TJPlacement コールバック

    • プレースメントの表示

    • コンテンツの再リクエスト

    • Tapjoy コンテンツアクションリクエストの処理

    • エントリーポイントの設定


このページの問題を報告する