After the announcement that it will close in January of next year. I have decided to use Firebase. The good thing is that my App is still in development and had not advanced much, however one of the parts that had already been proven was the authentication. I used PFLogInViewController at the time to make my life easier but now with Firebase I'm trying to use FirebaseLoginViewController that works in a very similar way, both classes (FirebaseLoginViewController and PFLogInViewController) inherit from UIViewController and at least in parse it was very easy to customize it. In firebase there is not much documentation about it and I'm giving myself bumps.
This is what I have at the moment.
import UIKit
class AccesoPrincipal : FirebaseLoginViewController{
override func viewDidLoad() {
super.viewDidLoad()
let firebaseRef = Firebase(url: "https://superaapp.firebaseio.com/")
self.loginViewController = FirebaseLoginViewController(ref: firebaseRef)
self.loginViewController.enableProvider(FAuthProvider.Facebook)
//self.loginViewController.enableProvider(FAuthProvider.Google)
//self.loginViewController.enableProvider(FAuthProvider.Twitter)
self.loginViewController.enableProvider(FAuthProvider.Password)
// Scenario 1: Set up captive portal login flow
self.loginViewController.didDismissWithBlock { (user: FAuthData, error: NSError) -> Void in
if (user) {
// Handle user case
} else if (error) {
// Handle error case
} else {
// Handle cancel case
}
}
// Scenario 1: Application launches login flow, handles dismissal and routing in 'didDismissWithBlock:'
override func viewDidAppear(animated: Bool) {
if (!self.loginViewController.currentUser()) {
self.presentViewController(self.loginViewcontroller, animated: true, completion: nil)
}
}
override func logout() {
if (self.loginViewController.currentUser()) {
self.loginViewController.logout()
}
}
}
I have taken the previous code fragment from the FirebaseUi-IOS documentation itself link and I have been giving bumps with the errors.
My pod install file
platform :ios, '9.2'
pod 'Firebase'
pod 'FirebaseUI', '~> 0.3'
my header.h file, where I do not know if I'm invoking FirebaseLoginViewController correctly
#ifndef Header_h
#define Header_h
#endif /* Header_h */
#import <FirebaseLoginViewController.h>
#import <Firebase/Firebase.h>