Package com.tapjoy
Class TJPlacement
java.lang.Object
com.tapjoy.TJPlacement
A
TJPlacement
object represents a placement instance in your app.
Each placement is defined on the Tapjoy dashboard and can be configured
to serve different content to your users.-
Constructor Summary
ConstructorDescriptionTJPlacement
(android.content.Context activityContext, String placementName, TJPlacementListener listener) Deprecated.Use {link TJPlacement(TJCorePlacement, TJPlacementListener)} instead. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Dismiss content which is showingint
getCurrencyAmountRequired
(String currencyId) Gets the currency amount requiredint
getCurrencyBalance
(String currencyId) Gets the currency balancecom.tapjoy.TJEntryPoint
Gets the entry point for this placement instance.getGUID()
Returns the unique identifier assigned for this placement.TheTJPlacementListener
listener for this placement.getName()
Returns the name of this placement.boolean
Whether or not content for this placement has been returned and is ready to be presentedboolean
Whether or not the pre-loaded content for this placement has been cached and is ready to be presentedvoid
Send an event from the app to the server.void
setCurrencyAmountRequired
(String currencyId, int currencyAmountRequired, com.tapjoy.TJSetCurrencyAmountRequiredListener listener) Sets the currency amount requiredvoid
setCurrencyBalance
(String currencyId, int currencyBalance, com.tapjoy.TJSetCurrencyBalanceListener listener) Sets the currency balancevoid
setEntryPoint
(com.tapjoy.TJEntryPoint entryPoint) Sets the entry point for this placement instance.void
Shows the content that was received from the server requesting content
-
Constructor Details
-
TJPlacement
@Deprecated public TJPlacement(android.content.Context activityContext, String placementName, TJPlacementListener listener) Deprecated.Use {link TJPlacement(TJCorePlacement, TJPlacementListener)} instead. Creates a newTJPlacement
object with the given name andTJPlacementListener
listener.- Parameters:
activityContext
- the activity context.placementName
- the name of the placement.listener
- the listener of the placement.
-
-
Method Details
-
getListener
TheTJPlacementListener
listener for this placement.- Returns:
- the listener.
-
getName
Returns the name of this placement. This is the same name passed to the constructor when creating thisTJPlacement
object.- Returns:
- the name for this placement
-
isContentReady
public boolean isContentReady()Whether or not the pre-loaded content for this placement has been cached and is ready to be presented- Returns:
- if pre-loaded content is ready to be presented for this placement
-
isContentAvailable
public boolean isContentAvailable()Whether or not content for this placement has been returned and is ready to be presented- Returns:
- if content is available and has a fill
-
requestContent
public void requestContent()Send an event from the app to the server. -
showContent
public void showContent()Shows the content that was received from the server requesting content -
setCurrencyBalance
public void setCurrencyBalance(String currencyId, int currencyBalance, com.tapjoy.TJSetCurrencyBalanceListener listener) Sets the currency balance- Parameters:
currencyId
- the ID of the currencycurrencyBalance
- the amount of the currency. Must be greater than or equal to 0.listener
- notifies that the currency balance has been set locally
-
getCurrencyBalance
Gets the currency balance- Parameters:
currencyId
- the ID of the currency- Returns:
- the amount of the currency balance, -1 if not available.
-
setCurrencyAmountRequired
public void setCurrencyAmountRequired(String currencyId, int currencyAmountRequired, com.tapjoy.TJSetCurrencyAmountRequiredListener listener) Sets the currency amount required- Parameters:
currencyId
- the ID of the currencycurrencyAmountRequired
- currencyAmountRequired the amount of the currency the use needs. Must be greater than 0.listener
- notifies that the currency balance has been set locally
-
getCurrencyAmountRequired
Gets the currency amount required- Parameters:
currencyId
- the ID of the currency- Returns:
- the amount of the required currency, -1 if not available.
-
dismissContent
public static void dismissContent()Dismiss content which is showing -
getGUID
Returns the unique identifier assigned for this placement. Each placement is assigned a GUID which is only used to internally distinguish placement objects from one another.- Returns:
- unique identifier generated for this placement
-
setEntryPoint
public void setEntryPoint(com.tapjoy.TJEntryPoint entryPoint) Sets the entry point for this placement instance.- Parameters:
entryPoint
- The entry point to set.- See Also:
-
TJEntryPoint
-
getEntryPoint
public com.tapjoy.TJEntryPoint getEntryPoint()Gets the entry point for this placement instance.- Returns:
- The entry point to set.
- See Also:
-
TJEntryPoint
-