I2WAPI
Last updated
Last updated
I2WAPI
is used to set up sdk-wise configurations. The followings are some instruction for better sdk performance using I2WAPI
.
Invoke + initWithVerboseLog:isTestMode:
as soon as possible. We recommand doing this within [AppDelegate application:didFinishLaunchingWithOptions:]
.
Integrate background fetch to enhance ad fill rate. Please find details
+ initWithVerboseLog:isTestMode:
name
description
enableVerbose
Always use NO
for release. Use YES
to enable SDK debugging verbose log.
testMode
Always use NO
for release. Use YES
if trying to retrive test ad. Since SDK cache this option for a short period, remove you app and reinstall it if switching between normal and test mode repidly.
+ isAdServing
NO
if SDK is either turned off or has not yet fetched all metadata for the first time; otherwise, YES
.
+ getCrystalID
The crystal id in crystalexpress.plist
.
+ triggerBackgroundFetchOnSuccess:onFail:onNoData:
name
description
success
the callback block of background fetch success
fail
the callback block of background fetch fail
noData
the callback block of background fetch no data
+ setActivePlacement:
name
description
placement
Placement id that is currently requesting for ad.
Use this api to notify SDK to treat this placemnet more aggressively.
+ setActivePlacements:
name
description
placements
Array of placement id strings that are currently requesting for ad.
Use this api to notify SDK to treat these placemnets more aggressively.
+ setAudienceTargetingUserTags:
name
description
tags
A set of strings that represent the characteristics of the app or the user of the app.
CrystalExpress™ SDK has a built-in ad retargeting mechanism called audience targeting. App could set proper tags to deliver the ads their users might be interested in.
Tags could be app tags (app setting) or user tags (user demography, preference, or interest).
SDK will only fetch ads that match the tags. Ad operation team could put the tags on ads via CrystalExpress™ Backend.
+ handleDeepLinkWithUrl:sourceApplication:
name
description
url
url
from [AppDelegate application:openURL:sourceApplication:annotation:]
.
sourceApplocation
sourceApplication
from [AppDelegate application:openURL:sourceApplication:annotation:]
.
+ setAdUrlLoadingListener:
name
description
adUrlHandler
Block used to handle ad redirect request. Return YES
to inform SDK not to open this url with any browser/webview. Return NO
to let SDK open the url with browser/webview.
Use this api only if app is trying to open ad redirect request with its own browser/webview. Make sure to handle the redirect request with app when returning YES
.
+ isAdValid:
name
description
ad
Ad
object containing data for some ad returned by SDK.
Sometimes app may hold an ad from SDK for quite a long time and the ad may expire. In this case app should use this API to check if the ad is still valid before showing it.
+ blockAd:placement:reason:description:
name
description
ad
Ad
object from the block ad.
placement
Placement string with which the blocked is requested.
reason
Reason code for which the ad is blocked.
description
String describing the reason for which the ad is blocked.
Use this api to notify SDK not to show this ad again. SDK will not return the same again.
+ preloadWithPlacement:
name
description
placement
Placement id for which placement want SDK to prepare ad.
Use this api to notify SDK to prepare ad for this placement immediately.
+ isAdAvailableWithPlacement:
name
description
placement
Placement id for which placement want SDK to check if there is any available ad.
Use this api to check whether there is any ad available now for the specified placement.
Please find details
This is used for SDK preview mode integration. Find more details .