imgRewarded Video Ads in Facebook Not Showing while Testing.I am adding testing id but ad is not load Error IS -Rewarded video ad failed to load: 1203 -Rewarded video ad failed to load: An unknown error has occurred. -Rewarded Ad is not ready
public void loadRewardedAd(Activity activity) {
rewardedVideoAd = new RewardedVideoAd(activity, "VID_HD_16_9_46S_APP_INSTALL#YOUR_PLACEMENT_ID");
RewardedVideoAdListener rewardedVideoAdListener = new RewardedVideoAdListener() {
@Override
public void onError(Ad ad, AdError error) {
// Rewarded video ad failed to load
Log.e(TAG, "Rewarded video ad failed to load: " + error.getErrorCode());
Log.e(TAG, "Rewarded video ad failed to load: " + error.getErrorMessage());
}
@Override
public void onAdLoaded(Ad ad) {
}
@Override
public void onAdClicked(Ad ad) {
}
@Override
public void onLoggingImpression(Ad ad) {
}
@Override
public void onRewardedVideoCompleted() {
}
@Override
public void onRewardedVideoClosed() {
}
};
rewardedVideoAd.loadAd(rewardedVideoAd.buildLoadAdConfig().withAdListener(rewardedVideoAdListener).build());
}
// Show Rewarded ad
public void showRewardedAd(Activity activity, MyCallback callback) {
this.myCallback = callback;
if (activity == null || activity.isFinishing()) {
if (myCallback != null) {
myCallback.onAdCompleted(); // Notify ad completion
}
Log.e(TAG, "Context is null or Activity is finishing");
return;
}
if (rewardedVideoAd != null && rewardedVideoAd.isAdLoaded()) {
rewardedVideoAd.show();
} else {
loadRewardedAd(activity);
if (myCallback != null) {
myCallback.onAdCompleted(); // Notify ad completion
}
Log.e(TAG, "Rewarded Ad is not ready");
}
}
this is mycode What should i do for testing ad?