简体   繁体   中英

How can I show ironSource Interstitial ads on RecylerView Item clicked

How can I show ironSource Interstitial ads on RecylerView Item clicked

This way is not official to solve this problem but it worked for me you can also try it.

 IronSource.init(MainActivity.this, "162082b5d");

 //loading interstitial Ad
 IronSource.loadInterstitial();

 //Init Interstitial
 IronSource.init(this, "162082b5d", IronSource.AD_UNIT.INTERSTITIAL);

 //ironSource Ad
 //Interstitial Ads
 IronSource.setInterstitialListener(new InterstitialListener() {
                        @Override
                        public void onInterstitialAdReady() {
                        }
                        @Override
                        public void onInterstitialAdLoadFailed(IronSourceError error) {
                            System.out.println("Failed To Load Ads");
                        }
                        @Override
                        public void onInterstitialAdOpened() {
                        }
                        @Override
                        public void onInterstitialAdClosed() {
                        }
                        @Override
                        public void onInterstitialAdShowFailed(IronSourceError error) {
                            IronSource.showInterstitial("DefaultInterstitial");
                        }
                        @Override
                        public void onInterstitialAdClicked() {
                        }
                        @Override
                        public void onInterstitialAdShowSucceeded() {
                        }
                    });
                    IronSource.showInterstitial("DefaultInterstitial");
                    IronSource.loadInterstitial();

How it worked:-

I just called IronSource.loadInterstitial(); in onInterstitialAdShowFailed method.

Hope it works for you. Happy Coding...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM