com.nativex.monetization
Class MonetizationManager

java.lang.Object
  extended by com.nativex.monetization.MonetizationManager

public class MonetizationManager
extends Object

The entry point for the MonetizationSDK. This manager provides methods to call different ad types and offerwalls.

Note: When the application is closing release() should be called to release the resources allocated by this manager.

Author:
Anton Donchev

Field Summary
private static MonetizationManager instance
          The manager is a singleton and this field contains the reference to the only instance of this object.
private  MonetizationSDK monetizationSDK
          The instance of SDK wrapper class.
 
Constructor Summary
private MonetizationManager()
          The class is singleton and the constructor is private.
 
Method Summary
static void actionTaken(int actionId)
          The ActionTaken operation calls back to the nativeX servers and communicates that a trackable action has completed.
private static void checkInstance()
          This method checks for an instance of the manager and if there is no instance it throws NullPointerException.
private static void checkPlacementName(String name, String apiname)
          This method checks for null or empty string for placement name,if found throws NullPointerException.
private static void checkPosition(Rect position, com.nativex.monetization.enums.BannerPosition enumPosition, String placementName)
           
private static void createInstance()
           
static void createSession()
          Deprecated. Use the createSession(context,appId,sessionListener) Establishes a session with the NativeX servers. The session is registering the device with our servers and personalizes the offer selection for it.

Note: The network call is asynchronous.
static void createSession(Context context, ApplicationInputs inputs, com.nativex.monetization.listeners.SessionListener listener)
          Establishes a session with the NativeX servers.
static void createSession(Context context, String appId, com.nativex.monetization.listeners.SessionListener listener)
          Establishes a session with the NativeX servers.
static void createSession(Context context, String appId, String publisherUserId, com.nativex.monetization.listeners.SessionListener listener)
          Establishes a session with the NativeX servers.
static void createSession(com.nativex.monetization.listeners.SessionListener listener)
          Deprecated. Use the createSession(context,appId,sessionListener) Establishes a session with the NativeX servers. The session is registering the device with our servers and personalizes the offer selection for it. Accepts a callback interface implementation.

Note: The network call is asynchronous.
static void dismissAd(com.nativex.monetization.enums.NativeXAdPlacement name)
          Removes an ad from the screen and releases it's resources.
static void dismissAd(String customPlacement)
          Removes an ad from the screen and releases it's resources.
static void dismissBannerAd(com.nativex.monetization.enums.NativeXAdPlacement name)
          Removes a banner from the screen and releases it's resources.
static void dismissBannerAd(String customPlacement)
          Removes a banner from the screen and releases it's resources.
static void enableLogging(boolean isEnabled)
          Enables the SDK logging.
static void endSession()
          Ends the currently established session with the server.
static void fetchAd(Activity activity, com.nativex.monetization.enums.NativeXAdPlacement name, com.nativex.monetization.listeners.OnAdEvent listener)
          Fetches an ad and stores in the memory ready to be shown.
static void fetchAd(Activity activity, String customPlacement, com.nativex.monetization.listeners.OnAdEvent listener)
          Fetches an ad and stores it in the memory ready to be shown.
static void fetchBannerAd(Activity activity, com.nativex.monetization.enums.NativeXAdPlacement name, com.nativex.monetization.listeners.OnAdEvent listener)
          Fetches a banner and stores it in the memory ready to be shown.
static void fetchBannerAd(Activity activity, String customPlacement, com.nativex.monetization.listeners.OnAdEvent listener)
          Fetches a banner and stores it in the memory ready to be shown.
static String getSessionId()
          Checks for session id and returns it if available.
static void initialize(Activity context, ApplicationInputs inputs)
          Deprecated. Use the createSession(context,appId,sessionListener) Initializes the SDK. This method initializes various managers that the SDK requires to run. This methods accepts the application data as a bundle.
static void initialize(Activity context, String applicationName, int appId, String publisherUserId, String packageName)
          Deprecated. Use the createSession(context,appId,sessionListener) Initializes the SDK. This method initializes various managers that the SDK requires to run. This method accepts the application data as parameters.
