|
35 | 35 |
|
36 | 36 | #import <Firebase/Firebase.h> |
37 | 37 |
|
| 38 | +// Shared auth |
| 39 | +#import "FirebaseAuthDelegate.h" |
| 40 | +#import "FirebaseLoginButton.h" |
| 41 | +#import "FirebaseAuthProvider.h" |
| 42 | + |
| 43 | +// Pull in Twitter |
| 44 | +#if FIREBASEUI_ENABLE_TWITTER_AUTH |
| 45 | +#import "FirebaseTwitterAuthProvider.h" |
| 46 | +#endif |
| 47 | + |
| 48 | +// Pull in Facebook |
| 49 | +#if FIREBASEUI_ENABLE_FACEBOOK_AUTH |
| 50 | +#import "FirebaseFacebookAuthProvider.h" |
| 51 | +#endif |
| 52 | + |
| 53 | +// Pull in Google |
| 54 | +#if FIREBASEUI_ENABLE_GOOGLE_AUTH |
| 55 | +#import "FirebaseGoogleAuthProvider.h" |
| 56 | +#endif |
| 57 | + |
| 58 | +// Google local build issues |
| 59 | +#if FIREBASEUI_ENABLE_GOOGLE_AUTH |
38 | 60 | #if LOCAL_BUILD |
39 | 61 | #import <GoogleSignIn/GoogleSignIn.h> |
40 | 62 | #else |
41 | 63 | #import <Google/SignIn.h> |
42 | 64 | #endif |
| 65 | +#endif |
43 | 66 |
|
44 | | -#import "FirebaseAuthDelegate.h" |
45 | | -#import "FirebaseTwitterAuthProvider.h" |
46 | | -#import "FirebaseFacebookAuthProvider.h" |
47 | | -#import "FirebaseGoogleAuthProvider.h" |
| 67 | +// Pull in Password |
| 68 | +#if FIREBASEUI_ENABLE_PASSWORD_AUTH |
48 | 69 | #import "FirebasePasswordAuthProvider.h" |
49 | | -#import "FirebaseLoginButton.h" |
| 70 | +#endif |
50 | 71 |
|
51 | 72 | /** |
52 | 73 | * FirebaseLoginViewController is a subclass of UIViewController that provides a |
|
55 | 76 | * error handling. |
56 | 77 | * This also serves as a template for developers interested in developing custom login UI. |
57 | 78 | */ |
| 79 | +#if FIREBASEUI_ENABLE_TWITTER_AUTH && FIREBASEUI_ENABLE_GOOGLE_AUTH |
58 | 80 | @interface FirebaseLoginViewController |
59 | 81 | : UIViewController<FirebaseAuthDelegate, TwitterAuthDelegate, GIDSignInUIDelegate> |
| 82 | +#elif FIREBASEUI_ENABLE_TWITTER_AUTH |
| 83 | +@interface FirebaseLoginViewController |
| 84 | +: UIViewController<FirebaseAuthDelegate, TwitterAuthDelegate> |
| 85 | +#elif FIREBASEUI_ENABLE_GOOGLE_AUTH |
| 86 | +@interface FirebaseLoginViewController |
| 87 | +: UIViewController<FirebaseAuthDelegate, GIDSignInUIDelegate> |
| 88 | +#else |
| 89 | +@interface FirebaseLoginViewController: UIViewController<FirebaseAuthDelegate> |
| 90 | +#endif |
| 91 | + |
60 | 92 |
|
61 | 93 | /** |
62 | 94 | * Container view for login activity which wraps the header text and cancel button. |
|
116 | 148 | /** |
117 | 149 | * Dismissal callback on success or failure. |
118 | 150 | */ |
119 | | -@property (nonatomic, copy) void (^dismissCallback)(FAuthData *user, NSError *error); |
| 151 | +@property(nonatomic, copy) void (^dismissCallback)(FAuthData *user, NSError *error); |
120 | 152 |
|
121 | 153 | /** |
122 | 154 | * The Firebase database reference which to authenticate against. |
|
128 | 160 | * requests against the Twitter API and uses the response to authenticate |
129 | 161 | * against the Firebase database. |
130 | 162 | */ |
| 163 | +#if FIREBASEUI_ENABLE_TWITTER_AUTH |
131 | 164 | @property(strong, nonatomic) FirebaseTwitterAuthProvider *twitterAuthProvider; |
| 165 | +#else |
| 166 | +@property(strong, nonatomic) FirebaseAuthProvider *twitterAuthProvider; |
| 167 | +#endif |
132 | 168 |
|
133 | 169 | /** |
134 | 170 | * The provider object for Facebook Authentication. This object handles the |
135 | 171 | * requests against the Facebook SDK and uses the response to authenticate |
136 | 172 | * against the Firebase database. |
137 | 173 | */ |
| 174 | +#if FIREBASEUI_ENABLE_FACEBOOK_AUTH |
138 | 175 | @property(strong, nonatomic) FirebaseFacebookAuthProvider *facebookAuthProvider; |
| 176 | +#else |
| 177 | +@property(strong, nonatomic) FirebaseAuthProvider *facebookAuthProvider; |
| 178 | +#endif |
| 179 | + |
139 | 180 |
|
140 | 181 | /** |
141 | 182 | * The provider object for Google Authentication. This object handles the |
142 | 183 | * requests against the Google SDK and uses the response to authenticate |
143 | 184 | * against the Firebase database. |
144 | 185 | */ |
| 186 | +#if FIREBASEUI_ENABLE_GOOGLE_AUTH |
145 | 187 | @property(strong, nonatomic) FirebaseGoogleAuthProvider *googleAuthProvider; |
| 188 | +#else |
| 189 | +@property(strong, nonatomic) FirebaseAuthProvider *googleAuthProvider; |
| 190 | +#endif |
146 | 191 |
|
147 | 192 | /** |
148 | 193 | * The provider object for Email/Password Authentication. This object handles the |
149 | 194 | * requests to the Firebase user authentication system to authenticate users to |
150 | 195 | * the Firebase database. |
151 | 196 | */ |
| 197 | +#if FIREBASEUI_ENABLE_PASSWORD_AUTH |
152 | 198 | @property(strong, nonatomic) FirebasePasswordAuthProvider *passwordAuthProvider; |
| 199 | +#else |
| 200 | +@property(strong, nonatomic) FirebaseAuthProvider *passwordAuthProvider; |
| 201 | +#endif |
153 | 202 |
|
154 | 203 | /** |
155 | 204 | * Create an instance of FirebaseLoginViewController, which allows for easy authentication to |
|
169 | 218 |
|
170 | 219 | /** |
171 | 220 | * Callback that fires when after the controller is dismissed (either on success or on failure). |
172 | | - * If successful, the user field will be populated; if an error occurred the error field will be populated. |
| 221 | + * If successful, the user field will be populated; if an error occurred the error field will be |
| 222 | + * populated. |
173 | 223 | * @param callback A block that returns a user on success or an error on failure. |
174 | 224 | * @return void |
175 | 225 | */ |
|
0 commit comments