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
20 changes: 13 additions & 7 deletions Auth/FirebaseAuthUI/FUIAuth.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,20 @@ - (BOOL)handleOpenURL:(NSURL *)URL
}

- (UINavigationController *)authViewController {
UIViewController *controller;
static UINavigationController *authViewController;

if ([self.delegate respondsToSelector:@selector(authPickerViewControllerForAuthUI:)]) {
controller = [self.delegate authPickerViewControllerForAuthUI:self];
} else {
controller = [[FUIAuthPickerViewController alloc] initWithAuthUI:self];
}
return [[UINavigationController alloc] initWithRootViewController:controller];
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
UIViewController *controller;
if ([self.delegate respondsToSelector:@selector(authPickerViewControllerForAuthUI:)]) {
controller = [self.delegate authPickerViewControllerForAuthUI:self];
} else {
controller = [[FUIAuthPickerViewController alloc] initWithAuthUI:self];
}
authViewController = [[UINavigationController alloc] initWithRootViewController:controller];
});

return authViewController;
}

- (BOOL)signOutWithError:(NSError *_Nullable *_Nullable)error {
Expand Down
97 changes: 57 additions & 40 deletions Auth/FirebaseAuthUI/FUIAuthBaseViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,59 +218,76 @@ - (void)showAlertWithMessage:(NSString *)message {
[[self class] showAlertWithMessage:message presentingViewController:self];
}

+ (void)showAlertWithMessage:(NSString *)message {
[[self class] showAlertWithMessage:message presentingViewController:nil];
}

+ (void)showAlertWithMessage:(NSString *)message
presentingViewController:(UIViewController *)presentingViewController {
[[self class] showAlertWithTitle:nil
message:message
actionTitle:FUILocalizedString(kStr_OK)
presentingViewController:(nullable UIViewController *)presentingViewController {
[[self class] showAlertWithTitle:message
message:nil
presentingViewController:presentingViewController];
}

+ (void)showAlertWithTitle:(nullable NSString *)title
message:(NSString *)message
actionTitle:(NSString *)actionTitle
presentingViewController:(UIViewController *)presentingViewController {
UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction =
[UIAlertAction actionWithTitle:actionTitle
style:UIAlertActionStyleDefault
handler:nil];
[alertController addAction:okAction];
[presentingViewController presentViewController:alertController animated:YES completion:nil];
message:(nullable NSString *)message
presentingViewController:(nullable UIViewController *)presentingViewController {
[[self class] showAlertWithTitle:title
message:message
actionTitle:nil
actionHandler:nil
dismissTitle:FUILocalizedString(kStr_OK)
dismissHandler:nil
presentingViewController:presentingViewController];
}

+ (void)showAlertWithTitle:(nullable NSString *)title
message:(NSString *)message
actionTitle:(NSString *)actionTitle
presentingViewController:(UIViewController *)presentingViewController
actionHandler:(FUIAuthAlertActionHandler)actionHandler
cancelHandler:(FUIAuthAlertActionHandler)cancelHandler {
message:(nullable NSString *)message
actionTitle:(nullable NSString *)actionTitle
actionHandler:(nullable FUIAuthAlertActionHandler)actionHandler
dismissTitle:(nullable NSString *)dismissTitle
dismissHandler:(nullable FUIAuthAlertActionHandler)dismissHandler
presentingViewController:(nullable UIViewController *)presentingViewController {
UIAlertController *alertController =
[UIAlertController alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction =
[UIAlertAction actionWithTitle:actionTitle
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) {
if (actionHandler) {
actionHandler();
}
}];
[alertController addAction:okAction];
UIAlertAction *cancelAction =
[UIAlertAction actionWithTitle:FUILocalizedString(kStr_Cancel)
style:UIAlertActionStyleCancel

if (actionTitle) {
UIAlertAction *action =
[UIAlertAction actionWithTitle:actionTitle
style:UIAlertActionStyleDefault
handler:^(UIAlertAction *_Nonnull action) {
if (actionHandler) {
actionHandler();
}
}];
[alertController addAction:action];
}

if (dismissTitle) {
UIAlertAction *dismissAction =
[UIAlertAction actionWithTitle:dismissTitle
style:UIAlertActionStyleCancel
handler:^(UIAlertAction * _Nonnull action) {
if (cancelHandler) {
cancelHandler();
}
}];
[alertController addAction:cancelAction];
[presentingViewController presentViewController:alertController animated:YES completion:nil];
if (dismissHandler) {
dismissHandler();
}
}];
[alertController addAction:dismissAction];
}

if (presentingViewController) {
[presentingViewController presentViewController:alertController animated:YES completion:nil];
} else {
UIViewController *viewController = [[UIViewController alloc] init];
viewController.view.backgroundColor = UIColor.clearColor;
UIWindow *window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
window.rootViewController = viewController;
window.windowLevel = UIWindowLevelAlert + 1;
[window makeKeyAndVisible];
[viewController presentViewController:alertController animated:YES completion:nil];
}
}

+ (void)showSignInAlertWithEmail:(NSString *)email
Expand Down
62 changes: 28 additions & 34 deletions Auth/FirebaseAuthUI/FUIAuthBaseViewController_Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,57 +38,51 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)showAlertWithMessage:(NSString *)message;

/** @fn showAlertWithMessage:
@brief Displays an alert view with given title and message on top of the current view
controller.
@param message The message of the alert.
*/
+ (void)showAlertWithMessage:(NSString *)message;

/** @fn showAlertWithMessage:presentingViewController:
@brief Displays an alert view with given title and message on top of the
specified view controller.
@param message The message of the alert.
@param presentingViewController The controller which shows alert.
@brief Displays an alert view with given title and message on top of the current view
controller.
@param message The message of the alert.
@param presentingViewController The controller which shows alert.
*/
+ (void)showAlertWithMessage:(NSString *)message
presentingViewController:(UIViewController *)presentingViewController;
presentingViewController:(nullable UIViewController *)presentingViewController;

/** @fn showAlertWithTitle:message:actionTitle:presentingViewController:
@brief Displays an alert view with given title, message and action title on top of the
/** @fn showAlertWithTitle:message:
@brief Displays an alert view with given title, message and action title on top of the
specified view controller.
@param title The title of the alert.
@param message The message of the alert.
@param actionTitle The title of the action button.
@param presentingViewController The controller which shows alert.
*/
*/
+ (void)showAlertWithTitle:(nullable NSString *)title
message:(NSString *)message
actionTitle:(NSString *)actionTitle
presentingViewController:(UIViewController *)presentingViewController;
message:(nullable NSString *)message
presentingViewController:(nullable UIViewController *)presentingViewController;

/** @fn showAlertWithTitle:message:actionTitle:presentingViewController:
@brief Displays an alert view with given title, message and action title on top of the
/** @fn showAlertWithTitle:message:actionTitle:actionHandler:dismissTitle:dismissHandler:
@brief Displays an alert view with given title, message and action title on top of the
specified view controller.
@param title The title of the alert.
@param message The message of the alert.
@param actionTitle The title of the action button.
@param actionHandler The block to execute if the action button is tapped.
@param cancelHandler The block to execute if the cancel button is tapped.
@param dismissTitle The title of the dismiss button.
@param dismissHandler The block to execute if the cancel button is tapped.
@param presentingViewController The controller which shows alert.
*/
*/
+ (void)showAlertWithTitle:(nullable NSString *)title
message:(NSString *)message
actionTitle:(NSString *)actionTitle
presentingViewController:(UIViewController *)presentingViewController
actionHandler:(FUIAuthAlertActionHandler)actionHandler
cancelHandler:(FUIAuthAlertActionHandler)cancelHandler;

/** @fn showSignInAlertWithEmail:provider:handler:
@brief Displays an alert to conform with user whether she wants to proceed with the provider.
@param email The email address to sign in with.
@param provider The identity provider to sign in with.
@param signinHandler Handler for the sign in action of the alert.
@param cancelHandler Handler for the cancel action of the alert.
*/
+ (void)showSignInAlertWithEmail:(NSString *)email
provider:(id<FUIAuthProvider>)provider
presentingViewController:(UIViewController *)presentingViewController
signinHandler:(FUIAuthAlertActionHandler)signinHandler
cancelHandler:(FUIAuthAlertActionHandler)cancelHandler;
message:(nullable NSString *)message
actionTitle:(nullable NSString *)actionTitle
actionHandler:(nullable FUIAuthAlertActionHandler)actionHandler
dismissTitle:(nullable NSString *)dismissTitle
dismissHandler:(nullable FUIAuthAlertActionHandler)dismissHandler
presentingViewController:(nullable UIViewController *)presentingViewController;

/** @fn showSignInAlertWithEmail:providerShortName:providerSignInLabel:handler:
@brief Displays an alert to conform with user whether she wants to proceed with the provider.
Expand Down
7 changes: 7 additions & 0 deletions Auth/FirebaseAuthUI/FUIAuthStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ extern NSString *const kStr_Cancel;
extern NSString *const kStr_CannotAuthenticateError;
extern NSString *const kStr_ChoosePassword;
extern NSString *const kStr_Close;
extern NSString *const kStr_ConfirmEmail;
extern NSString *const kStr_Email;
extern NSString *const kStr_EmailAlreadyInUseError;
extern NSString *const kStr_EmailSentConfirmationMessage;
extern NSString *const kStr_EnterYourEmail;
extern NSString *const kStr_EnterYourPassword;
extern NSString *const kStr_Error;
Expand All @@ -56,12 +58,17 @@ extern NSString *const kStr_PasswordVerificationMessage;
extern NSString *const kStr_ProviderUsedPreviouslyMessage;
extern NSString *const kStr_Save;
extern NSString *const kStr_Send;
extern NSString *const kStr_Resend;
extern NSString *const kStr_SignedIn;
extern NSString *const kStr_SignInTitle;
extern NSString *const kStr_SignInTooManyTimesError;
extern NSString *const kStr_SignInWithEmail;
extern NSString *const kStr_SignInEmailSent;
extern NSString *const kStr_SignUpTitle;
extern NSString *const kStr_SignUpTooManyTimesError;
extern NSString *const kStr_TermsOfService;
extern NSString *const kStr_TroubleGettingEmailTitle;
extern NSString *const kStr_TroubleGettingEmailMessage;
extern NSString *const kStr_PrivacyPolicy;
extern NSString *const kStr_TermsOfServiceMessage;
extern NSString *const kStr_UserNotFoundError;
Expand Down
7 changes: 7 additions & 0 deletions Auth/FirebaseAuthUI/FUIAuthStrings.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
NSString *const kStr_CannotAuthenticateError = @"CannotAuthenticateError";
NSString *const kStr_ChoosePassword = @"ChoosePassword";
NSString *const kStr_Close = @"Close";
NSString *const kStr_ConfirmEmail = @"ConfirmEmail";
NSString *const kStr_Email = @"Email";
NSString *const kStr_EmailAlreadyInUseError = @"EmailAlreadyInUseError";
NSString *const kStr_EmailSentConfirmationMessage = @"EmailSentConfirmationMessage";
NSString *const kStr_EnterYourEmail = @"EnterYourEmail";
NSString *const kStr_EnterYourPassword = @"EnterYourPassword";
NSString *const kStr_Error = @"Error";
Expand All @@ -62,12 +64,17 @@
NSString *const kStr_ProviderUsedPreviouslyMessage = @"ProviderUsedPreviouslyMessage";
NSString *const kStr_Save = @"Save";
NSString *const kStr_Send = @"Send";
NSString *const kStr_Resend = @"Resend";
NSString *const kStr_SignedIn = @"SignedIn";
NSString *const kStr_SignInTitle = @"SignInTitle";
NSString *const kStr_SignInTooManyTimesError = @"SignInTooManyTimesError";
NSString *const kStr_SignInWithEmail = @"SignInWithEmail";
NSString *const kStr_SignInEmailSent = @"SignInEmailSent";
NSString *const kStr_SignUpTitle = @"SignUpTitle";
NSString *const kStr_SignUpTooManyTimesError = @"SignUpTooManyTimesError";
NSString *const kStr_TermsOfService = @"TermsOfService";
NSString *const kStr_TroubleGettingEmailTitle = @"TroubleGettingEmailTitle";
NSString *const kStr_TroubleGettingEmailMessage = @"TroubleGettingEmailMessage";
NSString *const kStr_PrivacyPolicy = @"PrivacyPolicy";
NSString *const kStr_TermsOfServiceMessage = @"TermsOfServiceMessage";
NSString *const kStr_UserNotFoundError = @"UserNotFoundError";
Expand Down
25 changes: 23 additions & 2 deletions Auth/FirebaseAuthUI/Strings/ar.lproj/FirebaseAuthUI.strings
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@
/* Save button title. */
"Save" = "حفظ";

/* Save button title. */
/* Send button title. */
"Send" = "إرسال";

/* Resend button title. */
"Resend" = "إعادة إرسال الرسالة";

/* Label next to a email text field. Use short/abbreviated translation for 'email' which is less than 15 chars. */
"Email" = "البريد الإلكتروني";

Expand Down Expand Up @@ -244,5 +247,23 @@
/* Placeholder of secret input cell when user changes password. */
"PlaceholderChosePassword" = "اختيار كلمة المرور";

/* The title of forgot password button. */
/* Title of forgot password button. */
"ForgotPasswordTitle" = "هل تواجه مشكلة في تسجيل الدخول؟";

/* Title of confirm email label. */
"ConfirmEmail" = "تأكيد عنوان البريد الإلكتروني";

/* Title of successfully signed in label. */
"SignedIn" = "تمّ تسجيل الدخول.";

/* Title used in trouble getting email alert view. */
"TroubleGettingEmailTitle" = "هل تواجه مشكلة في استلام الرسائل الإلكترونية؟";

/* Alert message displayed when user having trouble getting email. */
"TroubleGettingEmailMessage" = "يمكنك تجربة الحلول الشائعة التالية: \n - التأكّد ممّا إذا تمّ وضع علامة على الرسالة الإلكترونية بأنها \"غير مرغوب فيها\" أو نقلها تلقائيًا إلى مجلّد آخر\n - التحقّق من اتصال الإنترنت\n - التأكّد من كتابة عنوان البريد الإلكتروني بالشكل الصحيح\n - التأكّد من توفّر مساحة فارغة في البريد الوارد أو من عدم حدوث أي مشاكل أخرى في إعدادات البريد الوارد\n إذا لم تنجح الخطوات أعلاه، يمكنك إعادة إرسال الرسالة الإلكترونية. ستؤدي هذه الخطوة إلى إلغاء الرابط المضمّن في الرسالة السابقة.";

/* Message displayed after email is sent. The placeholder is the email address that the email is sent to. */
"EmailSentConfirmationMessage" = "تمّ إرسال رسالة إلكترونية لتسجيل الدخول تتضمّن تعليمات إضافية إلى %@. يُرجى التحقق من بريدك الإلكتروني لإكمال عملية تسجيل الدخول.";

/* Message displayed after the email of sign-in link is sent. */
"SignInEmailSent" = "تمّ إرسال رسالة إلكترونية لتسجيل الدخول";
25 changes: 23 additions & 2 deletions Auth/FirebaseAuthUI/Strings/bg.lproj/FirebaseAuthUI.strings
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@
/* Save button title. */
"Save" = "Запазване";

/* Save button title. */
/* Send button title. */
"Send" = "Изпращане";

/* Resend button title. */
"Resend" = "Повторно изпращане";

/* Label next to a email text field. Use short/abbreviated translation for 'email' which is less than 15 chars. */
"Email" = "Имейл";

Expand Down Expand Up @@ -244,5 +247,23 @@
/* Placeholder of secret input cell when user changes password. */
"PlaceholderChosePassword" = "Изберете парола";

/* The title of forgot password button. */
/* Title of forgot password button. */
"ForgotPasswordTitle" = "Имате проблем при влизането?";

/* Title of confirm email label. */
"ConfirmEmail" = "Потвърждаване на имейл адреса";

/* Title of successfully signed in label. */
"SignedIn" = "Влязохте в профила!";

/* Title used in trouble getting email alert view. */
"TroubleGettingEmailTitle" = "Имате проблеми с получаването на имейла?";

/* Alert message displayed when user having trouble getting email. */
"TroubleGettingEmailMessage" = "Изпробвайте следните често използвани решения: \n – Проверете дали имейлът не е обозначен и филтриран като спам.\n – Проверете връзката си с интернет.\n – Проверете дали имейлът е изписан правилно.\n – Проверете дали в пощенската ви кутия има достатъчно пространство, или не е налице друг проблем с настройките й.\n Ако стъпките по-горе не разрешат проблема, можете отново да изпратите имейла. Имайте предвид, че това ще деактивира връзката в предходното съобщение.";

/* Message displayed after email is sent. The placeholder is the email address that the email is sent to. */
"EmailSentConfirmationMessage" = "Изпратихме имейл до %@ за вход в профила с допълнителни инструкции. Проверете входящата си поща, за да завършите процеса.";

/* Message displayed after the email of sign-in link is sent. */
"SignInEmailSent" = "Изпратен е имейл за вход в профила";
Loading