static boolean isInitialized()
          Checks if this manager is initialized.
static void redeemCurrency()
          Sends RedeemCurrency network call to the server.
static void release()
          Releases the resources allocated by the SDK and ends the currently established session.
static void reloadBannerAd(com.nativex.monetization.enums.NativeXAdPlacement name)
          Loads new ad in a banner.
static void reloadBannerAd(String customPlacement)
          Loads new ad in a banner.
static void setAdvertiserListener(AdvertiserListener listener)
          The AdvertiserListener is used to provide callback for ActionTaken server operation.
static void setBannerAdPosition(com.nativex.monetization.enums.NativeXAdPlacement name, com.nativex.monetization.enums.BannerPosition position)
          Sets the custom position of a banner.
static void setBannerAdPosition(com.nativex.monetization.enums.NativeXAdPlacement name, Rect position)
          Sets the custom position of a banner.
static void setBannerAdPosition(String customPlacement, com.nativex.monetization.enums.BannerPosition position)
          Sets the custom position of a banner.
static void setBannerAdPosition(String customPlacement, Rect position)
          Sets the custom position of a banner.
static void setCurrencyListener(com.nativex.monetization.listeners.CurrencyListenerBase listener)
          Sets a listener in the SDK that will provide callback when the user completes an offer and is awarded with virtual currency.
static void setTheme(com.nativex.monetization.theme.Theme theme)
          Sets the theme of the SDK.
static void showAd(Activity activity, com.nativex.monetization.enums.NativeXAdPlacement name)
          Show an ad.
static void showAd(Activity activity, com.nativex.monetization.enums.NativeXAdPlacement name, com.nativex.monetization.listeners.OnAdEvent listener)
          Show an ad.
static void showAd(Activity activity, String customPlacement)
          Show an ad.
static void showAd(Activity activity, String customPlacement, com.nativex.monetization.listeners.OnAdEvent listener)
          Show an ad.
static void showBannerAd(Activity activity, com.nativex.monetization.enums.NativeXAdPlacement placement, com.nativex.monetization.enums.BannerPosition position)
          Shows a banner.
static void showBannerAd(Activity activity, com.nativex.monetization.enums.NativeXAdPlacement name, com.nativex.monetization.enums.BannerPosition position, com.nativex.monetization.listeners.OnAdEvent listener)
          Shows a banner ad.
static void showBannerAd(Activity activity, com.nativex.monetization.enums.NativeXAdPlacement name, Rect position, com.nativex.monetization.listeners.OnAdEvent listener)
          Shows a banner ad.
static void showBannerAd(Activity activity, String customPlacement, com.nativex.monetization.enums.BannerPosition position)
          Shows a banner.
static void showBannerAd(Activity activity, String customPlacement, com.nativex.monetization.enums.BannerPosition position, com.nativex.monetization.listeners.OnAdEvent listener)
          Shows a banner ad.
static void showBannerAd(Activity activity, String customPlacement, Rect position)
          Shows a banner.
private static void showBannerAd(Activity activity, String customPlacement, Rect position, com.nativex.monetization.enums.BannerPosition adPosition, com.nativex.monetization.listeners.OnAdEvent listener)
           
static void showBannerAd(Activity activity, String customPlacement, Rect position, com.nativex.monetization.listeners.OnAdEvent listener)
          Shows a banner ad.
static void trackInAppPurchase(com.nativex.common.billingtracking.BillingInputs inputs)
          Sends a tracking call to the server with information about a purchase that the user completed.
static void trackInAppPurchase(String storeProductId, String storeTransactionId, String storeTransactionTimeUTC, float costPerItem, String currencyLocale, int quantity, String productTitle)
          Sends a tracking call to the server with information about a purchase that the user completed.
static void update(Activity activity)
          In case the activity needs to be recreated (due to configuration change for example), the banner has to be detached from the old instance and re-attached to the new one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static MonetizationManager instance
