Ich habe ein Problem bei der Implementierung des FBAudienceNetwork SDK auf iOS. Das Problem betrifft die Interstitial-Anzeige, die ich auf einem UIViewController von viewDidLoad präsentieren möchte.iOS Facebook Interstitial Ad
Mein Code ist:
- (void)loadInterstitial
{
[FBAdSettings addTestDevice:@"code"];
FBInterstitialAd *interstitialAd = [[FBInterstitialAd alloc] initWithPlacementID:@"code"];
interstitialAd.delegate = self;
[interstitialAd loadAd];
}
- (void)interstitialAdDidLoad:(FBInterstitialAd *)interstitialAd
{
NSLog(@"Ad is loaded and ready to be displayed");
// You can now display the full screen ad using this code:
[interstitialAd showAdFromRootViewController:self];
}
- (void)interstitialAd:(FBInterstitialAd *)interstitialAd didFailWithError:(NSError *)error
{
NSLog(@"Ad failed to load");
}
Das erste Mal, dass ich die View-Controller präsentieren, wird die Anzeige nicht erscheinen, und keiner der Delegierten Methoden aufgerufen werden. Das zweite Mal, dass ich den View-Controller präsentiert, druckt die Konsole die folgende Meldung:
[FBAudienceNetworkLog/FBAdURLSession:183 <error>] HTTP error, status=0, error=Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLKey=https://graph.facebook.com/network_ads_common/, NSLocalizedDescription=cancelled, NSErrorFailingURLStringKey=https://graph.facebook.com/network_ads_common/}, bytes=0, encoding=(null), url=network_ads_common/ -- https://graph.facebook.com
Hat jemand eine Ahnung, was das Problem sein könnte? Vielen Dank.
P.S. Die Werbebanner funktionieren.