Classes | Public Types | Public Member Functions

com.appsfire.adUnitJAR.sdk.AFAdSDK Interface Reference

List of all members.

Classes

class  AFAdSize
interface  AFAdSizeProvider

Public Types

enum  AFAdSDKModalType { AFAdSDKModalTypeSushi, AFAdSDKModalTypeUraMaki }
enum  AFAdSDKSashimiFormat { AFAdSDKSashimiFormatMinimal, AFAdSDKSashimiFormatExtended }
enum  AFAdSDKError {
  AFSDKErrorCodeUnknown = (1, "Unknown error"), AFSDKErrorCodeInternalError = (2, "Internal error"), AFSDKErrorCodeLibraryNotInitialized = (2, "Library isn't initialized yet"), AFSDKErrorCodeInternetNotReachable = (3,"Internet isn't reachable (and is required)"),
  AFSDKErrorCodeNeedsApplicationDelegate = (4,"You need to set the application delegate to proceed"), AFSDKErrorCodeAdvertisingNoAd = (5,"No ad available"), AFSDKErrorCodeAdvertisingBadCall = (6,"The request call isn't appropriate"), AFSDKErrorCodeAdvertisingAlreadyDisplayed = (7,"An ad is currently displayed for this format"),
  AFSDKErrorCodeAdvertisingCanceledByDeveloper = (8,"The request was canceled by the developer"), AFSDKErrorCodePanelAlreadyDisplayed = (9,"The panel is already displayed"), AFSDKErrorCodeOpenNotificationNotFound = (10,"The notification wasn't found"), AFSDKErrorCodeMaxDownloadRetriesExceeded = (11,"The maximum failed download retry count has exceeded. Will not attempt download further."),
  AFSDKErrorCodeAdDownloadCancelledByDeveloper = (12,"Ad downloads cancelled midway!"), AFSDKErrorCodeAdWebServiceBadJSonReceived = (13,"Bad JSon received from Appsfire webservices"), AFSDKErrorCodeAdDisplayError = (14, "Internal error while displaying ad."), AFSDKErrorCodeAdDisplayBadURLError = (15, "This AdSDK library navigates to specific urls only. %s wont work."),
  AFSDKErrorCodeMediationRequestFailed = (20,"The placement request failed."), AFSDKErrorCodeMediationAdPlacementIdNotValid = (21,"The placement id is not valid."), AFSDKErrorCodeMediationPayloadNotValid = (22,"The payload received for the placement id is not valid"), AFSDKErrorCodeMediationCustomClassNotFound = (23,"The received custom class does not exist"),
  AFSDKErrorCodeMediationCustomClassNotConformToInterface = (24,"The received custom class does not conform to protocol"), AFSDKErrorCodeMediationNoAds = (25,"The received placement id does not have any ads to show"), AFSDKErrorCodeMediationAdRequestTimeout = (26,"The ad request timed out"), AFSDKErrorCodeMediationInterstitialExpired = (27,"The interstitial has expired, you need to create a new one"),
  AFSDKErrorCodeMediationInterstitialAlreadyUsed = (28,"The interstitial has already been used, you need to create a new one"), AFSDKErrorCodeMediationBannerSizeMismatch = (29,"The size of the banner does not fit the destination container view")
}

Public Member Functions

String getSDKVersion ()
boolean isInitialized ()
AFAdSDK setAppId (String appId)
String getAppId ()
AFAdSDK setDebugModeEnabled (boolean use)
boolean isDebugModeEnabled ()
AFAdSDK setVerboseLoggingEnabled (boolean use)
boolean isVerboseLoggingEnabled ()
AFAdSDK setEventsDelegate (AFAdSDKEventsDelegate delegate)
AFAdSDKEventsDelegate getEventsDelegate ()
AFAdSDK addEventsDelegate (AFAdSDKEventsDelegate delegate)
void removeEventsDelegate (AFAdSDKEventsDelegate delegate)
AFAdSDK setAppContext (Context c)
void prepare (Context c)
void onStart (Context c)
void onStop ()
boolean areAdsLoaded ()
boolean cancelAllPendingAdRequests (AFAdSDKModalType modalType)
boolean isModalAdDisplayingNow ()
boolean isAModalAdOfTypeAvailable (String zoneId, AFAdSDKModalType modalType)
void requestModalAd (String zoneId, AFAdSDKModalType modalType, Context c)
int numberOfSashimiAdsAvailableForFormat (String zoneId, AFAdSDKSashimiFormat format)
AFAdSDKSashimiView sashimiViewForFormat (String zoneId, AFAdSDKSashimiFormat format, AFAdSizeProvider sizeProvider, Context c)
AFAdSDKSashimiView sashimiViewForSubclass (String zoneId, Class<?> subclass, AFAdSizeProvider sizeProvider, Context c)
void releaseSashimiView (AFAdSDKSashimiView view)
int numberOfNativeAdsAvailable (String zoneId)
AFNativeAd nativeAd (String zoneId, Context c)
 Get a native ad.
