Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c Facebook观众网络间隙未显示_Objective C_Facebook Sdk 4.x_Facebook Audience Network - Fatal编程技术网

Objective c Facebook观众网络间隙未显示

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.

我正在开发我的应用程序,它是使用Sprite工具包构建的。我试图添加加载广告的功能,但广告没有加载。我不确定这是因为我的应用程序还没有上线,我需要打开某种“沙盒”,还是我做错了什么。广告的显示点从
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观众网络示例:

嘿,你找到解决此问题的方法了吗?