Package 

Class UnityAds

  • All Implemented Interfaces:

    
    public final class UnityAds
    
                        
    • Constructor Detail

    • Method Detail

      • initialize

         static void initialize(Context context, String gameId)

        Initializes Unity Ads. Unity Ads should be initialized when app starts.

        Parameters:
        context - Current Android context of calling app in favor of Application Context
        gameId - Unique identifier for a game, given by Unity Ads admin tools or Unity editor
      • initialize

         static void initialize(Context context, String gameId, IUnityAdsInitializationListener initializationListener)

        Initializes Unity Ads. Unity Ads should be initialized when app starts.

        Parameters:
        context - Current Android context of calling app in favor of Application Context
        gameId - Unique identifier for a game, given by Unity Ads admin tools or Unity editor
        initializationListener - Listener for IUnityAdsInitializationListener callbacks
      • initialize

         static void initialize(Context context, String gameId, boolean testMode)

        Initializes Unity Ads. Unity Ads should be initialized when app starts.

        Parameters:
        context - Current Android context of calling app in favor of Application Context
        gameId - Unique identifier for a game, given by Unity Ads admin tools or Unity editor
        testMode - If true, only test ads are shown
      • initialize

         static void initialize(Context context, String gameId, boolean testMode, IUnityAdsInitializationListener initializationListener)

        Initializes Unity Ads. Unity Ads should be initialized when app starts.

        Parameters:
        context - Current Android context of calling app in favor of Application Context
        gameId - Unique identifier for a game, given by Unity Ads admin tools or Unity editor
        testMode - If true, only test ads are shown
        initializationListener - Listener for IUnityAdsInitializationListener callbacks
      • isInitialized

         static boolean isInitialized()

        Checks if Unity Ads has been initialized. This might be useful for debugging initialization problems.

      • isSupported

         static boolean isSupported()

        Checks if current device supports running Unity Ads

      • show

        @Deprecated() static void show(Activity activity, String placementId)

        Show one advertisement with custom placement.

        Parameters:
        activity - Current Android activity of calling app
        placementId - Placement, as defined in Unity Ads admin tools
      • show

         static void show(Activity activity, String placementId, IUnityAdsShowListener showListener)

        Show one advertisement with custom placement and custom options.

        Parameters:
        activity - Current Android activity of calling app
        placementId - Placement, as defined in Unity Ads admin tools
        showListener - Listener for IUnityAdsShowListener callbacks
      • show

        @Deprecated() static void show(Activity activity, String placementId, UnityAdsShowOptions options)

        Show one advertisement with custom placement and custom options.

        Parameters:
        activity - Current Android activity of calling app
        placementId - Placement, as defined in Unity Ads admin tools
        options - Custom options
      • show

         static void show(Activity activity, String placementId, UnityAdsShowOptions options, IUnityAdsShowListener showListener)

        Show one advertisement with custom placement and custom options.

        Parameters:
        activity - Current Android activity of calling app
        placementId - Placement, as defined in Unity Ads admin tools
        options - Custom options
        showListener - Listener for IUnityAdsShowListener callbacks
      • setDebugMode

         static void setDebugMode(boolean debugMode)

        Toggles debug mode on/off

        Parameters:
        debugMode - If true, debug mode is on and there will be lots of debug output from Unity Ads.
      • getDebugMode

         static boolean getDebugMode()

        Get current debug mode status

      • load

        @Deprecated() static void load(String placementId)

        Request fill for a specific placement ID.

        Parameters:
        placementId - The placement ID to be loaded.
      • load

         static void load(String placementId, IUnityAdsLoadListener listener)

        Request fill for a specific placement ID.

        Parameters:
        placementId - The placement ID to be loaded.
        listener - The listener which is going to be notified about load request result.
      • load

         static void load(String placementId, UnityAdsLoadOptions loadOptions, IUnityAdsLoadListener listener)

        Request fill for a specific placement ID with custom options.

        Parameters:
        placementId - The placement ID to be loaded.
        loadOptions - Custom options.
        listener - The listener which is going to be notified about load request result.