void registerContext (Context c)
void unRegisterContext (Context c)
Context getContext (String contextClassName)

Member Enumeration Documentation

Error returned by the SDK

Defines the type of possible modal ads AFAdSDKModalTypeSushi: A native fullscreen ad AFAdSDKModalTypeUraMaki: An interstitial ad (like in task manager of iOS7), except it happens within the publisher app

Enumerator:
AFAdSDKModalTypeSushi 

Native fullscreen ad

AFAdSDKModalTypeUraMaki 

Native interstitial ad

Defines the type of possible sashimi ads

Enumerator:
AFAdSDKSashimiFormatMinimal 

Minimal ad format with icon, app name, category and description

AFAdSDKSashimiFormatExtended 

Extended ad format that includes an app screenshot


Member Function Documentation

AFAdSDK com.appsfire.adUnitJAR.sdk.AFAdSDK.addEventsDelegate ( AFAdSDKEventsDelegate  delegate  ) 

Set an additional handler that will receive events and handle various interactions with the library

Parameters:
delegate instance of custom class (inherited from AFAdSDKEventsDelegate) that will handle the library events
Returns:
this ad sdk instance
boolean com.appsfire.adUnitJAR.sdk.AFAdSDK.areAdsLoaded (  ) 

Poll to ask if the ad payload has been downloaded yet and if ads are available

Returns:
true if there are ads available in the downloaded payload, false if not
boolean com.appsfire.adUnitJAR.sdk.AFAdSDK.cancelAllPendingAdRequests ( AFAdSDKModalType  modalType  ) 

Cancel any pending modal ad requests

Returns:
true if a modal as was canceled (modalAdRequestDidFailWithError will be called in the delegate), false if not Cancels any pending ad modal request made in the past.
String com.appsfire.adUnitJAR.sdk.AFAdSDK.getAppId (  ) 

Gets the app ID you set for your app

Returns:
app ID
Context com.appsfire.adUnitJAR.sdk.AFAdSDK.getContext ( String  contextClassName  ) 

Get app context registered with registerContext()

Parameters:
contextClassName class name of context to retrieve
Returns:
context, null if not found
AFAdSDKEventsDelegate com.appsfire.adUnitJAR.sdk.AFAdSDK.getEventsDelegate (  ) 

Get the instance of the events delegate class that you set for your app

Returns:
the instance of the event delegate class
String com.appsfire.adUnitJAR.sdk.AFAdSDK.getSDKVersion (  ) 

Gets the SDK version

Returns:
SDK version
boolean com.appsfire.adUnitJAR.sdk.AFAdSDK.isAModalAdOfTypeAvailable ( String  zoneId,
AFAdSDKModalType  modalType 
)

Poll to ask if ads are loaded and if there is at least one modal ad available. The ad SDK also calls AFAdSDKEventsDelegate.onModalAdAvailable() to let the app know that modal ads are now ready for use.

Parameters:
zoneId ID of zone to check modal ads for
modalType the type of modal ad to check availability (AFAdSDKModalTypeSushi, AFAdSDKModalTypeUraMaki..)
Returns:
true if ads are loaded and if there is at least one modal ad of the requested type available, false otherwise
boolean com.appsfire.adUnitJAR.sdk.AFAdSDK.isDebugModeEnabled (  ) 

Check if the debug mode is enabled or not, as set by setDebugModeEnabled()

Returns:
true if debug mode is enabled, false if not
boolean com.appsfire.adUnitJAR.sdk.AFAdSDK.isInitialized (  ) 

Ask if the ADUnit SDK is initialized

Returns:
true if the library is initialized, false if it isn't yet
boolean com.appsfire.adUnitJAR.sdk.AFAdSDK.isModalAdDisplayingNow (  ) 

Poll to ask if a modal ad is being displayed right now by the Ad SDK.

Returns:
true if a modal ad is being displayed, false otherwise
boolean com.appsfire.adUnitJAR.sdk.AFAdSDK.isVerboseLoggingEnabled (  ) 

Check if verbose logging is enabled or not, as set by setVerboseLoggingEnabled()

Returns:
true if debug mode is enabled, false if not
AFNativeAd com.appsfire.adUnitJAR.sdk.AFAdSDK.nativeAd ( String  zoneId,
Context  c 
)

Get a native ad.

Parameters:
zoneId ID of zone to request native ad for
c application context
Returns:
A native ad, null if no native ad is available
int com.appsfire.adUnitJAR.sdk.AFAdSDK.numberOfNativeAdsAvailable ( String  zoneId  ) 

Check the number of native ads currently ready for display

Parameters:
zoneId ID of zone to check native ads for
Returns:
number of ads available
int com.appsfire.adUnitJAR.sdk.AFAdSDK.numberOfSashimiAdsAvailableForFormat ( String  zoneId,
AFAdSDKSashimiFormat  format 
)

Check the number of Sashimi (in-stream) ads currently ready for display

