Package com.tapjoy

Class TJPlacement

java.lang.Object
com.tapjoy.TJPlacement

public class TJPlacement extends Object
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 Details

    • TJPlacement

      @Deprecated public TJPlacement(android.content.Context activityContext, String placementName, TJPlacementListener listener)
      Deprecated.
      Use {link TJPlacement(TJCorePlacement, TJPlacementListener)} instead. Creates a new TJPlacement object with the given name and TJPlacementListener listener.
      Parameters:
      activityContext - the activity context.
      placementName - the name of the placement.
      listener - the listener of the placement.
  • Method Details

    • getListener

      public TJPlacementListener getListener()
      The TJPlacementListener listener for this placement.
      Returns:
      the listener.
    • getName

      public String getName()
      Returns the name of this placement. This is the same name passed to the constructor when creating this TJPlacement 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 currency
      currencyBalance - the amount of the currency. Must be greater than or equal to 0.
      listener - notifies that the currency balance has been set locally
    • getCurrencyBalance

      public int getCurrencyBalance(String currencyId)
      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 currency
      currencyAmountRequired - 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

      public int getCurrencyAmountRequired(String currencyId)
      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

      public String 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