Reputation: 839
I am following this tutorial to try and set up the Firebase emulator suite. However, I get the following error: Value of type 'Auth' has no member 'useEmulator'. Here is my code:
import UIKit
import Firebase
import IQKeyboardManager
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
FirebaseApp.configure()
// code block used for local testing where error is showing
let settings = Firestore.firestore().settings
settings.host = "localhost:8080"
settings.isPersistenceEnabled = false
settings.isSSLEnabled = false
Firestore.firestore().settings = settings
Functions.functions().useFunctionsEmulator(origin: "http://localhost:5001")
Auth.auth().useEmulator(withHost:"localhost", port:9099)
//
IQKeyboardManager.shared().isEnabled = true
return true
}
// MARK: UISceneSession Lifecycle
@available(iOS 13.0, *)
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}
}
Podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
target 'Pikit' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Pikit
pod 'Firebase'
pod 'Firebase/Storage'
pod 'Firebase/Auth'
pod 'Firebase/Functions'
pod 'Firebase/Firestore'
pod 'Firebase/Analytics'
pod 'Firebase/Messaging'
pod 'Firebase/DynamicLinks'
pod 'FirebaseUI', '~> 8.0'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'FirebaseUI/OAuth' # Used for Sign in with Apple, Twitter, etc
pod 'FirebaseUI/Phone'
pod 'IQKeyboardManager' # Auto move screen for keyboard
pod 'SDWebImage', :modular_headers => true
pod 'PureLayout'
end
I have tried to build and clean my folder but that did not work. I think that I am not putting the provided code in the proper place but there is no indication within the documentation as to where it should go.
Upvotes: 3
Views: 780
Reputation: 145
This happened to me and I found out my firebase pods were completely out of date. Was solved after I updated to the latest (currently for me it's 8.12 for Firebase/Auth)
Upvotes: 1
Reputation: 1261
If it helps anybody. Cocoapods was not installing the latest Firebase SDK.
In your Podfile:
Bump the min SDK: platform :ios, '14.0'
Change to pod 'FirebaseFirestoreSwift', '~> 7.0-beta'
Upvotes: 1