depotnawer.blogg.se

Integration guide
Integration guide










  1. #INTEGRATION GUIDE HOW TO#
  2. #INTEGRATION GUIDE INSTALL#
  3. #INTEGRATION GUIDE ANDROID#
  4. #INTEGRATION GUIDE CODE#
  5. #INTEGRATION GUIDE FREE#

  • Open the script and add the following code:.
  • Name the script RewardedAdsButton to match the class name.
  • Select the button you added to your Scene, then add a script component to it using the Inspector ( Add Component > New Script).
  • Select Game Object > UI > Button to add a button to your Scene.
  • To configure a button in the Unity Editor: The button displays an ad when pressed, as long as ad content is available.

    #INTEGRATION GUIDE CODE#

    Use the example code below to create a rewarded ads button. Using a button that prompts the player to opt in to watching an ad is a common implementation for rewarded video ads. To reward players for completing a video ad, implement a callback method using the ShowResult result to check if the user finished the ad and should be rewarded.

    #INTEGRATION GUIDE HOW TO#

    For more information on how to effectively design your rewarded ads, see documentation on Ads best practices. For example, games may reward players with in-game currency, consumables, additional lives, or experience-multipliers. Rewarding players for watching ads increases user engagement, resulting in higher revenue. Note: If you call Show() without specifying an Ad Unit ID, the method shows loaded content in the Unity Standard Placement. Public void OnInitializationFailed(UnityAdsInitializationError error, string message)ĭebug.Log($"Unity Ads Initialization Failed: _gameId = (atform = RuntimePlatform.IPhonePlayer)Īdvertisement.Initialize(_gameId, _testMode, _enablePerPlacementMode, this) ĭebug.Log("Unity Ads initialization complete.") Public class AdsInitializer : MonoBehaviour, IUnityAdsInitializationListener In SDK versions 3.7.0 and higher, you can use IUnityAdsInitializationListener callbacks to receive a notification when initialization is complete, or receive the details when an error occurs. Initialize the SDK early in the game’s run-time life cycle, preferably at launch, using the Initialize function. In your game script header, include the UnityEngine.Advertisements namespace. You can locate the ID in the Monetize Dashboard by selecting Project Settings from the navigation bar (see the Dashboard guide section on Project Settings for details). To initialize the SDK, you must reference your project’s Game ID for the appropriate platform.

    #INTEGRATION GUIDE FREE#

    Feel free to use one of these for your first implementation if they suit your needs, or create your own.įor more information, see documentation on Ad Units.

  • Select Banner to create a dedicated Banner Ad Unit.Įvery Unity Ads-enabled project has one Ad Unit for each format (rewarded, interstitial, and banner) per platform by default.
  • Interstitial Ad Units allow players to skip the ad after a specified period of time.
  • Select Interstitial video to show basic interstitial ads or promotional content.
  • Rewarded Ad Units do not allow the player to skip the ad.
  • Select Rewarded video to allow players to opt-in to viewing ads in exchange for incentives.
  • Enter your Ad Unit ID and select its type: Create Ad Units in the Monetize Dashboard by selecting your project, then selecting Monetization > Ad Units from the navigation bar.Ĭlick the Add Ad Unit button to bring up the creation modal.
  • Select the Advertisements package from the list, then select the most recent verified version.Īd Units are surfacing points that trigger ads in your game.
  • In the Unity Editor, select Window > Package Manager to open the Package Manager.
  • Install the latest version of Unity Ads through the Unity Package Manager, by following these steps: Installing both may lead to build errors. Important: You must choose either the Asset or the package. To ensure the latest version of Unity Ads, Unity recommends installing it from the Unity Package Manager in the Editor. Set the platform to iOS or Android, then click Switch Platform.
  • Click here for the Unity (C#) API reference.īasic ads implementation Configuring your project Setting build targetsĬonfigure your project for a supported platform using the Build Settings window.
  • #INTEGRATION GUIDE ANDROID#

  • If you are an Android developer using Java, click here.
  • If you are an iOS developer using Objective-C, click here.
  • This guide covers integration for implementing Unity Ads in your made-with-Unity game.

    #INTEGRATION GUIDE INSTALL#

  • Server-to-Server (S2S) Install Tracking.
  • Integration guide for iOS (Objective-C).











  • Integration guide