Class IronSource
-
- All Implemented Interfaces:
public abstract class IronSourceCreated by Artem on 11-Jan-17.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumIronSource.AD_UNITThis enum represents the available Ad Units: REWARDED_VIDEO, INTERSTITIAL, BANNER, NATIVE_AD
-
Constructor Summary
Constructors Constructor Description IronSource()
-
Method Summary
Modifier and Type Method Description static voidsetUserId(String userId)Sets the userId static voidsetLevelPlayRewardedVideoManualListener(LevelPlayRewardedVideoManualListener listener)Sets Rewarded Video flow for manual load The ironSource SDK fires several events to inform you of ad availability. static voidinit(Context context, String appKey)Initializes the ironSource sdk with all ad units static voidinit(Context context, String appKey, InitializationListener initListener)Initializes the ironSource sdk with all ad units static voidinit(Context context, String appKey, Array<IronSource.AD_UNIT> adUnits)Initializes the ironSource sdk static voidinit(Context context, String appKey, InitializationListener initListener, Array<IronSource.AD_UNIT> adUnits)Initializes the ironSource sdk static voidinitISDemandOnly(@NotNull() Context context, String appKey, Array<IronSource.AD_UNIT> adUnits)DEMAND ONLY MODE Initializes the ironSource sdk static voidonResume(Activity activity)Should be tied to activity's onResume static voidonPause(Activity activity)Should be tied to activity's onPause static voidsetSegment(IronSourceSegment segment)static booleansetDynamicUserId(String dynamicUserId)Sets dynamic user id static voidsetMediationType(String mediationType)static voidremoveRewardedVideoListener()Removes callback listener for Rewarded Video Ad Unit static voidremoveInterstitialListener()Removes callback listener for Interstitial Ad Unit static InterstitialPlacementgetInterstitialPlacementInfo(String placementName)Extracts Interstitial Placement object by it's name static PlacementgetRewardedVideoPlacementInfo(String placementName)Extracts Rewarded Video Placement object by it's name static StringgetAdvertiserId(Context context)Extracts advertising id of the device static voidshouldTrackNetworkState(Context context, boolean track)Enables the SDK to change the availability according to network modifications, i.e. static voidsetLogListener(LogListener listener)Sets logging listener static voidsetAdaptersDebug(boolean enabled)Enables or disables adapters' debug mode. static StringgetISDemandOnlyBiddingData(Context context)used for demand only API static voidloadRewardedVideo()Requests a Rewarded Video ad static voidshowRewardedVideo()Shows Rewarded Video ad unit static voidshowRewardedVideo(@NotNull() Activity activity)Shows Rewarded Video ad unit static voidshowRewardedVideo(String placementName)Shows Rewarded Video ad unit with the exact Placement you want static voidshowRewardedVideo(@NotNull() Activity activity, String placementName)Shows Rewarded Video ad unit with the exact Placement you want static booleanisRewardedVideoAvailable()Asks for ad availability directly static voidsetLevelPlayRewardedVideoListener(LevelPlayRewardedVideoListener listener)The ironSource SDK fires several events to inform you of ad availability. static booleanisRewardedVideoPlacementCapped(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. static voidsetRewardedVideoServerParameters(Map<String, String> params)Enables sending server side parameters on successful rewarded video static voidclearRewardedVideoServerParameters()Disables sending server side parameters on successful rewarded video static voidloadISDemandOnlyRewardedVideo(@NotNull() Activity activity, String instanceId)DEMAND ONLY MODE Loads Rewarded Video ad unit static voidloadISDemandOnlyRewardedVideoWithAdm(@NotNull() Activity activity, String instanceId, String adm)DEMAND ONLY MODE Loads Rewarded Video ad unit with adm for bidder instances static voidshowISDemandOnlyRewardedVideo(String instanceId)DEMAND ONLY MODE Shows Rewarded Video ad unit static booleanisISDemandOnlyRewardedVideoAvailable(String instanceId)DEMAND ONLY MODE Asks for ad availability directly static voidsetISDemandOnlyRewardedVideoListener(ISDemandOnlyRewardedVideoListener listener)DEMAND ONLY MODE The ironSource SDK fires several events to inform you of ad availability. static voidloadInterstitial()Requests an interstitial ad static voidshowInterstitial()Serves an Interstitial ad to your users static voidshowInterstitial(@NotNull() Activity activity)Serves an Interstitial ad to your users static voidshowInterstitial(String placementName)Serves an Interstitial ad to your users with the exact Placement you want static voidshowInterstitial(@NotNull() Activity activity, String placementName)Serves an Interstitial ad to your users with the exact Placement you want static booleanisInterstitialReady()Asks for ad availability directly static voidsetLevelPlayInterstitialListener(LevelPlayInterstitialListener listener)The ironSource SDK fires several events to inform you of ad availability. static booleanisInterstitialPlacementCapped(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. static voidloadISDemandOnlyInterstitial(@NotNull() Activity activity, String instanceId)DEMAND ONLY MODE Requests an interstitial ad with Activity static voidloadISDemandOnlyInterstitialWithAdm(@NotNull() Activity activity, String instanceId, String adm)DEMAND ONLY MODE Requests an interstitial ad with adm for a bidder instance with Activity static voidshowISDemandOnlyInterstitial(String instanceId)DEMAND ONLY MODE Serves an Interstitial ad to your users static booleanisISDemandOnlyInterstitialReady(String instanceId)DEMAND ONLY MODE Asks for ad availability directly static voidsetISDemandOnlyInterstitialListener(ISDemandOnlyInterstitialListener listener)DEMAND ONLY MODE The ironSource SDK fires several events to inform you of ad availability. static IronSourceBannerLayoutcreateBanner(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. static voidloadBanner(IronSourceBannerLayout banner)Requests Banner Ad for provided banner static voidloadBanner(IronSourceBannerLayout banner, String placementName)Requests Banner Ad for provided banner static voiddestroyBanner(IronSourceBannerLayout banner)Destroys provided banner and its corresponding ad static booleanisBannerPlacementCapped(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. static voidloadISDemandOnlyBannerWithAdm(@NotNull() Activity activity, ISDemandOnlyBannerLayout banner, String instanceId, String adm)DEMAND ONLY MODE Requests a banner ad with adm for a bidder instance with Activity static voidloadISDemandOnlyBanner(@NotNull() Activity activity, ISDemandOnlyBannerLayout banner, String instanceId)DEMAND ONLY MODE Requests a banner ad with Activity static ISDemandOnlyBannerLayoutcreateBannerForDemandOnly(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. static voiddestroyISDemandOnlyBanner(String instanceId)DEMAND ONLY MODE Destroys banner and its corresponding ad static voidsetSegmentListener(SegmentListener listener)******************************* Mediation API static voidsetConsent(boolean consent)static voidsetMetaData(String key, String value)Sets network' metadata static voidsetMetaData(String key, List<String> values)Sets network' metadata static voidsetNetworkData(@NotNull() String networkKey, @NotNull() JSONObject networkData)Sets the network data according to the network key static voidaddImpressionDataListener(@NotNull() ImpressionDataListener listener)Adds impression data listener static voidremoveImpressionDataListener(@NotNull() ImpressionDataListener listener)Removes impression data listener static voidsetAdRevenueData(@NotNull() String dataSource, @NotNull() JSONObject impressionData)sets Ad revenue data static voidlaunchTestSuite(@NotNull() Context context)Launch test suite mediation SDK must be initialized before calling this method static voidsetWaterfallConfiguration(@NotNull() WaterfallConfiguration waterfallConfiguration, @NotNull() IronSource.AD_UNIT adUnit)Set waterfall configurations for a given adUnit. -
-
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 presentedappKey- 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 presentedappKey- 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 presentedappKey- 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 presentedappKey- 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 passedappKey- 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
-
setSegment
static void setSegment(IronSourceSegment segment)
-
setDynamicUserId
static boolean setDynamicUserId(String dynamicUserId)
Sets dynamic user id
-
setMediationType
static void setMediationType(String mediationType)
-
removeRewardedVideoListener
static void removeRewardedVideoListener()
Removes callback listener for Rewarded Video Ad Unit
-
removeInterstitialListener
static void removeInterstitialListener()
Removes callback listener for Interstitial Ad Unit
-
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 contexttrack- 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
-
loadRewardedVideo
static void loadRewardedVideo()
Requests a Rewarded Video ad
-
showRewardedVideo
static void showRewardedVideo()
Shows Rewarded Video ad unit
-
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 presentedplacementName- 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.
-
clearRewardedVideoServerParameters
static void clearRewardedVideoServerParameters()
Disables sending server side parameters on successful rewarded video
-
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 presentedinstanceId- 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 presentedinstanceId- ironSource's instanceId which should be load
-
showISDemandOnlyRewardedVideo
static void showISDemandOnlyRewardedVideo(String instanceId)
DEMAND ONLY MODE Shows Rewarded Video ad unit
-
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
-
loadInterstitial
@Deprecated() static void loadInterstitial()
Requests an interstitial ad
-
showInterstitial
@Deprecated() static void showInterstitial()
Serves an Interstitial ad to your users
-
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 presentedplacementName- 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 presentedinstanceId- 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 presentedinstanceId- ironSource's instanceId which should be load
-
showISDemandOnlyInterstitial
static void showISDemandOnlyInterstitial(String instanceId)
DEMAND ONLY MODE Serves an Interstitial ad to your users
-
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 presentedsize- sets the banner size- Returns:
IronSourceBannerLayout view object which can be attached to your view hierarchy and used to load banner ad
-
loadBanner
@Deprecated() static void loadBanner(IronSourceBannerLayout banner)
Requests Banner Ad for provided banner
- Parameters:
banner- to load
-
loadBanner
@Deprecated() static void loadBanner(IronSourceBannerLayout banner, String placementName)
Requests Banner Ad for provided banner
- Parameters:
banner- to load
-
destroyBanner
@Deprecated() static void destroyBanner(IronSourceBannerLayout banner)
Destroys provided banner and its corresponding ad
- Parameters:
banner- to destroy
-
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 presentedbanner- to loadinstanceId- ironSource's instanceId which should be loadadm- 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 presentedbanner- to loadinstanceId- 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 presentedsize- 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 sentimpressionData- 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
-
setWaterfallConfiguration
static void setWaterfallConfiguration(@NotNull() WaterfallConfiguration waterfallConfiguration, @NotNull() IronSource.AD_UNIT adUnit)
Set waterfall configurations for a given adUnit.
- Parameters:
waterfallConfiguration- publisher set WaterfallConfiguration.adUnit- the target IronSource.AD_UNIT, to which the passed configs are to be applied to its corresponding waterfall requests.
-
-
-
-