The manager is a singleton and this field contains the reference to the only instance of this object.


monetizationSDK

private MonetizationSDK monetizationSDK
The instance of SDK wrapper class.

Constructor Detail

MonetizationManager

private MonetizationManager()
The class is singleton and the constructor is private.

Method Detail

checkInstance

private static void checkInstance()
This method checks for an instance of the manager and if there is no instance it throws NullPointerException.

Throws:
NullPointerException - This exception is thrown when the manager is not initialized.

createInstance

private static void createInstance()

initialize

@Deprecated
public static void initialize(Activity context,
                                         ApplicationInputs inputs)
Deprecated. Use the createSession(context,appId,sessionListener) Initializes the SDK. This method initializes various managers that the SDK requires to run. This methods accepts the application data as a bundle.

Parameters:
context - Constants. The context instance is required for the SDK to be able to create UI elements like the offerwall.
inputs - ApplicationInputs. The application data is passed here as a bundle.

initialize

@Deprecated
public static void initialize(Activity context,
                                         String applicationName,
                                         int appId,
                                         String publisherUserId,
                                         String packageName)
Deprecated. Use the createSession(context,appId,sessionListener) Initializes the SDK. This method initializes various managers that the SDK requires to run. This method accepts the application data as parameters.

Parameters:
context - Constants. The context instance is required for the SDK to be able to create UI elements like the offerwall.
applicationName - String. The application name to display in the offerwall.
appId - Integer. The appId provided by NativeX support team for your app.
publisherUserId - String. This is developer payload.
packageName - String. The package name of the application.

createSession

@Deprecated
public static void createSession()
Deprecated. Use the createSession(context,appId,sessionListener) Establishes a session with the NativeX servers. The session is registering the device with our servers and personalizes the offer selection for it.

Note: The network call is asynchronous.


createSession

@Deprecated
public static void createSession(com.nativex.monetization.listeners.SessionListener listener)
Deprecated. Use the createSession(context,appId,sessionListener) Establishes a session with the NativeX servers. The session is registering the device with our servers and personalizes the offer selection for it. Accepts a callback interface implementation.

Note: The network call is asynchronous.

Parameters:
listener - SessionListener. The listener that will provide callback when the CreateSession request is done.

createSession

public static void createSession(Context context,
                                 String appId,
                                 com.nativex.monetization.listeners.SessionListener listener)
Establishes a session with the NativeX servers. The session is registering the device with our servers and personalizes the offer selection for it. This method accepts the application data as parameters.Accepts a callback interface implementation.

Note: The network call is asynchronous.

Parameters:
context - Constants. The context instance is required for the SDK to be able to create UI elements like the offerwall.
appId - String. The appId provided by NativeX support team for your app.
listener - SessionListener. The listener that will provide callback when the CreateSession request is done.

createSession

public static void createSession(Context context,
                                 String appId,
                                 String publisherUserId,
                                 com.nativex.monetization.listeners.SessionListener listener)
Establishes a session with the NativeX servers. The session is registering the device with our servers and personalizes the offer selection for it. This method accepts the application data as parameters.Accepts a callback interface implementation.

Note: The network call is asynchronous.

Parameters:
context - Constants. The context instance is required for the SDK to be able to create UI elements like the offerwall.
appId - String. The appId provided by NativeX support team for your app.
publisherUserId - String. This is developer payload.
listener - SessionListener. The listener that will provide callback when the CreateSession request is done.

createSession

public static void createSession(Context context,
                                 ApplicationInputs inputs,
                                 com.nativex.monetization.listeners.SessionListener listener)
Establishes a session with the NativeX servers. The session is registering the device with our servers and personalizes the offer selection for it. This method accepts the application data as parameters.Accepts a callback interface implementation.

Note: The network call is asynchronous.

Parameters:
context - Constants. The context instance is required for the SDK to be able to create UI elements like the offerwall.
inputs - ApplicationInputs. Bundle that contains application data.
listener - SessionListener. The listener that will provide callback when the CreateSession request is done.

actionTaken

