Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 41 additions & 9 deletions FirebaseUI.podspec
Original file line number Diff line number Diff line change
@@ -1,29 +1,61 @@
Pod::Spec.new do |s|
s.name = "FirebaseUI"
s.version = "0.3.1"
s.version = "0.3.2"
s.summary = "UI binding libraries for Firebase."
s.homepage = "https://github.com/firebase/FirebaseUI-iOS"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Firebase" => "support@firebase.com" }
s.social_media_url = "https://twitter.com/firebase"
s.source = { :git => "https://github.com/firebase/FirebaseUI-iOS.git", :tag => 'v0.3.1' }
s.source = { :git => "https://github.com/firebase/FirebaseUI-iOS.git", :tag => 'v0.3.2' }
s.platform = :ios
s.ios.deployment_target = "8.0"
s.dependency "Firebase", "~>2.2"
s.ios.framework = "UIKit"
s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/Firebase"' }
s.requires_arc = true
s.default_subspecs = 'Core', 'Auth'

s.subspec 'Core' do |core|
core.source_files = "FirebaseUI/{Core,Util}/**/*.{h,m}"
end

s.subspec 'Auth' do |auth|
auth.source_files = "FirebaseUI/Auth/**/*.{h,m}"
auth.resources = "FirebaseUI/Auth/Resources/*"
auth.dependency "FBSDKCoreKit"
auth.dependency "FBSDKLoginKit"
auth.dependency "Google/SignIn"
auth.ios.framework = "Accounts"
auth.dependency "FirebaseUI/Facebook"
auth.dependency "FirebaseUI/Google"
auth.dependency "FirebaseUI/Twitter"
auth.dependency "FirebaseUI/Password"
end
end

s.subspec 'AuthHelper' do |helper|
helper.source_files = "FirebaseUI/Auth/**/{FirebaseAppDelegate,FirebaseLoginViewController,FirebaseAuthConstants,FirebaseAuthDelegate,FirebaseAuthProvider,FirebaseLoginButton}.{h,m}"
helper.resources = "FirebaseUI/Auth/Resources/*"
end

s.subspec 'Facebook' do |facebook|
facebook.source_files = "FirebaseUI/Auth/**/FirebaseFacebookAuthProvider.{h,m}"
facebook.dependency "FirebaseUI/AuthHelper"
facebook.dependency "FBSDKCoreKit"
facebook.dependency "FBSDKLoginKit"
facebook.xcconfig = {"OTHER_CFLAGS" => "-DFIREBASEUI_ENABLE_FACEBOOK_AUTH=1"}
end

s.subspec 'Google' do |google|
google.source_files = "FirebaseUI/Auth/**/FirebaseGoogleAuthProvider.{h,m}"
google.dependency "FirebaseUI/AuthHelper"
google.dependency "Google/SignIn"
google.xcconfig = {"OTHER_CFLAGS" => "-DFIREBASEUI_ENABLE_GOOGLE_AUTH=1 -DLOCAL_BUILD=0"}
end

s.subspec 'Twitter' do |twitter|
twitter.source_files = "FirebaseUI/Auth/**/{FirebaseTwitterAuthProvider,TwitterAuthDelegate}.{h,m}"
twitter.dependency "FirebaseUI/AuthHelper"
twitter.ios.framework = "Accounts"
twitter.xcconfig = {"OTHER_CFLAGS" => "-DFIREBASEUI_ENABLE_TWITTER_AUTH=1"}
end

s.subspec 'Password' do |password|
password.source_files = "FirebaseUI/Auth/**/FirebasePasswordAuthProvider.{h,m}"
password.dependency "FirebaseUI/AuthHelper"
password.xcconfig = {"OTHER_CFLAGS" => "-DFIREBASEUI_ENABLE_PASSWORD_AUTH=1"}
end
end
6 changes: 2 additions & 4 deletions FirebaseUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
"LOCAL_BUILD=1",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
Expand Down Expand Up @@ -614,10 +615,7 @@
"$(PROJECT_DIR)/target/Products/Release-iphonesimulator",
"$(PROJECT_DIR)/sdk/google_signin_sdk_2_2_0",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"LOCAL_BUILD=1",
"$(inherited)",
);
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
GCC_TREAT_WARNINGS_AS_ERRORS = YES;
GCC_WARN_PEDANTIC = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
Expand Down
6 changes: 6 additions & 0 deletions FirebaseUI/Auth/API/FirebaseAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,25 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// clang-format on

