ios – 使用Firebase时使用未解析的标识符“FIRDatabase”

Xcode告诉我,FIRDatabase不是标识符.
我的代码:
import UIKit
import Firebase

@UIApplicationMain
class AppDelegate: UIResponder,UIApplicationDelegate {

    var window: UIWindow?

    func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        FIRApp.configure()
        FIRDatabase.database().persistenceEnabled = true // Use of unresolved identifier 'FIRDatabase'
        return true
    }
}

我在用:

Xcode 7.2.1,
Firebase 3.0.2,
OSX 10.10.5

Podfile内容:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios,'8.0'
use_frameworks!

target 'myapp' do
pod 'IQKeyboardManagerSwift','<= 4.0.0'
pod 'JSQMessagesViewController','<= 7.3.1'
pod 'Firebase'
end

解决方法

你需要添加
pod 'Firebase/Database'

到你的pod文件,如这里所述

https://firebase.google.com/docs/database/ios/start

在这里,您可以找到哪个pod包含哪个功能
Pods and Features

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...