public static void actionTaken(int actionId)
The ActionTaken operation calls back to the nativeX servers and communicates that a trackable action has completed. This depends on the implementation of your offer.

Parameters:
actionId - The action id is provided by nativeX and identifies the particular action that your app is tracking.

setCurrencyListener

public static void setCurrencyListener(com.nativex.monetization.listeners.CurrencyListenerBase listener)
Sets a listener in the SDK that will provide callback when the user completes an offer and is awarded with virtual currency.

Parameters:
listener - CurrencyListenerBase. This listener may be implementation of either CurrencyListenerV1 or CurrencyListenerV2.

setAdvertiserListener

public static void setAdvertiserListener(AdvertiserListener listener)
The AdvertiserListener is used to provide callback for ActionTaken server operation.

Parameters:
listener - AdvertiserListener. An implementation of AdvertiserListener.

redeemCurrency

public static void redeemCurrency()
Sends RedeemCurrency network call to the server. The server will check if there is balance waiting to be redeemed and will return in through the listener set here.

Note: The network call is asynchronous.

Parameters:
context - Activity. The activity is required for the dialog that will pop when the network call is completed and there are virtual currencies awarded to the user.

enableLogging

public static void enableLogging(boolean isEnabled)
Enables the SDK logging.

Parameters:
isEnabled - Boolean.true - enabled, false - no log.

endSession

public static void endSession()
Ends the currently established session with the server. This methods is intended only for custom implementations of the SDK . For standard implementation this call is included in the release() method.


getSessionId

public static String getSessionId()
Checks for session id and returns it if available.

Returns:
String. The session id generated from the server or null if not available.

trackInAppPurchase

public static void trackInAppPurchase(com.nativex.common.billingtracking.BillingInputs inputs)
Sends a tracking call to the server with information about a purchase that the user completed. The purchase information is passed as a bundle.

Parameters:
inputs - BillingInputs. A bundle with information about the purchase to send to the server.

trackInAppPurchase

public static void trackInAppPurchase(String storeProductId,
                                      String storeTransactionId,
                                      String storeTransactionTimeUTC,
                                      float costPerItem,
                                      String currencyLocale,
                                      int quantity,
                                      String productTitle)
Sends a tracking call to the server with information about a purchase that the user completed. Each purchase information is passed as separate fields.

Parameters:
storeProductId - String The product id of the store item.
storeTransactionId - String The transaction id.
storeTransactionTimeUTC - String The time the purchase was performed.
costPerItem - Float The cost of the item.
currencyLocale - String The locale of the currency used to pay for the purchase.
quantity - Integer The quantity of items purchased.
productTitle - String The name of the product.

setTheme

public static void setTheme(com.nativex.monetization.theme.Theme theme)
Sets the theme of the SDK.

Parameters:
theme - Theme. The theme for the SDK visual elements to use.

isInitialized

public static boolean isInitialized()
Checks if this manager is initialized.

Returns:
Boolean. true - the manager is initialized, false - call initialize().

release

public static void release()
Releases the resources allocated by the SDK and ends the currently established session.


showAd

public static final void showAd(Activity activity,
                                com.nativex.monetization.enums.NativeXAdPlacement name)
Show an ad. If there is a cached ad then it shows it.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
name - NativeXAdPlacement. A pre-defined list of strings describing the interaction point of an ad within your game.

showAd

public static final void showAd(Activity activity,
                                String customPlacement)
Show an ad. If an ad with the same name was previously cached, it shows the cached ad.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. A string that describes the interaction point of an ad within your game.

showAd

public static final void showAd(Activity activity,
                                com.nativex.monetization.enums.NativeXAdPlacement name,
                                com.nativex.monetization.listeners.OnAdEvent listener)
Show an ad. If an ad with the same name was previously cached, it shows the cached ad. This overloaded method allows a listener to be passed.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
name - NativeXAdPlacement. A pre-defined list of strings describing the interaction point of an ad within your game.
listener - OnAdEvent. An implementation of OnAdEvent interface to provide callback.

