Rewarded Video 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>

Initialize RewardedVideoAd class

import com.intowow.sdk.RewardedVideoAd;

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);
}

NOTE : please make sure to pass Activity on to the RewardedVideoAd.

Setup the RequestInfo

  • You need to set the placement ID and the request timeout in requestInfo.

Load ad with RequestInfo

loadAdInstant

With loadAdInstant , our synchronous method , You will get the result of loading ad by CERequestResult directly.

loadAdAsync

loadAdAsync is an asynchronous method, you can set timeout via RequestInfo, and get the result of ad request by CEAdRequestListener.

Add CERewardedVideoAdListener to get the result of ad request and ad event callback.

Release ad when the Activity is destroyed

Handle Landscape Orientation

  • There are two options to handle landscape orientation.

    • Add android:configChanges="orientation|screenSize in AndroidManifest.xml.

    • If ad is displayed in landscape mode, your Activity will be recreated. You can have a variable to remember if you’ve requested rewardedVideoAd ad or not in onSaveInstanceState(). Later you can retrieve that variable in onCreate() and avoid requesting rewarded ad twice. See BaseActivity.java in sample app source code.

If you want to get more information about integration, please refer to RewardedVideoAd class.

Last updated