Parameters:
zoneId ID of zone to check in-stream ads for
format sashimi (in-stream) ad format to get the available count of
Returns:
number of ads available
void com.appsfire.adUnitJAR.sdk.AFAdSDK.onStart ( Context  c  ) 

Tell the ad SDK that your activity is started

Parameters:
c application context
void com.appsfire.adUnitJAR.sdk.AFAdSDK.onStop (  ) 

Tell the ad SDK that your activity is stopped

void com.appsfire.adUnitJAR.sdk.AFAdSDK.prepare ( Context  c  ) 

Tell the library to initialize itself and pre-load data, before loading ads. If not already done, this method is automatically called when requesting a modal ad.

Parameters:
c application context
void com.appsfire.adUnitJAR.sdk.AFAdSDK.registerContext ( Context  c  ) 

Register app context so that it can be retrieved with getContext()

Parameters:
c context to register
void com.appsfire.adUnitJAR.sdk.AFAdSDK.releaseSashimiView ( AFAdSDKSashimiView  view  ) 

Release sashimi ad assets. Call this method after removing the view from your layout

Parameters:
view sashimi ad view to be cleaned up after removal
void com.appsfire.adUnitJAR.sdk.AFAdSDK.removeEventsDelegate ( AFAdSDKEventsDelegate  delegate  ) 

Remove an event handler added with addEventsDelegate()

Parameters:
delegate handler to remove
void com.appsfire.adUnitJAR.sdk.AFAdSDK.requestModalAd ( String  zoneId,
AFAdSDKModalType  modalType,
Context  c 
)

Display modal ad now or as soon as possible. A new request will cancel out a previous one if the previous one hasn't been handled yet

Parameters:
zoneId ID of zone to request modal ad for
modalType the type of modal ad to display (AFAdSDKModalTypeSushi, AFAdSDKModalTypeUraMaki..)
c application context
AFAdSDKSashimiView com.appsfire.adUnitJAR.sdk.AFAdSDK.sashimiViewForFormat ( String  zoneId,
AFAdSDKSashimiFormat  format,
AFAdSizeProvider  sizeProvider,
Context  c 
)

Get a sashimi ad view ready to be inserted into an Android layout, from a template format

Parameters:
zoneId ID of zone to request in-stream ad for
format sashimi (in-stream) ad template format to create a view for
sizeProvider instance of a AFAdSizeProvider that provides the size in pixels for this ad when created and when the screen size changes
c application context
Returns:
a view containing an ad which can be inserted and displayed right now, null if no ad of the type is available
AFAdSDKSashimiView com.appsfire.adUnitJAR.sdk.AFAdSDK.sashimiViewForSubclass ( String  zoneId,
Class<?>  subclass,
AFAdSizeProvider  sizeProvider,
Context  c 
)

Get a sashimi ad view ready to be inserted into an Android layout, from a custom view subclass

Parameters:
zoneId ID of zone to request in-stream ad for
subclass the custom view subclass, such as MySashimiView.class
sizeProvider instance of a AFAdSizeProvider that provides the size in pixels for this ad when created and when the screen size changes
c application context
Returns:
a view containing an ad which can be inserted and displayed right now, null if no ad of the type is available
AFAdSDK com.appsfire.adUnitJAR.sdk.AFAdSDK.setAppContext ( Context  c  ) 

Set application context but don't initialize and pre-load data yet

Parameters:
c application context
Returns:
this ad sdk instance
AFAdSDK com.appsfire.adUnitJAR.sdk.AFAdSDK.setAppId ( String  appId  ) 

Sets your app ID to be used by the ad SDK

Parameters:
appId app ID
AFAdSDK com.appsfire.adUnitJAR.sdk.AFAdSDK.setDebugModeEnabled ( boolean  use  ) 

Specify if the library should be used in debug mode. When this mode is enabled, the ad sdk will provide uncapped test ads. By default, this mode is disabled and should be disabled when submitting your app to Google Play or other appstores

Parameters:
use true if the debug mode should be enabled, false if production mode should be enabled
Returns:
this ad sdk instance
AFAdSDK com.appsfire.adUnitJAR.sdk.AFAdSDK.setEventsDelegate ( AFAdSDKEventsDelegate  delegate  ) 

Specify a delegate class which will receive events and handle various interactions with the library

Parameters:
delegate instance of custom class (inherited from AFAdSDKEventsDelegate) that will handle the library events
Returns:
this ad sdk instance
AFAdSDK com.appsfire.adUnitJAR.sdk.AFAdSDK.setVerboseLoggingEnabled ( boolean  use  ) 

Specify whether the library should log verbose messages. When this mode, or debug mode, are enabled, verbose debug messages are logged to the console. This call should only be made during development when testing release mode; it should be removed when submitting your app to Google Play or other appstores

Parameters:
use true if verbose logging should be enabled, false if it should be disabled
Returns:
this sdk instance
void com.appsfire.adUnitJAR.sdk.AFAdSDK.unRegisterContext ( Context  c  ) 

Unregister app context registered with registerContext()

Parameters:
c context to unregister

The documentation for this interface was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations