我已经跟进Google Admob
开始创建一个Xcode
带有链接的项目,Swift3
但FireBase
总是得到错误:
class AppDelegate: UIResponder, UIApplicationDelegate { Thread 1: signal SIGABRT }
已运行 pod update 更多时间,
我的代码: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.
}
}