11import UIKit
22import FirebaseCore
3- import FirebaseWrapper
3+ import Firewrap
44import FirebaseAuth
55import GoogleSignIn
66import SwiftBoost
77
8- public class FirebaseWrapperAuth {
8+ public class FirewrapAuth {
99
1010 public static func configure( authDidChangedWork: ( ( ) -> Void ) ? = nil ) {
1111 // Logs
@@ -49,11 +49,11 @@ public class FirebaseWrapperAuth {
4949 public static var userName : String ? { Auth . auth ( ) . currentUser? . displayName }
5050 public static var userEmail : String ? { Auth . auth ( ) . currentUser? . email }
5151
52- public static var providers : [ FirebaseAuthProvider ] {
52+ public static var providers : [ FirewrapAuthProvider ] {
5353 guard let providerData = Auth . auth ( ) . currentUser? . providerData else { return [ ] }
54- var providers : [ FirebaseAuthProvider ] = [ ]
54+ var providers : [ FirewrapAuthProvider ] = [ ]
5555 for providerMeta in providerData {
56- if let provider = FirebaseAuthProvider . getByBaseURL ( providerMeta. providerID) {
56+ if let provider = FirewrapAuthProvider . getByBaseURL ( providerMeta. providerID) {
5757 providers. append ( provider)
5858 }
5959 }
@@ -70,7 +70,7 @@ public class FirebaseWrapperAuth {
7070
7171 // MARK: - Actions
7272
73- public static func signInWithApple( on controller: UIViewController , completion: ( ( SignInWithAppleData ? , FWAuthSignInError ? ) -> Void ) ? ) {
73+ public static func signInWithApple( on controller: UIViewController , completion: ( ( SignInWithAppleData ? , FirewrapAuthSignInError ? ) -> Void ) ? ) {
7474 printConsole ( " Sign in with Apple... " )
7575 guard let window = controller. view. window else {
7676 completion ? ( nil , . cantPresent)
@@ -103,7 +103,7 @@ public class FirebaseWrapperAuth {
103103 }
104104 }
105105
106- public static func signInWithGoogle( on controller: UIViewController , completion: ( ( FWAuthSignInError ? ) -> Void ) ? ) {
106+ public static func signInWithGoogle( on controller: UIViewController , completion: ( ( FirewrapAuthSignInError ? ) -> Void ) ? ) {
107107 printConsole ( " Sign in with Google... " )
108108 GoogleAuthService . signIn ( on: controller) { data, googleError in
109109 if let googleError {
@@ -131,7 +131,7 @@ public class FirebaseWrapperAuth {
131131 /**
132132 Firebase asking about Dynamic Links, but its will depicated. Observing how shoud change it
133133 */
134- public static func signInWithEmail( email: String , handleURL: URL , completion: ( ( FWAuthSignInError ? ) -> Void ) ? ) {
134+ public static func signInWithEmail( email: String , handleURL: URL , completion: ( ( FirewrapAuthSignInError ? ) -> Void ) ? ) {
135135 printConsole ( " Sign in with Email... " )
136136 EmailAuthService . signIn ( email: email, handleURL: handleURL) { emailError in
137137 if let emailError {
@@ -145,7 +145,7 @@ public class FirebaseWrapperAuth {
145145 }
146146 }
147147
148- static func handleSignInWithEmailURL( _ url: URL , completion: ( ( FWAuthSignInError ? ) -> Void ) ? ) -> Bool {
148+ static func handleSignInWithEmailURL( _ url: URL , completion: ( ( FirewrapAuthSignInError ? ) -> Void ) ? ) -> Bool {
149149 guard Auth . auth ( ) . isSignIn ( withEmailLink: url. absoluteString) else {
150150 completion ? ( nil )
151151 return false
@@ -182,12 +182,12 @@ public class FirebaseWrapperAuth {
182182 Auth . auth ( ) . revokeToken ( withAuthorizationCode: authorizationCode)
183183 }
184184
185- public static func delete( completion: @escaping ( FWADeleteProfileError ? ) -> Void ) {
185+ public static func delete( completion: @escaping ( FirewrapDeleteProfileError ? ) -> Void ) {
186186 printConsole ( " Deleting Profile... " )
187187 Auth . auth ( ) . currentUser? . delete ( completion: { deleteError in
188- let unwrapDeleteError : FWADeleteProfileError ? = {
188+ let unwrapDeleteError : FirewrapDeleteProfileError ? = {
189189 if let deleteError {
190- return FWADeleteProfileError . get ( by: deleteError) ?? . failed
190+ return FirewrapDeleteProfileError . get ( by: deleteError) ?? . failed
191191 } else {
192192 return nil
193193 }
@@ -206,13 +206,13 @@ public class FirebaseWrapperAuth {
206206 }
207207
208208 private static func printConsole( _ text: String ) {
209- debug ( " FirebaseWrapper , Auth: " + text)
209+ debug ( " Firewrap , Auth: " + text)
210210 }
211211
212212 // MARK: - Singltone
213213
214214 private var observer : AuthStateDidChangeListenerHandle ?
215- private static let shared = FirebaseWrapperAuth ( )
216- private var completionSignInViaEmail : ( ( FWAuthSignInError ? ) -> Void ) ? = nil
215+ private static let shared = FirewrapAuth ( )
216+ private var completionSignInViaEmail : ( ( FirewrapAuthSignInError ? ) -> Void ) ? = nil
217217 private init ( ) { }
218218}
0 commit comments