public class AdColony
extends java.lang.Object
Constructor and Description |
---|
AdColony() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addCustomMessageListener(AdColonyCustomMessageListener listener,
java.lang.String type)
Call this method to set the AdColonyCustomMessageListener for custom message events in your app.
|
static boolean |
clearCustomMessageListeners()
Used to clear all currently registered AdColonyCustomMessageListeners.
|
static boolean |
configure(android.app.Activity activity,
AdColonyAppOptions options,
java.lang.String appId,
java.lang.String... zoneIds)
Configures AdColony to play ads in your app.
|
static boolean |
configure(android.app.Activity activity,
java.lang.String appId,
java.lang.String... zoneIds)
Configures AdColony to play ads in your app.
|
static boolean |
disable()
Disables AdColony from requesting and showing ads and destroys any existing VM modules for the rest of the app session.
|
static AdColonyAppOptions |
getAppOptions()
Used to retrieve the currently set app options for this session.
|
static AdColonyCustomMessageListener |
getCustomMessageListener(java.lang.String type)
Used to retrieve the currently registered AdColonyCustomMessageListener.
|
static AdColonyRewardListener |
getRewardListener()
Used to retrieve the global reward listener for this app session.
|
static java.lang.String |
getSDKVersion()
Used to retrieve the version String of the AdColony SDK.
|
static AdColonyZone |
getZone(java.lang.String zoneId)
Getter for AdColonyZone objects.
|
static boolean |
notifyIAPComplete(java.lang.String productId,
java.lang.String transId)
Used to provide AdColony with IAP information.
|
static boolean |
notifyIAPComplete(java.lang.String productId,
java.lang.String transId,
java.lang.String currencyCode,
double price)
Used to provide AdColony with IAP information.
|
static boolean |
removeCustomMessageListener(java.lang.String type)
Used to remove a specific AdColonyCustomMessageListener.
|
static boolean |
removeRewardListener()
Removes the internal reference to the reward listener to allow for collection.
|
static boolean |
requestInterstitial(java.lang.String zoneId,
AdColonyInterstitialListener listener)
Call this method to request an interstitial advertisement.
|
static boolean |
requestInterstitial(java.lang.String zoneId,
AdColonyInterstitialListener listener,
AdColonyAdOptions options)
Call this method to request an interstitial advertisement.
|
static boolean |
requestNativeAdView(java.lang.String zoneId,
AdColonyNativeAdViewListener listener,
AdColonyAdSize size)
Call this method to request a native ad view.
|
static boolean |
requestNativeAdView(java.lang.String zoneId,
AdColonyNativeAdViewListener listener,
AdColonyAdSize size,
AdColonyAdOptions options)
Call this method to request a native ad view.
|
static boolean |
setAppOptions(AdColonyAppOptions options)
Used to update/replace app options at runtime.
|
static boolean |
setRewardListener(AdColonyRewardListener listener)
Call this method to set the AdColonyRewardListener for global reward callbacks for your app.
|
public static boolean disable()
public static boolean configure(android.app.Activity activity, @NonNull java.lang.String appId, @NonNull java.lang.String... zoneIds)
activity
- the Activity that the configure request is called from.appId
- your app identifier gathered from the AdColony dashboard.zoneIds
- any number of zone ids gathered from the AdColony dashboard for your app.public static boolean configure(android.app.Activity activity, AdColonyAppOptions options, @NonNull java.lang.String appId, @NonNull java.lang.String... zoneIds)
AdColonyAppOptions
object to AdColony.activity
- the Activity that the configure request is called from.options
- the optional AdColonyAppOptions object to be sent.appId
- your app identifier gathered from the AdColony dashboard.zoneIds
- any number of zone ids gathered from the AdColony dashboard for your app.AdColonyAppOptions
public static AdColonyZone getZone(@NonNull java.lang.String zoneId)
zoneId
- the String zone id representing the zone you want information about.AdColonyZone
public static boolean notifyIAPComplete(@NonNull java.lang.String productId, @NonNull java.lang.String transId)
productId
- the product id for the item that was purchased.transId
- the transaction id for the item that was purchased.public static boolean notifyIAPComplete(@NonNull java.lang.String productId, @NonNull java.lang.String transId, java.lang.String currencyCode, double price)
productId
- the product id for the item that was purchased.transId
- the transaction id for the item that was purchased.currencyCode
- an optional currency code for the price.price
- an optional price for the item that was purchased.public static boolean requestNativeAdView(@NonNull java.lang.String zoneId, @NonNull AdColonyNativeAdViewListener listener, @NonNull AdColonyAdSize size)
zoneId
- the zone if from which to request the ad.listener
- the AdColonyNativeAdViewListener to be notified upon successful/unsuccessful request.size
- the AdColonyAdSize object representing the desired width/height of the ad view.AdColonyNativeAdView
,
AdColonyNativeAdViewListener
,
AdColonyAdSize
public static boolean requestNativeAdView(@NonNull java.lang.String zoneId, @NonNull AdColonyNativeAdViewListener listener, @NonNull AdColonyAdSize size, AdColonyAdOptions options)
zoneId
- the zone if from which to request the ad.listener
- the AdColonyNativeAdViewListener to be notified upon successful/unsuccessful request.size
- the AdColonyAdSize object representing the desired width/height of the ad view.options
- the optional options object to be passed along with this request.AdColonyNativeAdView
,
AdColonyNativeAdViewListener
,
AdColonyAdSize
public static boolean setAppOptions(@NonNull AdColonyAppOptions options)
options
- the new AdColonyAppOptions object to be set.AdColonyAppOptions
public static AdColonyAppOptions getAppOptions()
public static boolean setRewardListener(@NonNull AdColonyRewardListener listener)
listener
- the AdColonyRewardListener object to register.AdColonyReward
,
AdColonyRewardListener
public static boolean removeRewardListener()
public static java.lang.String getSDKVersion()
public static AdColonyRewardListener getRewardListener()
public static boolean addCustomMessageListener(@NonNull AdColonyCustomMessageListener listener, java.lang.String type)
listener
- the AdColonyCustomMessageListener to register.type
- the type of message to listen for.AdColonyCustomMessage
,
AdColonyCustomMessageListener
public static AdColonyCustomMessageListener getCustomMessageListener(@NonNull java.lang.String type)
type
- the type of the message listener to retrieve.public static boolean removeCustomMessageListener(@NonNull java.lang.String type)
type
- the type of listener to remove.public static boolean clearCustomMessageListeners()
public static boolean requestInterstitial(@NonNull java.lang.String zoneId, @NonNull AdColonyInterstitialListener listener)
AdColonyInterstitialListener.onRequestFilled(AdColonyInterstitial)
callback. A request that was not filled will trigger the listener's
AdColonyInterstitialListener.onRequestNotFilled(AdColonyZone)
callback.zoneId
- the zone identifier of the zone you wish to request an interstitial advertisement
from.listener
- the listener object to be alerted in response to the request.AdColonyInterstitialListener
public static boolean requestInterstitial(@NonNull java.lang.String zoneId, @NonNull AdColonyInterstitialListener listener, AdColonyAdOptions options)
AdColonyInterstitialListener.onRequestFilled(AdColonyInterstitial)
callback. A request that was not filled will trigger the listener's
AdColonyInterstitialListener.onRequestNotFilled(AdColonyZone zone)
callback.zoneId
- the zone identifier of the zone you wish to request an interstitial advertisement
from.listener
- the listener object to be alerted in response to the request.options
- the optional ad options to be sent along with this request.AdColonyInterstitialListener
,
AdColonyAdOptions