I2WAPI
package com.intowow.sdk
public class I2WAPI
This class is SDK main program class.
Initialize SDK
You should add
I2WAPI.init()
,I2WAPI.onActivityResume()
andI2WAPI.onActivityPause()
to all of the activities. In order to let the integration more simplified, we recommend you to add these API to your Application class:
If you initialize SDK by
init(Context context, boolean isTestAd)
orinit(Context context, boolean isTestAd, boolean isVerbose)
, be sure to configure the isTestAd and isVerbose tofalse
before you release the build to the production environment.
Public methods
void
JSONObject
List<Long[]>
Return the ad valid time slot array by placement.
void
void
void
void
void
void
void
boolean
void
void
void
void
Public methods
blockAd
void blockAd(Context context, Ad ad, int reason, String description)
Block an ad.
Parameters
context
Context: the context.
ad
reason
int: the reason code. 1 : not relevant, 2 : see the same ad too often, 3 : inappropriate
description
String: the description.
getAdditionalInfo
JSONObject getAdditionalInfo(Context context)
Get SDK additional info. such as device id, SDK version etc.
Parameters
context
Context: the context.
Returns
JSONObject
SDK additional info.
void init(Context context)
getAdsValidTime
List<Long[]> getAdsValidTime(Context context, String placement)
Get the ads valid time slot interval. Example: [[startTime, endTime], [startTime, endTime] ....]
Parameters
context
Context: the context.
placement
String: the placement.
Returns
List<Long[]>
return the valid ads time array.
init
Initialize sdk.
Parameters
context
Context: the context.
init
void init(Context context, boolean isTestAd)
Initialize sdk.
Parameters
context
Context: the context.
isTestAd
boolean: if SDK needs to fetch test ad for testing purpose or not. APP should set this flag to "false" before deploying to the production environment.
init
void init(Context context, boolean isTestAd, boolean isVerbose)
Initialize sdk.
Parameters
context
Context: the context.
isTestAd
boolean: if SDK needs to fetch test ad for testing purpose or not. APP should set this flag to "false" before deploying to the production environment.
isVerbose
boolean: is print verbose log or not. APP should set this flag to "false" before deploying to the production environment.
onActivityResume
void onActivityResume(Context context)
Notify sdk that Activity has already in resume status.
Parameters
context
Context: the context.
onActivityPause
void onActivityPause(Context context)
Notify sdk that Activity has already in pause status.
Parameters
context
Context: the context.
preload
void preload(Context context, String placement)
Notify the SDK to preload this placement.
Parameters
context
Context: the context.
placement
String: the placement you want to preload.
preload
void preload(Context context, RequestInfo requestInfo)
Notify the SDK to preload by RequestInfo
Parameters
context
Context: the context.
requestInfo
hasReadyAd
boolean hasReadyAd(Context context, String placement)
Check is there any ready ad at this moment
Parameters
context
Context: the context.
placement
String: the placement you want to check.
Returns
boolean
return true if there is at least one ready ad, otherwise false
setAdUrlLoadingListener
Handle ad engage event. SDK will call listener.shouldOverrideUrlLoading() for App while user engage and you can decide to open device's default browser or do other thing you want.
Parameters
context
Context: the context.
listener
setAudienceTargetingTags
void setAudienceTargetingTags(Context context, List<String> tagList)
Set audience tags for targeting.
Parameters
context
Context: the context.
tagList
List<String>: all tags for targeting.
setDownloadTrafficListener
To report the download size to App.
Parameters
context
Context: the context.
listener
setMaximumBitmapCacheSize
void setMaximumBitmapCacheSize(Context context, int maximumBitmapCacheSize)
Set the maximum bitmap size for cache.
Parameters
context
Context: the context.
maximumBitmapCacheSize
int: the maximum bitmap size for cache.
Last updated