IOS10,Xcode 8.2 Google Admob问题

时间:2016-12-20 05:10:50

标签: swift xcode google-admob

我已跟进Google Admob开始使用XcodeSwift3链接创建FireBase项目 但总是得到错误:
class AppDelegate: UIResponder, UIApplicationDelegate { Thread 1: signal SIGABRT }

已经让pod更新了更多时间,

我的代码:Appdelegate.swift

//I has import Firebase and GoogleMobileAds
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        FIRApp.configure()
        //GADMobileAds.configure(withApplicationID: "ca-app-pub-3940256099942544~1458002511")
        return true
    }

ViewController.swift

//I has import Firebase and GoogleMobileAds

    let kBannerAdUnitID = "ca-app-pub-3940256099942544/2934735716"

    class ViewController: UIViewController, GADBannerViewDelegate, GADInterstitialDelegate {

        @IBOutlet weak var bannerView: GADBannerView!
        override func viewDidLoad() {
            super.viewDidLoad()

            self.bannerView.adUnitID = kBannerAdUnitID
            self.bannerView.rootViewController = self
            self.bannerView.load(GADRequest())

            // Do any additional setup after loading the view, typically from a nib.
        }

        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    }

1 个答案:

答案 0 :(得分:0)

抱歉全部,我找到了答案,我忘了将我的项目链接到Firebase。 忘了将GoogleService-info.plist添加到我的项目中。