本文整理汇总了Java中com.applovin.adview.AppLovinIncentivizedInterstitial类的典型用法代码示例。如果您正苦于以下问题:Java AppLovinIncentivizedInterstitial类的具体用法?Java AppLovinIncentivizedInterstitial怎么用?Java AppLovinIncentivizedInterstitial使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AppLovinIncentivizedInterstitial类属于com.applovin.adview包,在下文中一共展示了AppLovinIncentivizedInterstitial类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.applovin.adview.AppLovinIncentivizedInterstitial; //导入依赖的package包/类
@Override
public void initialize(final Context context,
final MediationAdRequest adRequest,
final String userId,
final MediationRewardedVideoAdListener listener,
final Bundle serverParameters,
final Bundle networkExtras) {
if (!validateContext(context)) {
log(ERROR, "Unable to request AppLovin rewarded video. Invalid context provided.");
listener.onInitializationFailed(this, AdRequest.ERROR_CODE_INVALID_REQUEST);
return;
}
log(DEBUG, "Initializing AppLovin rewarded video...");
this.mContext = context;
mRewardedAdMobListener = listener;
this.mServerParameters = serverParameters;
if (!mInitialized) {
mRewardedSdk = sdkInstance(context);
mInitialized = true;
mRewardedAd = AppLovinIncentivizedInterstitial.create(mRewardedSdk);
mAppLovinAdListener = new AppLovinAdListener(this, mRewardedAdMobListener);
}
mRewardedAdMobListener.onInitializationSucceeded(this);
}
示例2: loadAd
import com.applovin.adview.AppLovinIncentivizedInterstitial; //导入依赖的package包/类
@Override
public void loadAd(final MediationAdRequest adRequest, final Bundle serverParameters, final Bundle networkExtras)
{
log( DEBUG, "Requesting AppLovin rewarded video with networkExtras: " + networkExtras );
// Zones support is available on AppLovin SDK 7.5.0 and higher
final String zoneId;
if ( AppLovinSdk.VERSION_CODE >= 750 && networkExtras != null && networkExtras.containsKey( "zone_id" ) )
{
zoneId = networkExtras.getString( "zone_id" );
}
else
{
zoneId = DEFAULT_ZONE;
}
// Check if incentivized ad for zone already exists
if ( GLOBAL_INCENTIVIZED_INTERSTITIAL_ADS.containsKey( zoneId ) )
{
incentivizedInterstitial = GLOBAL_INCENTIVIZED_INTERSTITIAL_ADS.get( zoneId );
}
else
{
// If this is a default Zone, create the incentivized ad normally
if ( DEFAULT_ZONE.equals( zoneId ) )
{
incentivizedInterstitial = AppLovinIncentivizedInterstitial.create( this.context );
}
// Otherwise, use the Zones API
else
{
incentivizedInterstitial = createIncentivizedInterstitialForZoneId( zoneId, AppLovinSdk.getInstance( this.context ) );
}
GLOBAL_INCENTIVIZED_INTERSTITIAL_ADS.put( zoneId, incentivizedInterstitial );
}
incentivizedInterstitial.preload( this );
}
示例3: loadWithSdkInitialized
import com.applovin.adview.AppLovinIncentivizedInterstitial; //导入依赖的package包/类
@Override
protected void loadWithSdkInitialized(@NonNull final Activity activity, @NonNull final Map<String, Object> localExtras, @NonNull final Map<String, String> serverExtras) throws Exception
{
log( DEBUG, "Requesting AppLovin rewarded video with serverExtras: " + serverExtras );
parentActivity = activity;
// Zones support is available on AppLovin SDK 7.5.0 and higher
final String zoneId;
if ( AppLovinSdk.VERSION_CODE >= 750 && serverExtras != null && serverExtras.containsKey( "zone_id" ) )
{
zoneId = serverExtras.get( "zone_id" );
}
else
{
zoneId = DEFAULT_ZONE;
}
// Check if incentivized ad for zone already exists
if ( GLOBAL_INCENTIVIZED_INTERSTITIAL_ADS.containsKey( zoneId ) )
{
incentivizedInterstitial = GLOBAL_INCENTIVIZED_INTERSTITIAL_ADS.get( zoneId );
}
else
{
// If this is a default Zone, create the incentivized ad normally
if ( DEFAULT_ZONE.equals( zoneId ) )
{
incentivizedInterstitial = AppLovinIncentivizedInterstitial.create( activity );
}
// Otherwise, use the Zones API
else
{
incentivizedInterstitial = createIncentivizedInterstitialForZoneId( zoneId, AppLovinSdk.getInstance( activity ) );
}
GLOBAL_INCENTIVIZED_INTERSTITIAL_ADS.put( zoneId, incentivizedInterstitial );
}
incentivizedInterstitial.preload( this );
}