#import <UIKit/UIKit.h>

#import <Firebase/Firebase.h>

#if FIREBASEUI_ENABLE_GOOGLE_AUTH
#if LOCAL_BUILD
#import <GoogleSignIn/GoogleSignIn.h>
#import "GGLContext.h"
#else
#import <Google/SignIn.h>
#endif
#endif

#if FIREBASEUI_ENABLE_FACEBOOK_AUTH
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#endif

/**
* A replacement for the AppDelegate which includes setup for the Google and Facebook SDK's
Expand Down
7 changes: 1 addition & 6 deletions FirebaseUI/Auth/API/FirebaseAuthConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
#import <Foundation/Foundation.h>
#import <CoreGraphics/CGBase.h>

#ifndef FirebaseAuthConstants_h
#define FirebaseAuthConstants_h

FOUNDATION_EXPORT NSString *const kTwitterApiKey;

FOUNDATION_EXPORT NSString *const kFacebookAppId;
Expand Down Expand Up @@ -63,6 +60,4 @@ typedef NS_ENUM(NSInteger, FAuthProvider) {
FAuthProviderGoogle,
FAuthProviderTwitter,
FAuthProviderPassword
};

#endif /* FirebaseAuthConstants_h */
};
64 changes: 57 additions & 7 deletions FirebaseUI/Auth/API/FirebaseLoginViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,39 @@

#import <Firebase/Firebase.h>

// Shared auth
#import "FirebaseAuthDelegate.h"
#import "FirebaseLoginButton.h"
#import "FirebaseAuthProvider.h"

// Pull in Twitter
#if FIREBASEUI_ENABLE_TWITTER_AUTH
#import "FirebaseTwitterAuthProvider.h"
#endif

// Pull in Facebook
#if FIREBASEUI_ENABLE_FACEBOOK_AUTH
#import "FirebaseFacebookAuthProvider.h"
#endif

// Pull in Google
#if FIREBASEUI_ENABLE_GOOGLE_AUTH
#import "FirebaseGoogleAuthProvider.h"
#endif

// Google local build issues
#if FIREBASEUI_ENABLE_GOOGLE_AUTH
#if LOCAL_BUILD
#import <GoogleSignIn/GoogleSignIn.h>
#else
#import <Google/SignIn.h>
#endif
#endif

#import "FirebaseAuthDelegate.h"
#import "FirebaseTwitterAuthProvider.h"
#import "FirebaseFacebookAuthProvider.h"
#import "FirebaseGoogleAuthProvider.h"
// Pull in Password
#if FIREBASEUI_ENABLE_PASSWORD_AUTH
#import "FirebasePasswordAuthProvider.h"
#import "FirebaseLoginButton.h"
#endif

/**
* FirebaseLoginViewController is a subclass of UIViewController that provides a
Expand All @@ -55,8 +76,19 @@
* error handling.
* This also serves as a template for developers interested in developing custom login UI.
*/
#if FIREBASEUI_ENABLE_TWITTER_AUTH && FIREBASEUI_ENABLE_GOOGLE_AUTH
@interface FirebaseLoginViewController
: UIViewController<FirebaseAuthDelegate, TwitterAuthDelegate, GIDSignInUIDelegate>
#elif FIREBASEUI_ENABLE_TWITTER_AUTH
@interface FirebaseLoginViewController
: UIViewController<FirebaseAuthDelegate, TwitterAuthDelegate>
#elif FIREBASEUI_ENABLE_GOOGLE_AUTH
@interface FirebaseLoginViewController
: UIViewController<FirebaseAuthDelegate, GIDSignInUIDelegate>
#else
@interface FirebaseLoginViewController: UIViewController<FirebaseAuthDelegate>
#endif


/**
* Container view for login activity which wraps the header text and cancel button.
Expand Down Expand Up @@ -116,7 +148,7 @@
/**
* Dismissal callback on success or failure.
*/
@property (nonatomic, copy) void (^dismissCallback)(FAuthData *user, NSError *error);
@property(nonatomic, copy) void (^dismissCallback)(FAuthData *user, NSError *error);

