Skip to content

Fix issue where FUIAuthPickerViewController always used default authUI for TOS/PP #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2018
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode9.3
osx_image: xcode9.4
language: objective-c
xcode_workspace: FirebaseUI.xcworkspace
xcode_scheme: FirebaseUI
Expand Down
12 changes: 6 additions & 6 deletions FirebaseAuthUI/FUIAuthPickerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ - (void)viewDidLoad {
}

- (NSAttributedString *)privacyPolicyAndTOS {
if (![FUIAuth defaultAuthUI].TOSURL.absoluteString.length &&
![FUIAuth defaultAuthUI].privacyPolicyURL.absoluteString.length) {
if (!self.authUI.TOSURL.absoluteString.length &&
!self.authUI.privacyPolicyURL.absoluteString.length) {
return nil;
}
if (![FUIAuth defaultAuthUI].TOSURL.absoluteString.length ||
![FUIAuth defaultAuthUI].privacyPolicyURL.absoluteString.length) {
if (!self.authUI.TOSURL.absoluteString.length ||
!self.authUI.privacyPolicyURL.absoluteString.length) {
NSLog(@"The terms of service and privacy policy URLs for your app must be provided together. Pl"
"ease set the terms of service policy using [FUIAuth defaultAuthUI].TOSURL and the privacy"
" policy URL using [FUIAuth defaultAuthUI].privacyPolicyURL");
Expand All @@ -162,15 +162,15 @@ - (NSAttributedString *)privacyPolicyAndTOS {

if (TOSRange.length) {
[attributedLinkText addAttribute:NSLinkAttributeName
value:[FUIAuth defaultAuthUI].TOSURL
value:self.authUI.TOSURL
range:TOSRange];
}
NSRange privacyPolicyRange =
[privacyPolicyAndTOSString rangeOfString:FUILocalizedString(kStr_PrivacyPolicy)];

if (privacyPolicyRange.length) {
[attributedLinkText addAttribute:NSLinkAttributeName
value:[FUIAuth defaultAuthUI].privacyPolicyURL
value:self.authUI.privacyPolicyURL
range:privacyPolicyRange];
}
return attributedLinkText;
Expand Down
Loading