Objective c Facebook观众网络间隙未显示
我正在开发我的应用程序,它是使用Sprite工具包构建的。我试图添加加载广告的功能,但广告没有加载。我不确定这是因为我的应用程序还没有上线,我需要打开某种“沙盒”,还是我做错了什么。广告的显示点从Objective c Facebook观众网络间隙未显示,objective-c,facebook-sdk-4.x,facebook-audience-network,Objective C,Facebook Sdk 4.x,Facebook Audience Network,我正在开发我的应用程序,它是使用Sprite工具包构建的。我试图添加加载广告的功能,但广告没有加载。我不确定这是因为我的应用程序还没有上线,我需要打开某种“沙盒”,还是我做错了什么。广告的显示点从SKScene调用,广告显示功能和方法(加载、显示以及代理)位于父UIViewController中 下面是将应用程序从SKScene定向到ViewController的代码: GameViewController *vc = (GameViewController*)self.view.window.
SKScene
调用,广告显示功能和方法(加载、显示以及代理)位于父UIViewController
中
下面是将应用程序从SKScene
定向到ViewController
的代码:
GameViewController *vc = (GameViewController*)self.view.window.rootViewController;
[vc loadInterstitial];
GameViewController
是SKScene
的父视图控制器。以下是GameViewController
中包含的代码:
- (void)loadInterstitial
{
self.interstitialAd =
[[FBInterstitialAd alloc] initWithPlacementID:@"Placement ID"];
self.interstitialAd.delegate = self;
[self.interstitialAd loadAd];
}
- (void)interstitialAdDidLoad:(FBInterstitialAd *)interstitialAd
{
NSLog(@"Interstitial 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(@"Interstitial ad is failed to load with error: %@", error);
}
没有调用方法
InterstitularAddidLoad
,我也没有收到任何错误 将fbInterstitularAddElegate
添加到您的GameViewController
界面。当我在LoadInterstitual方法内声明fbInterstitularad实例时,我遇到了Interstitural广告未显示的问题。在将声明移到方法之外之后,它神奇地工作了。请参见此处的Facebook观众网络示例:嘿,你找到解决此问题的方法了吗?