/**
* The Firebase database reference which to authenticate against.
Expand All @@ -128,28 +160,45 @@
* requests against the Twitter API and uses the response to authenticate
* against the Firebase database.
*/
#if FIREBASEUI_ENABLE_TWITTER_AUTH
@property(strong, nonatomic) FirebaseTwitterAuthProvider *twitterAuthProvider;
#else
@property(strong, nonatomic) FirebaseAuthProvider *twitterAuthProvider;
#endif

/**
* The provider object for Facebook Authentication. This object handles the
* requests against the Facebook SDK and uses the response to authenticate
* against the Firebase database.
*/
#if FIREBASEUI_ENABLE_FACEBOOK_AUTH
@property(strong, nonatomic) FirebaseFacebookAuthProvider *facebookAuthProvider;
#else
@property(strong, nonatomic) FirebaseAuthProvider *facebookAuthProvider;
#endif


/**
* The provider object for Google Authentication. This object handles the
* requests against the Google SDK and uses the response to authenticate
* against the Firebase database.
*/
#if FIREBASEUI_ENABLE_GOOGLE_AUTH
@property(strong, nonatomic) FirebaseGoogleAuthProvider *googleAuthProvider;
#else
@property(strong, nonatomic) FirebaseAuthProvider *googleAuthProvider;
#endif

/**
* The provider object for Email/Password Authentication. This object handles the
* requests to the Firebase user authentication system to authenticate users to
* the Firebase database.
*/
#if FIREBASEUI_ENABLE_PASSWORD_AUTH
@property(strong, nonatomic) FirebasePasswordAuthProvider *passwordAuthProvider;
#else
@property(strong, nonatomic) FirebaseAuthProvider *passwordAuthProvider;
#endif

/**
* Create an instance of FirebaseLoginViewController, which allows for easy authentication to
Expand All @@ -169,7 +218,8 @@

/**
* Callback that fires when after the controller is dismissed (either on success or on failure).
* If successful, the user field will be populated; if an error occurred the error field will be populated.
* If successful, the user field will be populated; if an error occurred the error field will be
* populated.
* @param callback A block that returns a user on success or an error on failure.
* @return void
*/
Expand Down
15 changes: 14 additions & 1 deletion FirebaseUI/Auth/Implementation/FirebaseAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,43 @@
@implementation FirebaseAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

#if FIREBASEUI_ENABLE_GOOGLE_AUTH
// Configure Google
NSError* configureError;
[[GGLContext sharedInstance] configureWithError: &configureError];
#endif

#if FIREBASEUI_ENABLE_FACEBOOK_AUTH
// Configure Facebook
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
#endif

// Return successful app launch
return YES;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
// This is the Facebook or Google SDK returning to the app after authentication.

#if FIREBASEUI_ENABLE_FACEBOOK_AUTH
if ([url.scheme hasPrefix:@"fb"]) {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
} else if ([url.scheme hasPrefix:@"com.google"]) {
}
#endif

#if FIREBASEUI_ENABLE_GOOGLE_AUTH
if ([url.scheme hasPrefix:@"com.google"]) {
return [[GIDSignIn sharedInstance] handleURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
#endif

return YES;
}

Expand Down
4 changes: 2 additions & 2 deletions FirebaseUI/Auth/Implementation/FirebaseFacebookAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ - (void)configureProvider {
if (!(facebookAppId && facebookDisplayName)) {
[NSException raise:NSInternalInconsistencyException
format:@"Please set FacebookAppID, FacebookDisplayName, and\nURL types > Url "
@"Schemes in `Supporting Files/Info.plist` according to "
@"https://developers.facebook.com/docs/ios/getting-started"];
@"Schemes in `Supporting Files/Info.plist` according to "
@"https://developers.facebook.com/docs/ios/getting-started"];
}

_loginManager = [[FBSDKLoginManager alloc] init];
Expand Down
4 changes: 2 additions & 2 deletions FirebaseUI/Auth/Implementation/FirebaseGoogleAuthProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ - (void)configureProvider {
if (!(clientIdExists && reversedClientIdExists)) {
[NSException raise:NSInternalInconsistencyException
format:@"Please add `GoogleService-Info.plist` to `Supporting Files` and\nURL "
@"types > Url Schemes in `Supporting Files/Info.plist` according to "
@"https://developers.google.com/identity/sign-in/ios/start-integrating"];
@"types > Url Schemes in `Supporting Files/Info.plist` according to "
@"https://developers.google.com/identity/sign-in/ios/start-integrating"];
}
}

Expand Down
Loading