Class IronSource

  • All Implemented Interfaces:

    
    public abstract class IronSource
    
                        

    Created by Artem on 11-Jan-17.

    • Constructor Detail

      • IronSource

        IronSource()
    • Method Detail

      • setUserId

         static void setUserId(String userId)

        Sets the userId

        Parameters:
        userId - the unique ID of your end user.
      • setLevelPlayRewardedVideoManualListener

         static void setLevelPlayRewardedVideoManualListener(LevelPlayRewardedVideoManualListener listener)

        Sets Rewarded Video flow for manual load The ironSource SDK fires several events to inform you of ad availability. By implementing the LevelPlayRewardedVideoManualListener you will receive the RewardedVideo events. Pass this object within the setLevelPlayRewardedVideoManualListener(…) method. The SDK will notify your Listener of all possible events

        Parameters:
        listener - your implementation of the LevelPlayRewardedVideoManualListener interface
      • init

         static void init(Context context, String appKey)

        Initializes the ironSource sdk with all ad units

        Parameters:
        context - the context in which the Ad Units should be presented
        appKey - the unique ID of your Application in your ironSource account.
      • init

         static void init(Context context, String appKey, InitializationListener initListener)

        Initializes the ironSource sdk with all ad units

        Parameters:
        context - the context in which the Ad Units should be presented
        appKey - the unique ID of your Application in your ironSource account.
        initListener - the listener of the init request which indicate about the init status.
      • init

         static void init(Context context, String appKey, Array<IronSource.AD_UNIT> adUnits)

        Initializes the ironSource sdk

        Parameters:
        context - the context in which the Ad Units should be presented
        appKey - the unique ID of your Application in your ironSource account.
        adUnits - desired Ad Units
      • init

         static void init(Context context, String appKey, InitializationListener initListener, Array<IronSource.AD_UNIT> adUnits)

        Initializes the ironSource sdk

        Parameters:
        context - the context in which the Ad Units should be presented
        appKey - the unique ID of your Application in your ironSource account.
        initListener - the listener of the init request which indicate about the init status.
        adUnits - desired Ad Units
      • initISDemandOnly

        @Deprecated() static void initISDemandOnly(@NotNull() Context context, String appKey, Array<IronSource.AD_UNIT> adUnits)

        DEMAND ONLY MODE Initializes the ironSource sdk

        Parameters:
        context - application context which should be passed
        appKey - the unique ID of your Application in your ironSource account.
        adUnits - desired Ad Units
      • onResume

         static void onResume(Activity activity)

        Should be tied to activity's onResume

        Parameters:
        activity - current Activity
      • onPause

         static void onPause(Activity activity)

        Should be tied to activity's onPause

        Parameters:
        activity - current Activity
      • getInterstitialPlacementInfo

         static InterstitialPlacement getInterstitialPlacementInfo(String placementName)

        Extracts Interstitial Placement object by it's name

        Parameters:
        placementName - string name of the placement to extract
      • getRewardedVideoPlacementInfo

         static Placement getRewardedVideoPlacementInfo(String placementName)

        Extracts Rewarded Video Placement object by it's name

        Parameters:
        placementName - string name of the placement to extract
      • getAdvertiserId

         static String getAdvertiserId(Context context)

        Extracts advertising id of the device

        Parameters:
        context - current context
      • shouldTrackNetworkState

         static void shouldTrackNetworkState(Context context, boolean track)

        Enables the SDK to change the availability according to network modifications, i.e. in the case of no network connection, the availability will turn to FALSE. The default of this function is False.

        Parameters:
        context - current context
        track - use true to track, false to not track
      • setLogListener

         static void setLogListener(LogListener listener)

        Sets logging listener

        Parameters:
        listener - your implementation of the LogListener interface
      • setAdaptersDebug

         static void setAdaptersDebug(boolean enabled)

        Enables or disables adapters' debug mode. Default is false. Should be called before initializing the sdk

        Parameters:
        enabled - true if you want to see debug logs from all adapters, false otherwise.
      • getISDemandOnlyBiddingData

         static String getISDemandOnlyBiddingData(Context context)

        used for demand only API

        Parameters:
        context - application context which should be passed
        Returns:

        the bidding data token

      • showRewardedVideo

         static void showRewardedVideo(@NotNull() Activity activity)

        Shows Rewarded Video ad unit

        Parameters:
        activity - activity in which the Rewarded Video should be presented
      • showRewardedVideo

         static void showRewardedVideo(String placementName)

        Shows Rewarded Video ad unit with the exact Placement you want

        Parameters:
        placementName - name of the exact placement to show Rewarded Video for
      • showRewardedVideo

         static void showRewardedVideo(@NotNull() Activity activity, String placementName)

        Shows Rewarded Video ad unit with the exact Placement you want

        Parameters:
        activity - activity in which the Rewarded Video should be presented
        placementName - name of the exact placement to show Rewarded Video for
      • isRewardedVideoAvailable

         static boolean isRewardedVideoAvailable()

        Asks for ad availability directly

        Returns:

        true if ad unit is available, false otherwise

      • setLevelPlayRewardedVideoListener

         static void setLevelPlayRewardedVideoListener(LevelPlayRewardedVideoListener listener)

        The ironSource SDK fires several events to inform you of ad availability. By implementing the LevelPlayRewardedVideoListener you will receive the RewardedVideo events. Pass this object within the setLevelPlayRewardedVideoListener(…) method. The SDK will notify your Listener of all possible events

        Parameters:
        listener - your implementation of the LevelPlayRewardedVideoListener interface
      • isRewardedVideoPlacementCapped

         static boolean isRewardedVideoPlacementCapped(String placementName)

        If you choose to use the capping and pacing tool for Rewarded Video, we recommend calling this method to verify if a certain placement has reached its ad limit. This is to ensure you don’t portray the Rewarded Video button when the placement has been capped or paced and thus will not serve the Video ad.

        Parameters:
        placementName - string name of the Placement to check
        Returns:

        true if Placement is capped, false otherwise

      • setRewardedVideoServerParameters

         static void setRewardedVideoServerParameters(Map<String, String> params)

        Enables sending server side parameters on successful rewarded video

        Parameters:
        params - A dictionary containing the parameters.
      • loadISDemandOnlyRewardedVideo

         static void loadISDemandOnlyRewardedVideo(@NotNull() Activity activity, String instanceId)

        DEMAND ONLY MODE Loads Rewarded Video ad unit

        Parameters:
        activity - activity in which the Rewarded Video should be presented
        instanceId - ironSource's instanceId which should be load
      • loadISDemandOnlyRewardedVideoWithAdm

        @Deprecated() static void loadISDemandOnlyRewardedVideoWithAdm(@NotNull() Activity activity, String instanceId, String adm)

        DEMAND ONLY MODE Loads Rewarded Video ad unit with adm for bidder instances

        Parameters:
        activity - activity in which the Rewarded Video should be presented
        instanceId - ironSource's instanceId which should be load
      • isISDemandOnlyRewardedVideoAvailable

         static boolean isISDemandOnlyRewardedVideoAvailable(String instanceId)

        DEMAND ONLY MODE Asks for ad availability directly

        Returns:

        true if ad unit is available, false otherwise

      • setISDemandOnlyRewardedVideoListener

         static void setISDemandOnlyRewardedVideoListener(ISDemandOnlyRewardedVideoListener listener)

        DEMAND ONLY MODE The ironSource SDK fires several events to inform you of ad availability. By implementing the ISDemandOnlyRewardedVideoListener you will receive the RewardedVideo events. Pass this object within the setISDemandOnlyRewardedVideoListener(…) method. The SDK will notify your Listener of all possible events

        Parameters:
        listener - your implementation of the ISDemandOnlyRewardedVideoListener interface
      • showInterstitial

        @Deprecated() static void showInterstitial(@NotNull() Activity activity)

        Serves an Interstitial ad to your users

        Parameters:
        activity - activity in which the Interstitial should be presented
      • showInterstitial

        @Deprecated() static void showInterstitial(String placementName)

        Serves an Interstitial ad to your users with the exact Placement you want

        Parameters:
        placementName - name of the exact placement to show Interstitial for
      • showInterstitial

        @Deprecated() static void showInterstitial(@NotNull() Activity activity, String placementName)

        Serves an Interstitial ad to your users with the exact Placement you want

        Parameters:
        activity - activity in which the Interstitial should be presented
        placementName - name of the exact placement to show Interstitial for
      • isInterstitialReady

        @Deprecated() static boolean isInterstitialReady()

        Asks for ad availability directly

        Returns:

        true if ad unit is ready, false otherwise

      • setLevelPlayInterstitialListener

        @Deprecated() static void setLevelPlayInterstitialListener(LevelPlayInterstitialListener listener)

        The ironSource SDK fires several events to inform you of ad availability. By implementing the LevelPlayInterstitialListener you will receive the Interstitial events. Pass this object within the setLevelPlayInterstitialListener(…) method. The SDK will notify your Listener of all possible events

        Parameters:
        listener - your implementation of the LevelPlayInterstitialListener interface
      • isInterstitialPlacementCapped

        @Deprecated() static boolean isInterstitialPlacementCapped(String placementName)

        If you choose to use the capping and pacing tool for Interstitial, we recommend calling this method to verify if a certain placement has reached its ad limit. This is to ensure you don’t portray the Interstitial button when the placement has been capped or paced and thus will not serve the Interstitial ad.

        Parameters:
        placementName - string name of the Placement to check
        Returns:

        true if Placement is capped, false otherwise

      • loadISDemandOnlyInterstitial

         static void loadISDemandOnlyInterstitial(@NotNull() Activity activity, String instanceId)

        DEMAND ONLY MODE Requests an interstitial ad with Activity

        Parameters:
        activity - activity in which the Interstitial should be presented
        instanceId - ironSource's instanceId which should be load
      • loadISDemandOnlyInterstitialWithAdm

        @Deprecated() static void loadISDemandOnlyInterstitialWithAdm(@NotNull() Activity activity, String instanceId, String adm)

        DEMAND ONLY MODE Requests an interstitial ad with adm for a bidder instance with Activity

        Parameters:
        activity - activity in which the Interstitial should be presented
        instanceId - ironSource's instanceId which should be load
      • isISDemandOnlyInterstitialReady

         static boolean isISDemandOnlyInterstitialReady(String instanceId)

        DEMAND ONLY MODE Asks for ad availability directly

        Returns:

        true if ad unit is ready, false otherwise

      • setISDemandOnlyInterstitialListener

         static void setISDemandOnlyInterstitialListener(ISDemandOnlyInterstitialListener listener)

        DEMAND ONLY MODE The ironSource SDK fires several events to inform you of ad availability. By implementing the ISDemandOnlyInterstitialListener you will receive the Interstitial events. Pass this object within the setISDemandOnlyInterstitialListener(…) method. The SDK will notify your Listener of all possible events

        Parameters:
        listener - your implementation of the ISDemandOnlyInterstitialListener interface
      • createBanner

        @Deprecated() static IronSourceBannerLayout createBanner(Activity activity, ISBannerSize size)

        Creates an IronSourceBanner view that is used to configure the banner right away, and later used to load and attach the banner to a view in your app.

        Parameters:
        activity - activity in which the Banner should be presented
        size - sets the banner size
        Returns:

        IronSourceBannerLayout view object which can be attached to your view hierarchy and used to load banner ad

      • isBannerPlacementCapped

        @Deprecated() static boolean isBannerPlacementCapped(String placementName)

        If you choose to use the capping and pacing tool for Banner, we recommend calling this method to verify if a certain placement has reached its ad limit. This is to ensure you don’t portray the Banner when the placement has been capped or paced and thus will not serve the Banner ad.

        Parameters:
        placementName - string name of the Placement to check
        Returns:

        true if Placement is capped, false otherwise

      • loadISDemandOnlyBannerWithAdm

         static void loadISDemandOnlyBannerWithAdm(@NotNull() Activity activity, ISDemandOnlyBannerLayout banner, String instanceId, String adm)

        DEMAND ONLY MODE Requests a banner ad with adm for a bidder instance with Activity

        Parameters:
        activity - activity in which the Interstitial should be presented
        banner - to load
        instanceId - ironSource's instanceId which should be load
        adm - the ad markup
      • loadISDemandOnlyBanner

         static void loadISDemandOnlyBanner(@NotNull() Activity activity, ISDemandOnlyBannerLayout banner, String instanceId)

        DEMAND ONLY MODE Requests a banner ad with Activity

        Parameters:
        activity - activity in which the Interstitial should be presented
        banner - to load
        instanceId - ironSource's instanceId which should be load
      • createBannerForDemandOnly

         static ISDemandOnlyBannerLayout createBannerForDemandOnly(Activity activity, ISBannerSize size)

        DEMAND ONLY MODE Creates an IronSourceDemandOnlyBannerLayout view that is used to configure the banner right away, and later used to load and attach the banner to a view in your app.

        Parameters:
        activity - activity in which the Banner should be presented
        size - sets the banner size
        Returns:

        ISDemandOnlyBannerLayout view object which can be attached to your view hierarchy and used to load banner ad

      • destroyISDemandOnlyBanner

         static void destroyISDemandOnlyBanner(String instanceId)

        DEMAND ONLY MODE Destroys banner and its corresponding ad

        Parameters:
        instanceId - the instanceId which is assigned to the banner
      • setSegmentListener

         static void setSegmentListener(SegmentListener listener)

        ******************************* Mediation API

      • setConsent

         static void setConsent(boolean consent)
      • setMetaData

         static void setMetaData(String key, String value)

        Sets network' metadata

        Parameters:
        value - for single value
      • setMetaData

         static void setMetaData(String key, List<String> values)

        Sets network' metadata

        Parameters:
        values - for multiple value
      • setNetworkData

         static void setNetworkData(@NotNull() String networkKey, @NotNull() JSONObject networkData)

        Sets the network data according to the network key

        Parameters:
        networkKey - Network identifier.
        networkData - a json containing the information required by the network.
      • addImpressionDataListener

         static void addImpressionDataListener(@NotNull() ImpressionDataListener listener)

        Adds impression data listener

        Parameters:
        listener - your implementation of the ImpressionDataListener interface
      • removeImpressionDataListener

         static void removeImpressionDataListener(@NotNull() ImpressionDataListener listener)

        Removes impression data listener

        Parameters:
        listener - your implementation of the ImpressionDataListener interface
      • setAdRevenueData

         static void setAdRevenueData(@NotNull() String dataSource, @NotNull() JSONObject impressionData)

        sets Ad revenue data

        Parameters:
        dataSource - the external source id from which the impression data is sent
        impressionData - the impression data
      • launchTestSuite

         static void launchTestSuite(@NotNull() Context context)

        Launch test suite mediation SDK must be initialized before calling this method

        Parameters:
        context - application context which should be passed