showAd

public static final void showAd(Activity activity,
                                String customPlacement,
                                com.nativex.monetization.listeners.OnAdEvent listener)
Show an ad. If an ad with the same name was previously cached, it shows the cached ad. This overloaded method allows a listener to be passed.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
listener - OnAdEvent. An implementation of OnAdEvent interface to provide callback.

showBannerAd

public static final void showBannerAd(Activity activity,
                                      String customPlacement,
                                      Rect position)
Shows a banner. If there is a cached one with the same name then it shows it. This overloaded methods changes the initial position of the ad.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
position - Rect. A Rect that describes the position of the ad.

showBannerAd

public static final void showBannerAd(Activity activity,
                                      String customPlacement,
                                      com.nativex.monetization.enums.BannerPosition position)
Shows a banner. If there is a cached one with the same name then it shows it. This overloaded methods changes the initial position of the ad.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
position - BannerPosition. Choose a predefined position.

showBannerAd

public static final void showBannerAd(Activity activity,
                                      com.nativex.monetization.enums.NativeXAdPlacement placement,
                                      com.nativex.monetization.enums.BannerPosition position)
Shows a banner. If there is a cached one with the same name then it shows it. This overloaded methods changes the initial position of the ad.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
placement - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.
position - BannerPosition. Choose a predefined position.

showBannerAd

public static final void showBannerAd(Activity activity,
                                      com.nativex.monetization.enums.NativeXAdPlacement name,
                                      Rect position,
                                      com.nativex.monetization.listeners.OnAdEvent listener)
Shows a banner ad. If there is a cached one with the same name then it shows it. This overloaded methods allows a listener to be passed and the initial position of the ad to be changed.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
name - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.
position - Rect. A Rect that describes the position of the ad.

showBannerAd

public static final void showBannerAd(Activity activity,
                                      com.nativex.monetization.enums.NativeXAdPlacement name,
                                      com.nativex.monetization.enums.BannerPosition position,
                                      com.nativex.monetization.listeners.OnAdEvent listener)
Shows a banner ad. If there is a cached one with the same name then it shows it. This overloaded methods allows a listener to be passed and the initial position of the ad to be changed.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
name - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.
position - BannerPosition. Choose a predefined position.

showBannerAd

public static final void showBannerAd(Activity activity,
                                      String customPlacement,
                                      Rect position,
                                      com.nativex.monetization.listeners.OnAdEvent listener)
Shows a banner ad. If there is a cached one with the same name then it shows it. This overloaded methods allows a listener to be passed and the initial position of the ad to be changed.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
position - Rect. A Rect that describes the position of the ad.

showBannerAd

public static final void showBannerAd(Activity activity,
                                      String customPlacement,
                                      com.nativex.monetization.enums.BannerPosition position,
                                      com.nativex.monetization.listeners.OnAdEvent listener)
Shows a banner ad. If there is a cached one with the same name then it shows it. This overloaded methods allows a listener to be passed and the initial position of the ad to be changed.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
position - BannerPosition. Choose a predefined position.

showBannerAd

private static final void showBannerAd(Activity activity,
                                       String customPlacement,
                                       Rect position,
                                       com.nativex.monetization.enums.BannerPosition adPosition,
                                       com.nativex.monetization.listeners.OnAdEvent listener)

checkPosition

private static final void checkPosition(Rect position,
                                        com.nativex.monetization.enums.BannerPosition enumPosition,
                                        String placementName)

update

public static final void update(Activity activity)
In case the activity needs to be recreated (due to configuration change for example), the banner has to be detached from the old instance and re-attached to the new one. This method does that for all ads associated with this activity and needs to be placed in onCreate() as it is required to run once per activity instance.

Parameters:
activity - Activity. The activity to update the ad with.

fetchAd

public static final void fetchAd(Activity activity,
                                 com.nativex.monetization.enums.NativeXAdPlacement name,
                                 com.nativex.monetization.listeners.OnAdEvent listener)
Fetches an ad and stores in the memory ready to be shown. You can show fetched ad by calling showAd().

