public abstract class AdGem
extends java.lang.Object
get() to acquire instance of this class.| Modifier and Type | Class and Description |
|---|---|
static interface |
AdGem.State |
| Modifier and Type | Field and Description |
|---|---|
static int |
STATE_DISABLED
Identifies that the component owning this state was disabled by the SDK configuration or server.
|
static int |
STATE_DOWNLOADING |
static int |
STATE_ERROR
Identifies that an error occurred.
|
static int |
STATE_INITIALIZING
Identifies that data is in initializing.
|
static int |
STATE_NEEDS_CAMPAIGN_REFRESH |
static int |
STATE_NEEDS_DOWNLOAD |
static int |
STATE_NEEDS_INITIALIZATION
Identifies that data is in unknown state and needs initialization.
|
static int |
STATE_READY |
static int |
STATE_REFRESHING_CAMPAIGN |
| Constructor and Description |
|---|
AdGem() |
| Modifier and Type | Method and Description |
|---|---|
static AdGem |
get()
Obtains global instance of the AdGem framework.
|
abstract Error |
getError()
Returns last known error.
|
abstract int |
getInterstitialAdState() |
abstract int |
getOfferWallState()
Gets detailed state of the offer wall
|
abstract int |
getRewardedAdState() |
boolean |
isInterstitialAdReady()
Identifies whether AdGem is ready to show an interstitial advertisement via
showInterstitialAd(Context). |
abstract boolean |
isOfferWallReady()
Identifies whether AdGem is ready to show offer wall via the
showOfferWall(Context)}. |
boolean |
isRewardedAdReady()
Identifies whether AdGem is ready to show a rewarded advertisement via
showRewardedAd(Context). |
abstract void |
registerCallback(AdGemCallback callback)
Registers callback to receive AdGem SDK events.
|
abstract void |
registerOfferWallCallback(OfferWallCallback callback)
Registers callback to receive updates about the offer wall.
|
abstract void |
setPlayerMetaData(PlayerMetadata metaData)
Sets additional metadata specific to the user of this application.
|
abstract void |
showInterstitialAd(android.content.Context context)
Shows interstitial advertisement.
|
abstract void |
showOfferWall(android.content.Context context)
Shows offer wall.
|
abstract void |
showRewardedAd(android.content.Context context)
Shows rewarded advertisement.
|
abstract void |
unregisterCallback(AdGemCallback callback)
Unregisters AdGem events callback.
|
abstract void |
unregisterOfferWallCallback(OfferWallCallback callback)
Unregisters AdGem events callback.
|
public static final int STATE_ERROR
getError().public static final int STATE_DISABLED
public static final int STATE_NEEDS_INITIALIZATION
public static final int STATE_INITIALIZING
public static final int STATE_NEEDS_CAMPAIGN_REFRESH
public static final int STATE_REFRESHING_CAMPAIGN
public static final int STATE_NEEDS_DOWNLOAD
public static final int STATE_DOWNLOADING
public static final int STATE_READY
public static AdGem get()
public boolean isInterstitialAdReady()
showInterstitialAd(Context).true if AdGem is ready to show next ad, false otherwise.public abstract int getInterstitialAdState()
public boolean isRewardedAdReady()
showRewardedAd(Context).true if AdGem is ready a rewarded ad, false otherwise.public abstract int getRewardedAdState()
public abstract boolean isOfferWallReady()
showOfferWall(Context)}.true if AdGem is ready to show offer wall, false otherwise.registerOfferWallCallback(OfferWallCallback)public abstract int getOfferWallState()
AdGem.StateregisterOfferWallCallback(OfferWallCallback)public abstract void registerCallback(AdGemCallback callback)
callback - instance of callback interface to receive events from AdGem. All events will be delivered on a main
thread. Reference to this
callback will be kept internally until unregistered via unregisterCallback(AdGemCallback).to receive offer wall events.,
unregisterCallback(AdGemCallback)public abstract void unregisterCallback(AdGemCallback callback)
callback - instance of AdGemCallback previously registered via registerCallback(AdGemCallback).unregisterCallback(AdGemCallback),
unregisterOfferWallCallback(OfferWallCallback)public abstract void registerOfferWallCallback(OfferWallCallback callback)
callback - instance of callback to receive offer wall events from AdGem. All events will be delivered on a main
thread. Reference to this callback will be kept internally until unregistered via
unregisterOfferWallCallback(OfferWallCallback).to receive other AdGem events,
unregisterOfferWallCallback(OfferWallCallback)public abstract void unregisterOfferWallCallback(OfferWallCallback callback)
callback - instance of OfferWallCallback previously registered via registerOfferWallCallback(OfferWallCallback).public abstract void showInterstitialAd(android.content.Context context)
AdGemCallback.onInterstitialAdClosed().
If interstitial ad is not in ready state, then nothing is shown.
java.lang.IllegalStateException - if AdGem was not configured to serve interstitial ads.public abstract void showRewardedAd(android.content.Context context)
AdGemCallback.onRewardedAdComplete().
If a rewarded ad is not in ready state, then nothing is shown.
java.lang.IllegalStateException - if AdGem was not configured to serve rewarded ads.public abstract void showOfferWall(android.content.Context context)
OfferWallCallback.public abstract Error getError()
AdGemCallback.onOfferWallStateChanged(int),
AdGemCallback.onInterstitialAdStateChanged(int) or AdGemCallback.onRewardedAdStateChanged(int).public abstract void setPlayerMetaData(PlayerMetadata metaData)
metaData - extra information about the player.for additional fields.