XAPP Class Reference
Inherits from | NSObject |
---|---|
Declared in | XAPP.h |
Overview
XAPP SDK, from XAPPmedia, is a plugin for iOS applications which serves interactive audio advertisements.
Initialization and Configuration
+ startSessionWithAPIKey:withApplicationKey:
Start the plugin
+ (void)startSessionWithAPIKey:(NSString *)theAPIKey withApplicationKey:(NSString *)theApplicationKey
Parameters
theAPIKey |
Developer specific API key |
---|---|
theApplicationKey |
Application key associated with application the plugin will be embedded |
Discussion
Start the plugin
Declared In
XAPP.h
+ pluginStarted
Returns if the plugin has started
+ (BOOL)pluginStarted
Return Value
TRUE if the plugin is running, FALSE if not
Discussion
Returns if the plugin has started
Declared In
XAPP.h
+ microphonePermission
User microphone permission
+ (BOOL)microphonePermission
Return Value
If the user has granted permission to use the microphone
Discussion
User microphone permission
Declared In
XAPP.h
Advertisement Requests
+ requestAd:success:failure:
Informs the block the request was successful and supplies the loaded advertisement.
+ (void)requestAd:(XARequest *)request success:(void ( ^ ) ( XAAdvertisement *spot ))success failure:(void ( ^ ) ( NSError *error ))failure
Parameters
request |
The XAAdRequest |
---|---|
success |
block for The loaded advertisement |
failure |
block for The failed advertisement |
Discussion
Informs the block the request was successful and supplies the loaded advertisement.
Declared In
XAPP.h
Advertisement Playback, In-Tuner Tile or Full Screen Interstitial
+ playAdAsInTunerTile:withContainingView:startedPlayback:success:failure:
Play the advertisement with the companion ad within a view
+ (void)playAdAsInTunerTile:(XAAdvertisement *)advertisement withContainingView:(UIView *)view startedPlayback:(void ( ^ ) ( XAAdvertisement *spot ))start success:(void ( ^ ) ( XAAdvertisement *spot , XAResult *result ))success failure:(void ( ^ ) ( XAAdvertisement *spot , NSError *error ))failure
Parameters
advertisement |
Advertisement to be played |
---|---|
view |
The view to display the companion ad within |
start |
Block called when the audio starts |
success |
Block called when the ad completes successfully |
failure |
Block called when the ad fails to complete |
Discussion
Play the advertisement with the companion ad within a view
Declared In
XAPP.h
+ playAdAsInterstitial:withRootViewController:startedPlayback:success:failure:
Play the advertisement with the companion ad displayed full-screen
+ (void)playAdAsInterstitial:(XAAdvertisement *)advertisement withRootViewController:(UIViewController *)viewController startedPlayback:(void ( ^ ) ( XAAdvertisement *spot ))start success:(void ( ^ ) ( XAAdvertisement *spot , XAResult *result ))success failure:(void ( ^ ) ( XAAdvertisement *spot , NSError *error ))failure
Parameters
advertisement |
The advertisement that will be played |
---|---|
viewController |
The View controller to present the interstitial companion from |
start |
Block called when the audio starts |
success |
Block called when the ad completes successfully |
failure |
Block called when the ad fails to complete |
Discussion
Play the advertisement with the companion ad displayed full-screen
Declared In
XAPP.h
+ playAdAsAudioOnly:startedPlayback:success:failure:
Play the advertisement without a companion ad
+ (void)playAdAsAudioOnly:(XAAdvertisement *)advertisement startedPlayback:(void ( ^ ) ( XAAdvertisement *spot ))start success:(void ( ^ ) ( XAAdvertisement *spot , XAResult *result ))success failure:(void ( ^ ) ( XAAdvertisement *spot , NSError *error ))failure
Parameters
advertisement |
The advertisement that will be played |
---|---|
start |
Block called when the audio starts |
success |
Block called when the ad completes successfully |
failure |
Block called when the ad fails to complete |
Discussion
Play the advertisement without a companion ad
Declared In
XAPP.h
+ startListeningForAdvertisement:withResult:
Start listening for the advertisement, skips the audio.
+ (void)startListeningForAdvertisement:(XAAdvertisement *)advertisement withResult:(void ( ^ ) ( XAResult *result , NSError *error ))result
Parameters
advertisement |
Advertisement with available voice actions. |
---|---|
result |
A block that is called when the action is complete. |
Discussion
Start listening for the advertisement, skips the audio.
If an action is requested by the user, the action will be performed.
Declared In
XAPP.h
Playback Controls
+ pauseAd
Pause the playback of the advertisement
+ (void)pauseAd
Discussion
Pause the playback of the advertisement
Declared In
XAPP.h
+ resumeAd
Resume the playback of the advertisement
+ (void)resumeAd
Discussion
Resume the playback of the advertisement
Declared In
XAPP.h
+ cancelAd:
Cancel the advertisement
+ (void)cancelAd:(XAAdvertisement *)advertisement
Parameters
advertisement |
The advertisement to be cancelled |
---|
Discussion
Cancel the advertisement
Declared In
XAPP.h
+ adPresented
Returns if the plugin has an ad presented. The ad could not be presented but still playing audio (adPlaying) or have the audio paused (adRunning).
+ (BOOL)adPresented
Return Value
TRUE if an ad is presented
Discussion
Returns if the plugin has an ad presented. The ad could not be presented but still playing audio (adPlaying) or have the audio paused (adRunning).
See Also
Declared In
XAPP.h
+ adPlaying
Returns if the plugin is currently playing the advertisement
+ (BOOL)adPlaying
Return Value
TRUE if an ad is playing
Discussion
Returns if the plugin is currently playing the advertisement
See Also
Declared In
XAPP.h
+ adRunning
Returns if the SDK is in the process of playing an advertisement. The ad could be not presented, and not playing audio but still in a playback mode.
+ (BOOL)adRunning
Return Value
TRUE if the SDK is currently in ad playback mode
Availability
3.8.0
Discussion
Returns if the SDK is in the process of playing an advertisement. The ad could be not presented, and not playing audio but still in a playback mode.
See Also
Declared In
XAPP.h
Advertisement Availability
+ adAvailable
Returns if an advertisement is available for playback
+ (BOOL)adAvailable
Return Value
TRUE if an advertisment if available, FALSE if no advertisement is available for playback
Discussion
Returns if an advertisement is available for playback
Declared In
XAPP.h
+ nextAdvertisement
Retrieve the next ad.
+ (XAAdvertisement *)nextAdvertisement
Return Value
The next available advertisement based on a first requested, first out basis.
Discussion
Retrieve the next ad.
Declared In
XAPP.h
+ availableAdvertisements
Retrieve the current advertisement queue
+ (NSArray *)availableAdvertisements
Return Value
An array of XAAdvertisement objects
Discussion
Retrieve the current advertisement queue
The plugin stores a queue of the advertisements that were requested with requestAd:
Declared In
XAPP.h
Configure XAPP
+ setLogLevel:
Set the XALogLevel during development, default is XALogLevelWarn. This is typically only used to produce logs for XAPPmedia support.
+ (void)setLogLevel:(XALogLevel)logLevel
Parameters
logLevel |
---|
Discussion
Set the XALogLevel during development, default is XALogLevelWarn. This is typically only used to produce logs for XAPPmedia support.
Warning: Use only for debugging purposes, make sure to return to the default before submitting to the app store
Declared In
XAPP.h
+ setRequestAdTimout:
Configure the ad request timeout interval
+ (void)setRequestAdTimout:(NSTimeInterval)timeout
Parameters
timeout |
Ad request timeout in seconds |
---|
Discussion
Configure the ad request timeout interval
Declared In
XAPP.h
+ useDevServer
Use the development server.
+ (void)useDevServer
Availability
4.0.0
Discussion
Use the development server.
Your credentials will will not work if you call this.
Declared In
XAPP.h