【发布时间】:2019-03-09 05:09:16
【问题描述】:
我已按照 google firebase 启动说明设置 firebase 身份验证,但我一直收到错误消息
由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“找不到国家代码文件”
我已经添加了所有的 podFiles 我不确定哪个文件可能丢失了我该如何解决这个问题。我一直在关注FireBase Tutorial
import UIKit
import Firebase
import FirebaseUI
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,FUIAuthDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FirebaseApp.configure()
let authUI = FUIAuth.defaultAuthUI()
// You need to adopt a FUIAuthDelegate protocol to receive callback
authUI!.delegate = self
let providers: [FUIAuthProvider] = [
FUIGoogleAuth(),
FUIPhoneAuth(authUI:FUIAuth.defaultAuthUI()!),
]
authUI!.providers = providers
return true
}
func application(_ app: UIApplication, open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any]) -> Bool {
let sourceApplication = options[UIApplication.OpenURLOptionsKey.sourceApplication] as! String?
if FUIAuth.defaultAuthUI()?.handleOpen(url, sourceApplication: sourceApplication) ?? false {
return true
}
// other URL handling goes here.
return false
}
}
【问题讨论】:
标签: ios swift firebase firebase-realtime-database firebase-authentication