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
3 changes: 1 addition & 2 deletions AnonymousAuth/FirebaseAnonymousAuthUI/FUIAnonymousAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ - (NSString *)signInLabel {
}

- (UIImage *)icon {
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
return [FUIAuthUtils imageNamed:@"ic_anonymous" fromBundle:bundle];
return [FUIAuthUtils imageNamed:@"ic_anonymous" fromBundleNameOrNil:FUIAuthBundleName];
}

- (UIColor *)buttonBackgroundColor {
Expand Down
26 changes: 17 additions & 9 deletions Auth/FirebaseAuthUI/FUIAuthUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,37 @@ @implementation FUIAuthUtils

+ (NSBundle *)bundleNamed:(NSString *)bundleName {
NSBundle *frameworkBundle = nil;
if (bundleName) {
NSString *path = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"bundle"];
if (path == nil) {
// Check framework resources if bundle isn't present in main bundle.
path = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"framework"];
}
frameworkBundle = [NSBundle bundleWithPath:path];
} else {
if (!bundleName) {
bundleName = FUIAuthBundleName;
}
NSString *path = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"bundle"];
if (!path) {
// Check framework resources if bundle isn't present in main bundle.
path = [[NSBundle mainBundle] pathForResource:bundleName ofType:@"framework"];
}
frameworkBundle = [NSBundle bundleWithPath:path];
if (!frameworkBundle) {
frameworkBundle = [NSBundle bundleForClass:[self class]];
}
return frameworkBundle;
}

+ (UIImage *)imageNamed:(NSString *)name fromBundle:(NSBundle *)bundle {
if (bundle == nil) {
if (!bundle) {
bundle = [self bundleNamed:nil];
}
NSString *path = [bundle pathForResource:name ofType:@"png"];
if (!path) {
NSLog(@"Warning: Unable to find asset %@ in bundle %@.", name, bundle);
}
return [UIImage imageWithContentsOfFile:path];
}

+ (UIImage *)imageNamed:(NSString *)name fromBundleNameOrNil:(nullable NSString *)bundleNameOrNil {
NSString *path = [[FUIAuthUtils bundleNamed:bundleNameOrNil] pathForResource:name ofType:@"png"];
if (!path) {
NSLog(@"Warning: Unable to find asset %@ in bundle named %@.", name, bundleNameOrNil);
}
return [UIImage imageWithContentsOfFile:path];
}

Expand Down
2 changes: 1 addition & 1 deletion EmailAuth/FirebaseEmailAuthUI/FUIEmailAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ - (NSString *)signInLabel {
}

- (UIImage *)icon {
return [FUIAuthUtils imageNamed:@"ic_email" fromBundle:[NSBundle bundleForClass:[self class]]];
return [FUIAuthUtils imageNamed:@"ic_email" fromBundleNameOrNil:FUIEmailAuthBundleName];
}

- (UIColor *)buttonBackgroundColor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ - (UIButton *)visibilityToggleButtonForPasswordField {

- (void)updateIconForRightViewButton:(UIButton *)button {
NSString *imageName = _passwordField.secureTextEntry ? @"ic_visibility" : @"ic_visibility_off";
UIImage *image = [FUIAuthUtils imageNamed:imageName fromBundle:[FUIAuthUtils bundleNamed:FUIAuthBundleName]];
UIImage *image = [FUIAuthUtils imageNamed:imageName fromBundleNameOrNil:FUIAuthBundleName];
[button setImage:image forState:UIControlStateNormal];
}

Expand Down
4 changes: 2 additions & 2 deletions FacebookAuth/FirebaseFacebookAuthUI/FUIFacebookAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ - (NSString *)signInLabel {
}

- (UIImage *)icon {
return [FUIAuthUtils imageNamed:@"ic_facebook" fromBundle:[NSBundle bundleForClass:[self class]]];
return [FUIAuthUtils imageNamed:@"ic_facebook" fromBundleNameOrNil:kBundleName];
}

- (UIColor *)buttonBackgroundColor {
Expand Down Expand Up @@ -222,7 +222,7 @@ - (void)callbackWithCredential:(nullable FIRAuthCredential *)credential
@brief Validates that Facebook SDK data was filled in Info.plist and creates Facebook login manager
*/
- (void)configureProvider {
NSBundle *bundle = [FUIAuthUtils bundleNamed:nil];
NSBundle *bundle = [NSBundle mainBundle];
NSString *facebookAppId = [bundle objectForInfoDictionaryKey:kFacebookAppId];
NSString *facebookDisplayName = [bundle objectForInfoDictionaryKey:kFacebookDisplayName];

Expand Down
2 changes: 1 addition & 1 deletion GoogleAuth/FirebaseGoogleAuthUI/FUIGoogleAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ - (NSString *)signInLabel {
}

- (UIImage *)icon {
return [FUIAuthUtils imageNamed:@"ic_google" fromBundle:[NSBundle bundleForClass:[self class]]];
return [FUIAuthUtils imageNamed:@"ic_google" fromBundleNameOrNil:kBundleName];
}

- (UIColor *)buttonBackgroundColor {
Expand Down
2 changes: 1 addition & 1 deletion PhoneAuth/FirebasePhoneAuthUI/FUIPhoneAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ - (NSString *)signInLabel {
}

- (UIImage *)icon {
return [FUIAuthUtils imageNamed:@"ic_phone" fromBundle:[NSBundle bundleForClass:[self class]]];
return [FUIAuthUtils imageNamed:@"ic_phone" fromBundleNameOrNil:FUIPhoneAuthBundleName];
}

- (UIColor *)buttonBackgroundColor {
Expand Down
2 changes: 1 addition & 1 deletion TwitterAuth/FirebaseTwitterAuthUI/FUITwitterAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ - (NSString *)signInLabel {
}

- (UIImage *)icon {
return [FUIAuthUtils imageNamed:@"ic_twitter" fromBundle:[NSBundle bundleForClass:[self class]]];
return [FUIAuthUtils imageNamed:@"ic_twitter" fromBundleNameOrNil:kBundleName];
}

- (UIColor *)buttonBackgroundColor {
Expand Down
18 changes: 17 additions & 1 deletion samples/swift/FirebaseUI-demo-swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0730;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "Firebase, Inc.";
TargetAttributes = {
8DABC9841D3D82D600453807 = {
Expand Down Expand Up @@ -632,14 +632,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -682,14 +690,22 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down
Loading