IOS DoubleClick for Publishers (DFP) .. Error: No ads to serve

I am using DoubleClick for Publishers (DFP) in my application. I integrated it as DOCs as follows.

 dfpBannerView_ = [[DFPBannerView alloc] initWithAdSize:kGADAdSizeBanner];
 dfpBannerView_.adUnitID = kSampleAdUnitID;
// Set the delegate to listen for GADBannerViewDelegate events.
dfpBannerView_.delegate = self;

// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
dfpBannerView_.rootViewController = self;
[self.view addSubview:dfpBannerView_];

// Initiate a generic request to load it with an ad.
[dfpBannerView_ loadRequest:[GADRequest request]];

where kSampleAdUnitID is the identifier of the application module I created.

next delegate getcalled method

- (void)adView:(DFPBannerView *)view
didFailToReceiveAdWithError:(GADRequestError *)error {
NSLog(@"Failed to receive ad with error: %@", [error localizedFailureReason]);
NSLog(@"%d",error.code);
}

But still I get the error as follows:

Failed to receive ad with error: Request Error: No ad to show.
2014-04-11 17:40:55.836 DFPBannerExample[6319:70b] 1

If error code 1 indicates /// The ad request was successful, but no ad was returned. kGADErrorNoFill,

I do not understand where the problem is. Why am I not getting ads while I get Ads for the App Unit example.

+4
source share
1 answer

, -, , adunit: :

 bannerView_ = [[DFPBannerView alloc] initWithFrame:CGRectMake(111, 483, 537, 120)];

bannerView_.adUnitID = @"/5900406/UserAppWaitingView";

// the user wherever the ad goes and add it to the view hierarchy.

bannerView_.rootViewController = self; [self.view addSubview: bannerView _];

// Initiate a generic request to load it with an ad.

[bannerView_ loadRequest: [ GADRequest]];

0

Source: https://habr.com/ru/post/1536101/


All Articles