RewardedVideoAd

package com.intowow.sdk

public class RewardedVideoAd extends Ad

Characteristics

  • Takes up the whole screen. Users have the option of watching complete video in exchange for in-app rewards.

  • The usual ad experience is 15-30 second non-skippable and contains an end card with a call to action.

  • Support portrait and landscape mode.

  • Support image and video.

  • Video is mute by default, and can be toggled by clicking it.

Request an ad

  • If you use jar for integration, please declare InterstitialAdActivity to AndroidManifest.xml

<activity
  android:name="com.intowow.sdk.InterstitialAdActivity"
  android:configChanges="orientation|screenSize"
  android:launchMode="singleTask"
  android:screenOrientation="portrait"
  android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" >
</activity>
  • You could request an ad by:

private RewardedVideoAd mRewardedVideoAd = null;
private final static String PLACEMENT_NAME = "Obtain from your Intowow account manager";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mRewardedVideoAd = new RewardedVideoAd(mActivity);
    RequestInfo requestInfo = new RequestInfo();
    requestInfo.setPlacement(PLACEMENT_NAME);
    requestInfo.setTimeout(LOAD_AD_TIMEOUT);

    mRewardedVideoAd.setAdListener(new CERewardedVideoAdListener() {

    @Override
    public void onAdDisplayed(Ad ad) {
    }

    @Override
    public void onAdDismissed(Ad ad) {
    }

    @Override
    public void onAdClicked(Ad ad) {
    }

    @Override
    public void onAdImpression(Ad ad) {
    }

    @Override
    public void onAdMute(Ad ad) {
    }

    @Override
    public void onAdUnmute(Ad ad) {
    }

    @Override
    public void onVideoEnd(Ad arg0) {
    }

    @Override
    public void onVideoProgress(Ad arg0, int totalDuration, int currentPosition) {
    }

    @Override
    public void onVideoStart(Ad arg0) {
    }

    });

    mRewardedVideoAd.loadAdAsync(requestInfo, new CEAdRequestListener() {
    @Override
    public void onError(Ad ad, AdError error) {
    }

    @Override
    public void onAdLoaded(Ad ad) {
    //  Start InterstitialAdActivity for showing this ad.
    //
    mRewardedVideoAd.show();      
    }
    });
}
  • remember to release ad if it is no longer to use.

@Override
protected void onDestroy() {
    if(mRewardedVideoAd != null) {
        mRewardedVideoAd.destroy();
        mRewardedVideoAd = null;
    }
    ...
    ...
    super.onDestroy();
}

Advance Integration

Public constructors

RewardedVideoAd(Context context) Instantiates a new rewarded video ad.

Public methods

void

close() Close the rewarded videoActivity directly.

void

destroy() Release the rewarded video ad.

loadAdInstant(RequestInfo requestInfo) Load ad with requestInfo (synchronous)

void

setAutoCloseWhenEngaged(boolean isAutoClose) Instruct SDK to close the rewarded video ad after user clicks the ad. You should call this method before loadAdInstant/loadAdAsync if necessary.

void

show() Start the rewarded videoActivity. You should call this method after onAdLoaded().

void

show(int enterAnim, int exitAnim) Start the rewarded videoActivity with animation effect. You should call this method after onAdLoaded().

Inherited methods

int

getAdId() Get the ad id.

String

getCampaignId() Get the campaign id.

String

getEngageUrl() Get the engage url.

int

getPlace() Get the ad place.

String

getPlacement() Get the ad placement.

Rect

getSize() Get the ad size. It should be called after onAdLoaded().

String

getToken() Get the ad token for tracking.

long

getTotalFileSize() Get the ad file size on device.

String

getVideoCoverPath() Get video cover file path. It should be called after onAdLoaded().

boolean

hasVideoContent() Check if the ad has video content or not.

boolean

isValid() Check if the ad is still valid for serving.

void

setSize(Rect rect) Set the ad size.

Public constructors

RewardedVideoAd

RewardedVideoAd(Context context)

Instantiates a new rewarded video ad.

Parameters

context

Context: the context.

Public methods

close

void close()

Close the rewarded videoActivity directly.

destroy

void destroy()

Release the ad.

loadAdInstant

CERequestResult loadAdInstant(RequestInfo requestInfo)

Load ad with RequestInfo (synchronous)

Parameters

requestInfo

RequestInfo: the request info such as placement and timeout.

loadAdAsync

void loadAdAsync(RequestInfo requestInfo, CEAdRequestListener listener)

Load ad with RequestInfo (asynchronous)

Parameters

requestInfo

RequestInfo: the request info such as placement and timeout.

listener

CEAdRequestListener: know the result of loadAdAsync

setAdListener

void setAdListener(CERewardedVideoAdListener listener)

Set the ad listener.

Parameters

listener

CERewardedVideoAdListener: the ad listener.

setAutoCloseWhenEngaged

void setAutoCloseWhenEngaged(boolean isAutoClose)

Instruct SDK to close the rewarded video ad after user clicks the ad. You should call this method before loadAdInstant/loadAdAsync if necessary.

Parameters

isAutoClose

boolean: if auto close when ad is engaged or not.

show

void show()

Start the rewarded videoActivity. You should call this method after onAdLoaded().

show

void show(int enterAnim, int exitAnim)

Start the rewarded videoActivity with animation effect. You should call this method after onAdLoaded().

Parameters

enterAnim

int: A resource ID of the animation resource to use for the incoming activity. Use 0 for no animation.

exitAnim

int: A resource ID of the animation resource to use for the outgoing activity. Use 0 for no animation.

Last updated