gpt4 book ai didi

ios - 我的 iAd 代码有问题吗?

转载 作者:行者123 更新时间:2023-11-28 09:55:29 27 4
gpt4 key购买 nike

我的应用程序在几天前才获得批准,并且在屏幕底部有一个 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 日)正式停用。我现在不确定“注册”过程,但我相信 Apple 几个月前就停止注册应用程序以接收来自其网络的广告

关于ios - 我的 iAd 代码有问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38106448/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com