Wednesday, 15 December 2021

Admob rewarded ad not showed even if the petitions get response

I have an Android application written in Java where I give coins to use the application by watching a rewardered ad using the Admob advertising network.

I have followed the new API implementation guide. My frown starts when I receive implementation instructions by email, and they link to the old API. Which of the two APIs do I have to implement?

On the other hand, I start the mediation, and upload an update with a button to see the rewarded ad and get the coins, and another to get free coins. Only the Chocolate network has accepted me, the rest rejected.

It has been published like this for a week, and every day, my first 500 users click 10 or 20 times and in Admob I get that I receive those requests and that the response rate is 100%, and only 1 or 2 ads are printed. I had to remove the ad because the app could not be used without coins.

On the other hand, I receive a rejection from a mediation in which they ask me about my traffic and they tell me that they will not be able to offer me the service because it would not generate enough ad traffic.

Have I understood correctly? Does that mean that since I only have one app with only 500 users, I can't trade with Admob with rewardered ads? Would the same thing happen to me on Facebook?

My implementation code in case I have programmed something wrong is the following. With the test id it works, not always on the first click but on the second (sometimes mRewardedAd = null).

build.graddle (module)

dependencies {
    implementation 'com.google.android.gms:play-services-ads:20.5.0'
}

AndroidManifest.xml

<application>
    <meta-data
        android:name="com.google.android.gms.ads.APPLICATION_ID"
        android:value="ca-app-pub-my-app-id"/>
</application>

MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    MobileAds.initialize(this, new OnInitializationCompleteListener() {
            @Override
            public void onInitializationComplete(InitializationStatus initializationStatus) {
            }
    });
}

Shop.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    AdRequest adRequest = new AdRequest.Builder().build();
    RewardedAd.load(this, "ca-app-pub-my-rewarded-ad-id",
            adRequest, new RewardedAdLoadCallback() {
                @Override
                public void onAdFailedToLoad(@NonNull LoadAdError loadAdError) {
                    // Handle the error.
                    mRewardedAd = null;
                }
                @Override
                public void onAdLoaded(@NonNull RewardedAd rewardedAd) {
                    mRewardedAd = rewardedAd;
                    mRewardedAd.setFullScreenContentCallback(new FullScreenContentCallback() {
                        @Override
                        public void onAdShowedFullScreenContent() {
                            // Called when ad is shown.
                        }

                        @Override
                        public void onAdFailedToShowFullScreenContent(AdError adError) {
                            // Called when ad fails to show.
                        }

                        @Override
                        public void onAdDismissedFullScreenContent() {
                            // Called when ad is dismissed.
                            // Set the ad reference to null so you don't show the ad a second time.
                            mRewardedAd = null;
                        }
                    });
                }
            });
    Button btnAdd = findViewById(R.id.btnAdd);
    btnAdd.setOnClickListener(v -> {
        if (mRewardedAd != null) {
            Activity activityContext = Shop.this;
            mRewardedAd.show(activityContext, new OnUserEarnedRewardListener() {
                @Override
                public void onUserEarnedReward(@NonNull RewardItem rewardItem) {
                    daCoinsAdd();
                }
            });
        } else {
            switch (languaje) {
                case "es": {
                    Toast toast = Toast.makeText(getApplicationContext(), "No cargó el anuncio.", Toast.LENGTH_SHORT);
                    toast.show();
                    break;
                }
                case "it": {
                    Toast toast = Toast.makeText(getApplicationContext(), "Non ha caricato l'annuncio.", Toast.LENGTH_SHORT);
                    toast.show();
                    break;
                }
                case "fr": {
                    Toast toast = Toast.makeText(getApplicationContext(), "Il n'a pas chargé l'annonce.", Toast.LENGTH_SHORT);
                    toast.show();
                    break;
                }
                default: {
                    Toast toast = Toast.makeText(getApplicationContext(), "It did not load the ad.", Toast.LENGTH_SHORT);
                    toast.show();
                    break;
                }
            }
        }
    });
}    

It is normal that the ad doesn't load in the first click as my app is new and I have no traffic, or I have done something wrongly?



from Admob rewarded ad not showed even if the petitions get response

No comments:

Post a Comment