Parameters:
activity - Activity. The activity to create the ad visual elements from.
name - NativeXAdPlacement. A pre-defined list of strings describing the interaction point of an ad within your game.
listener - OnAdEvent. An implementation of OnAdEvent interface to provide callback.

fetchAd

public static final void fetchAd(Activity activity,
                                 String customPlacement,
                                 com.nativex.monetization.listeners.OnAdEvent listener)
Fetches an ad and stores it in the memory ready to be shown. You can show fetched ads by calling showAd(). This overloaded method allows a specific name to be set to the ad.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
listener - OnAdEvent. An implementation of OnAdEvent interface to provide callback.

fetchBannerAd

public static final void fetchBannerAd(Activity activity,
                                       com.nativex.monetization.enums.NativeXAdPlacement name,
                                       com.nativex.monetization.listeners.OnAdEvent listener)
Fetches a banner and stores it in the memory ready to be shown. You can show fetched banners by calling showBanner().

Parameters:
activity - Activity. The activity to create the ad visual elements from.
name - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.
listener - OnAdEvent. An implementation of OnAdEvent interface to provide callback.

fetchBannerAd

public static final void fetchBannerAd(Activity activity,
                                       String customPlacement,
                                       com.nativex.monetization.listeners.OnAdEvent listener)
Fetches a banner and stores it in the memory ready to be shown. You can show fetched banners by calling showBanner(). This overloaded method allows a specific name to be set to the ad.

Parameters:
activity - Activity. The activity to create the ad visual elements from.
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.

reloadBannerAd

public static final void reloadBannerAd(com.nativex.monetization.enums.NativeXAdPlacement name)
Loads new ad in a banner.

Parameters:
name - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.

reloadBannerAd

public static final void reloadBannerAd(String customPlacement)
Loads new ad in a banner.

Parameters:
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.

setBannerAdPosition

public static final void setBannerAdPosition(com.nativex.monetization.enums.NativeXAdPlacement name,
                                             Rect position)
Sets the custom position of a banner.

Parameters:
name - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.
position - Rect. A Rect that describes the position of the ad.

setBannerAdPosition

public static final void setBannerAdPosition(com.nativex.monetization.enums.NativeXAdPlacement name,
                                             com.nativex.monetization.enums.BannerPosition position)
Sets the custom position of a banner.

Parameters:
name - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.
position - BannerPosition. Choose a predefined position.

setBannerAdPosition

public static final void setBannerAdPosition(String customPlacement,
                                             com.nativex.monetization.enums.BannerPosition position)
Sets the custom position of a banner.

Parameters:
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
position - BannerPosition. Choose a predefined position.

setBannerAdPosition

public static final void setBannerAdPosition(String customPlacement,
                                             Rect position)
Sets the custom position of a banner.

Parameters:
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.
position - Rect. A Rect that describes the position of the ad.

dismissBannerAd

public static final void dismissBannerAd(com.nativex.monetization.enums.NativeXAdPlacement name)
Removes a banner from the screen and releases it's resources.

Parameters:
name - NativeXAdPlacement. Default placement categories used as the name of the ad configurable on the NativeX self-service web site.

dismissBannerAd

public static final void dismissBannerAd(String customPlacement)
Removes a banner from the screen and releases it's resources.

Parameters:
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.

dismissAd

public static final void dismissAd(com.nativex.monetization.enums.NativeXAdPlacement name)
Removes an ad from the screen and releases it's resources.

Parameters:
name - NativeXAdPlacement. A pre-defined list of strings describing the interaction point of an ad within your game.

dismissAd

public static final void dismissAd(String customPlacement)
Removes an ad from the screen and releases it's resources.

Parameters:
customPlacement - String. The name of the ad configurable on the NativeX self-service web site.

checkPlacementName

private static void checkPlacementName(String name,
                                       String apiname)
This method checks for null or empty string for placement name,if found throws NullPointerException.

Throws:
NullPointerException - This exception is thrown when the placement name is null or empty string.