Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.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
Ios 我的iAd代码有问题吗?_Ios_Swift_Sprite Kit_Iad_Ads - Fatal编程技术网

Ios 我的iAd代码有问题吗?

Ios 我的iAd代码有问题吗?,ios,swift,sprite-kit,iad,ads,Ios,Swift,Sprite Kit,Iad,Ads,我的应用程序几天前刚刚获得批准,屏幕底部有一个iAd横幅。我知道在那里,广告要开始出现可能需要一周的时间,但在我等待的时候。。有人能确保我的代码中没有任何错误吗 import UIKit import SpriteKit import iAd import GameKit class GameViewController: UIViewController, ADBannerViewDelegate, GKLocalPlayerListener { var adBanner: ADBanne

我的应用程序几天前刚刚获得批准,屏幕底部有一个iAd横幅。我知道在那里,广告要开始出现可能需要一周的时间,但在我等待的时候。。有人能确保我的代码中没有任何错误吗

import UIKit
import SpriteKit
import iAd
import GameKit

class GameViewController: UIViewController, ADBannerViewDelegate, GKLocalPlayerListener {

var adBanner: ADBannerView!
override func viewDidLoad() {
    super.viewDidLoad()
    authenticateLocalPlayer()
    if let scene = GameScene(fileNamed:"GameScene") {
        // Configure the view.
        let skView = self.view as! SKView

        skView.ignoresSiblingOrder = true
        scene.scaleMode = .AspectFill

        skView.presentScene(scene)


    }

}

func loadBanner() {

    adBanner = ADBannerView(frame: CGRect.zero)
    adBanner.center = CGPoint(x: adBanner.center.x, y: view.bounds.size.height - adBanner.frame.size.height / 2)
    adBanner.delegate = self
    adBanner.hidden = true
    view.addSubview(adBanner)
}
func bannerViewDidLoadAd(banner: ADBannerView!) {
    adBanner.hidden = false
}
func bannerView(banner: ADBannerView!, didFailToReceiveAdWithError error: NSError!) {

    adBanner.hidden = true
}
func bannerViewActionShouldBegin(banner: ADBannerView!, willLeaveApplication willLeave: Bool) -> Bool {
    return true
}
override func shouldAutorotate() -> Bool {
    return true
}

override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
    if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
        return .AllButUpsideDown
    } else {
        return .All
    }
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Release any cached data, images, etc that aren't in use.
}

override func prefersStatusBarHidden() -> Bool {
    return true
}


func authenticateLocalPlayer() {
    let localPlayer = GKLocalPlayer.localPlayer()
    localPlayer.authenticateHandler = {(viewController, error) -> Void in

        if (viewController != nil) {
            self.presentViewController(viewController!, animated: true, completion: nil)
        }
        else {
            print((GKLocalPlayer.localPlayer().authenticated))
        }
    }
}
}


现在它只显示一个白色矩形。我的代码有什么问题吗?还是我需要一直等待我的应用程序开始接收广告?

iAd从明天(2016年6月30日)起正式停止。我不确定现在的“注册”过程,但我相信苹果几个月前就停止了注册应用程序以接收来自其网络的广告

iAd将于明天(2016年6月30日)正式停止。我现在不确定“注册”的过程,但我相信苹果几个月前就停止了注册应用程序来接收来自其网络的广告了

谁调用了
loadBanner()


您可以考虑重写<代码> VIELDIDFACTS()/代码>并将代码移到那里。< /P> < P>谁调用<代码> Load BANNER()/<代码> < /P>


您可能会考虑重写<代码> VIELDIDFACTS()/代码>并将代码移到那里。

因此,我需要实现ADMOB或其他第三方广告服务,而不是IAD。是的,如果您正在寻找基于广告的收入,还有其他提供商。IAD今天已经关闭。iAd框架将被弃用:。因此,我需要实施AdMob或其他第三方广告服务,而不是iAd?是的,如果您正在寻求基于广告的收入,则还有其他提供商。iAd今天已关闭。iAd框架将被弃用:。