Interstitial插屏

插屏广告属于全屏广告。一般在关卡过渡,应用开始等节点出现。一般来说插屏广告,用户可选择关闭,并在关闭后返回应用。Vungle插屏的广告素材与奖励广告是相同的。插屏与奖励广告取决于传入参数placement reference id在dashboard上的类型。

请求广告

SDK发送广告请求,在服务器给填充后开始缓存视频广告素材。

JavaKotlin

// Load Ad Implementation
if (Vungle.isInitialized()) {
    Vungle.loadAd("YOUR_INTERSTITIAL_PLACEMENT_REFERENCE_ID", new LoadAdCallback() {
        @Override
        public void onAdLoad(String placementReferenceId) { }

        @Override
        public void onError(String placementReferenceId, VungleException e) {
            // Load ad error occurred - e.getLocalizedMessage() contains error message
        }
    });
}

播放广告


if (Vungle.canPlayAd("YOUR_INTERSTITIAL_PLACEMENT_REFERENCE_ID")) {
    AdConfig adConfig = new AdConfig();
    // Mute
    // adConfig.setMuted(true); 
    // Set Oritation
    // adConfig.setAdOrientation(AdConfig.AUTO_ROTATE) // AdConfig.PORTRAIT, AdConfig.LANDSCAPE

    Vungle.playAd("YOUR_INTERSTITIAL_PLACEMENT_REFERENCE_ID", adConfig, new PlayAdCallback() {
        @Override
        public void onAdStart(String id) { 
            // Ad experience started
        }

        @Override
        public void onAdEnd(String id) {
            // Ad experience ended
        }

        @Override
        public void onAdClick(String id) {
            // User clicked on ad
        }

        @Override
        public void onAdRewarded(String id) {
            // User earned reward for watching an ad
        }

        @Override
        public void onAdLeftApplication(String id) {
            // User has left app during an ad experience
        }

        @Override
        public void onError(String id, VungleException exception) { 
            // Ad failed to play
        }
    });
}
Powered by Creativity Driven by Performance Sign Up Here

Questions?

Need further assistance, feel free to reach out to us, we’re here to help!

这篇文章有帮助吗?