Skip to content

Commit 61aedea

Browse files
author
Chuan Ren
committed
Merge branch 'master' into emaillink
2 parents 653a41a + b853243 commit 61aedea

File tree

219 files changed

+1323
-1463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+1323
-1463
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ DerivedData
1616
*.hmap
1717
*.ipa
1818
*.xcuserstate
19+
*/*/xcshareddata/**
1920

2021
# Third Party
2122
/sdk

.opensource/project.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,13 @@
99

1010
"content": "README.md",
1111

12-
// These are relative paths in the same repo,
13-
// each of these paths must have a .opensource/project.json
14-
"subprojects": [],
15-
1612
// Other markdown pages that should be rendered nicely
17-
"pages" : [
18-
"FirebaseAuthUI/README.md",
19-
"FirebaseDatabaseUI/README.md",
20-
"FirebaseStorageUI/README.md",
21-
"FirebaseFirestoreUI/README.md"
22-
],
13+
"pages" : {
14+
"Auth/README.md": "Authentication",
15+
"Database/README.md": "Realtime Database",
16+
"Storage/README.md": "Cloud Storage",
17+
"Firestore/README.md": "Cloud Firestore"
18+
},
2319

2420
// Related projects on Github, in the format $owner/$repo[/$subproject]
2521
// where subproject is optional.

AnonymousAuth/FirebaseAnonymousAuthUI/FUIAnonymousAuth.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ - (NSString *)signInLabel {
8888
}
8989

9090
- (UIImage *)icon {
91-
return [FUIAuthUtils imageNamed:@"ic_anonymous" fromBundleNameOrNil:FUIAuthBundleName];
91+
return [FUIAuthUtils imageNamed:@"ic_anonymous" fromBundleNameOrNil:kBundleName];
9292
}
9393

9494
- (UIColor *)buttonBackgroundColor {

AnonymousAuth/Podfile.lock

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
PODS:
2-
- Firebase/Auth (5.15.0):
2+
- Firebase/Auth (5.16.0):
33
- Firebase/CoreOnly
4-
- FirebaseAuth (= 5.2.0)
5-
- Firebase/CoreOnly (5.15.0):
6-
- FirebaseCore (= 5.1.10)
7-
- FirebaseAuth (5.2.0):
4+
- FirebaseAuth (= 5.3.0)
5+
- Firebase/CoreOnly (5.16.0):
6+
- FirebaseCore (= 5.2.0)
7+
- FirebaseAuth (5.3.0):
88
- FirebaseAuthInterop (~> 1.0)
9-
- FirebaseCore (~> 5.1)
9+
- FirebaseCore (~> 5.2)
1010
- GoogleUtilities/Environment (~> 5.2)
1111
- GTMSessionFetcher/Core (~> 1.1)
1212
- FirebaseAuthInterop (1.0.0)
13-
- FirebaseCore (5.1.10):
13+
- FirebaseCore (5.2.0):
1414
- GoogleUtilities/Logger (~> 5.2)
15-
- FirebaseUI/Auth (5.2.2):
15+
- FirebaseUI/Auth (6.0.0):
1616
- Firebase/Auth (~> 5.0)
17-
- GoogleUtilities/Environment (5.3.6)
18-
- GoogleUtilities/Logger (5.3.6):
17+
- GoogleUtilities/Environment (5.3.7)
18+
- GoogleUtilities/Logger (5.3.7):
1919
- GoogleUtilities/Environment
2020
- GTMSessionFetcher/Core (1.2.1)
2121
- OCMock (3.4.3)
@@ -39,12 +39,12 @@ EXTERNAL SOURCES:
3939
:path: "../"
4040

4141
SPEC CHECKSUMS:
42-
Firebase: 8bb9268bff82374f2cbaaabb143e725743c316ae
43-
FirebaseAuth: 02e969ff430e156d99d4cb842d77b806b71ad7bb
42+
Firebase: 749a8ff4962f9d8c79dda1966de20f6f77583d67
43+
FirebaseAuth: c9b3ff063c223d2841d97240af547ce511bce19a
4444
FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc
45-
FirebaseCore: 35747502d9e8c6ee217385ad04446c7c2aaf9c5c
46-
FirebaseUI: 810a4d85e15dfed08bfc6fc01358f2c64a8b341c
47-
GoogleUtilities: 95996bea7c7d9b8fb811b7507669a4a8762f80c7
45+
FirebaseCore: ea2d1816723ef21492b8e9113303e1350db5e08c
46+
FirebaseUI: f25f5af494e7e08bd86b04209b9c0b87a63368a6
47+
GoogleUtilities: 111a012f4c3a29c9e7c954c082fafd6ee3c999c0
4848
GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca
4949
OCMock: 43565190abc78977ad44a61c0d20d7f0784d35ab
5050

Auth/FirebaseAuthUI/FUIAuthPickerViewController.m

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,23 @@
4040
static const CGFloat kSignInButtonVerticalMargin = 24.0f;
4141

4242
/** @var kButtonContainerBottomMargin
43-
@brief The magin between sign in buttons and the bottom of the screen.
43+
@brief The magin between sign in buttons and the bottom of the content view.
4444
*/
4545
static const CGFloat kButtonContainerBottomMargin = 56.0f;
4646

47+
/** @var kButtonContainerTopMargin
48+
@brief The margin between sign in buttons and the top of the content view.
49+
*/
50+
static const CGFloat kButtonContainerTopMargin = 16.0f;
51+
4752
@implementation FUIAuthPickerViewController {
4853
UIView *_buttonContainerView;
4954

5055
IBOutlet FUIPrivacyAndTermsOfServiceView *_privacyPolicyAndTOSView;
56+
57+
IBOutlet UIView *_contentView;
58+
59+
IBOutlet UIScrollView *_scrollView;
5160
}
5261

5362
- (instancetype)initWithAuthUI:(FUIAuth *)authUI {
@@ -91,7 +100,13 @@ - (void)viewDidLoad {
91100
kSignInButtonHeight * numberOfButtons + kSignInButtonVerticalMargin * (numberOfButtons);
92101
CGRect buttonContainerViewFrame = CGRectMake(0, 0, kSignInButtonWidth, buttonContainerViewHeight);
93102
_buttonContainerView = [[UIView alloc] initWithFrame:buttonContainerViewFrame];
94-
[self.view addSubview:_buttonContainerView];
103+
if (_scrollView) {
104+
[_contentView addSubview:_buttonContainerView];
105+
} else {
106+
// For backward compatibility. The old auth picker view does not have a scroll view and its
107+
// customized class put the button container view directly into self.view.
108+
[self.view addSubview:_buttonContainerView];
109+
}
95110

96111
CGRect buttonFrame = CGRectMake(0, 0, kSignInButtonWidth, kSignInButtonHeight);
97112
for (id<FUIAuthProvider> providerUI in self.authUI.providers) {
@@ -108,17 +123,52 @@ - (void)viewDidLoad {
108123

109124
_privacyPolicyAndTOSView.authUI = self.authUI;
110125
[_privacyPolicyAndTOSView useFullMessage];
126+
[_contentView bringSubviewToFront:_privacyPolicyAndTOSView];
111127
}
112128

113129
- (void)viewDidLayoutSubviews {
114130
[super viewDidLayoutSubviews];
115131

116-
CGFloat distanceFromCenterToBottom =
117-
CGRectGetHeight(_buttonContainerView.frame) / 2.0f + kButtonContainerBottomMargin;
118-
CGFloat centerY = CGRectGetHeight(self.view.bounds) - distanceFromCenterToBottom;
119-
// Compensate for bounds adjustment if any.
120-
centerY += self.view.bounds.origin.y;
121-
_buttonContainerView.center = CGPointMake(self.view.center.x, centerY);
132+
// For backward compatibility. The old auth picker view does not have a scroll view and its
133+
// customized class put the button container view directly into self.view. The following is the
134+
// old layout behavior.
135+
if (!_scrollView) {
136+
CGFloat distanceFromCenterToBottom =
137+
CGRectGetHeight(_buttonContainerView.frame) / 2.0f + kButtonContainerBottomMargin;
138+
CGFloat centerY = CGRectGetHeight(self.view.bounds) - distanceFromCenterToBottom;
139+
// Compensate for bounds adjustment if any.
140+
centerY += self.view.bounds.origin.y;
141+
_buttonContainerView.center = CGPointMake(self.view.center.x, centerY);
142+
return;
143+
}
144+
145+
CGFloat buttonContainerHeight = CGRectGetHeight(_buttonContainerView.frame);
146+
CGFloat buttonContainerWidth = CGRectGetWidth(_buttonContainerView.frame);
147+
CGFloat contentViewHeight = kButtonContainerTopMargin +
148+
buttonContainerHeight + kButtonContainerBottomMargin;
149+
CGFloat contentViewWidth = CGRectGetWidth(self.view.bounds);
150+
_scrollView.frame = self.view.frame;
151+
CGFloat scrollViewHeight;
152+
if (@available(iOS 11.0, *)) {
153+
scrollViewHeight = CGRectGetHeight(_scrollView.frame) - _scrollView.safeAreaInsets.top;
154+
} else {
155+
scrollViewHeight = CGRectGetHeight(_scrollView.frame)
156+
- CGRectGetHeight(self.navigationController.navigationBar.frame)
157+
- CGRectGetHeight([UIApplication sharedApplication].statusBarFrame);
158+
}
159+
CGFloat contentViewY = scrollViewHeight - contentViewHeight;
160+
if (contentViewY < 0) {
161+
contentViewY = 0;
162+
}
163+
_contentView.frame = CGRectMake(0, contentViewY, contentViewWidth, contentViewHeight);
164+
_scrollView.contentSize = CGSizeMake(contentViewWidth, contentViewY + contentViewHeight);
165+
CGFloat buttonContainerLeftMargin = (contentViewWidth - buttonContainerWidth) / 2.0f;
166+
_buttonContainerView.frame =CGRectMake(buttonContainerLeftMargin,
167+
kButtonContainerTopMargin,
168+
buttonContainerWidth,
169+
buttonContainerHeight);
170+
CGFloat privacyViewHeight = CGRectGetHeight(_privacyPolicyAndTOSView.frame);
171+
_privacyPolicyAndTOSView.frame = CGRectMake(0, contentViewHeight - privacyViewHeight, contentViewWidth, privacyViewHeight);
122172
}
123173

124174
#pragma mark - Actions
Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,51 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
33
<device id="retina4_7" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="iOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
9-
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
109
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
1110
</dependencies>
1211
<objects>
1312
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="FUIAuthPickerViewController">
1413
<connections>
14+
<outlet property="_contentView" destination="kfP-Vq-eU2" id="znY-gx-1D2"/>
1515
<outlet property="_privacyPolicyAndTOSView" destination="Xez-8g-dy2" id="HaL-rZ-tXf"/>
16-
<outlet property="view" destination="kfP-Vq-eU2" id="vYr-FL-nax"/>
16+
<outlet property="_scrollView" destination="d6g-3B-CLV" id="UvZ-O4-pYi"/>
17+
<outlet property="view" destination="x7L-AB-muU" id="owh-pk-03E"/>
1718
</connections>
1819
</placeholder>
1920
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
20-
<view contentMode="scaleToFill" id="kfP-Vq-eU2">
21+
<view contentMode="scaleToFill" id="x7L-AB-muU">
2122
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
2223
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
2324
<subviews>
24-
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" usesAttributedText="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xez-8g-dy2" customClass="FUIPrivacyAndTermsOfServiceView">
25-
<rect key="frame" x="16" y="618" width="343" height="49"/>
26-
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
27-
<constraints>
28-
<constraint firstAttribute="height" constant="49" id="DYU-T6-FUV"/>
29-
</constraints>
30-
<attributedString key="attributedText"/>
31-
<textInputTraits key="textInputTraits" autocapitalizationType="sentences" textContentType="url"/>
32-
<dataDetectorType key="dataDetectorTypes" link="YES"/>
33-
</textView>
25+
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="d6g-3B-CLV">
26+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
27+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
28+
<subviews>
29+
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kfP-Vq-eU2">
30+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
31+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
32+
<subviews>
33+
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" editable="NO" usesAttributedText="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xez-8g-dy2" customClass="FUIPrivacyAndTermsOfServiceView">
34+
<rect key="frame" x="0.0" y="0.0" width="359" height="49"/>
35+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
36+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
37+
<attributedString key="attributedText"/>
38+
<textInputTraits key="textInputTraits" autocapitalizationType="sentences" textContentType="url"/>
39+
<dataDetectorType key="dataDetectorTypes" link="YES"/>
40+
</textView>
41+
</subviews>
42+
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
43+
</view>
44+
</subviews>
45+
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
46+
</scrollView>
3447
</subviews>
35-
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
36-
<constraints>
37-
<constraint firstItem="Xez-8g-dy2" firstAttribute="leading" secondItem="kfP-Vq-eU2" secondAttribute="leadingMargin" id="146-w9-1AF"/>
38-
<constraint firstItem="Xez-8g-dy2" firstAttribute="trailing" secondItem="kfP-Vq-eU2" secondAttribute="trailingMargin" id="Hoh-mG-IDs"/>
39-
<constraint firstAttribute="bottom" secondItem="Xez-8g-dy2" secondAttribute="bottom" id="uZS-Dj-pya"/>
40-
</constraints>
41-
<point key="canvasLocation" x="25.5" y="51.5"/>
48+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
4249
</view>
4350
</objects>
4451
</document>

Auth/FirebaseAuthUI/FUIAuthStrings.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// limitations under the License.
1515
//
1616

17-
@import FirebaseCore;
17+
#import <FirebaseCore/FirebaseCore.h>
1818

1919
#import "FUIAuthStrings.h"
2020

Auth/FirebaseAuthUI/FUIAuthUtils.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,9 @@ extern NSString *const FUIAuthBundleName;
4949
*/
5050
+ (UIImage *)imageNamed:(NSString *)name fromBundle:(nullable NSBundle *)bundle;
5151

52+
/** @fn isFirebasePerformanceAvailable
53+
* @brief Used to work around https://github.com/firebase/firebase-ios-sdk/issues/2283
54+
*/
55+
+ (BOOL)isFirebasePerformanceAvailable;
56+
5257
@end

Auth/FirebaseAuthUI/FUIAuthUtils.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ + (UIImage *)imageNamed:(NSString *)name fromBundleNameOrNil:(nullable NSString
5656
return [UIImage imageWithContentsOfFile:path];
5757
}
5858

59+
+ (BOOL)isFirebasePerformanceAvailable {
60+
return NSClassFromString(@"FIRPerformance") != nil;
61+
}
62+
5963
@end

Auth/FirebaseAuthUI/Strings/ar.lproj/FirebaseAuthUI.strings

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"UserNotFoundError" = "لا يتطابق عنوان البريد الإلكتروني هذا مع حساب حالي.";
3636

3737
/* Error message displayed when the account is disabled. Use short/abbreviated translation for 'email' which is less than 15 chars. */
38-
"AccountDisabledError" = "إنّ عنوان البريد الإلكتروني هذا تابع لحساب سبق أن تم تعطيله.";
38+
"AccountDisabledError" = "إنّ عنوان البريد الإلكتروني هذا تابع لحساب سبق أن تم إيقافه.";
3939

4040
/* Error message displayed after user trying to sign in too many times. */
4141
"SignInTooManyTimesError" = "لقد أدخلت كلمة مرور غير صحيحة لمرات كثيرة جدًا. يُرجى المحاولة مجددًا بعد بضع دقائق.";
@@ -67,12 +67,15 @@
6767
/* Placeholder for the password text field in a sign up form. */
6868
"ChoosePassword" = "اختيار كلمة المرور";
6969

70-
/* A notice displayed when the user is creating a new account. The first placeholder is a button label (ex. Next). The second placeholder is "Terms of Service". */
71-
"TermsOfServiceNotice" = "يشير النقر على %@ إلى موافقتك على %@.";
72-
7370
/* Text linked to a web page with the Terms of Service content. */
7471
"TermsOfService" = "بنود الخدمة";
7572

73+
/* Text linked to a web page with the Privacy Policy content. */
74+
"PrivacyPolicy" = "سياسة الخصوصية";
75+
76+
/* A message displayed when the first log in screen is displayed. The first placeholder is the terms of service agreement link, the second place holder is the privacy policy agreement link. */
77+
"TermsOfServiceMessage" = "تشير المتابعة إلى موافقتك على %@ و%@.";
78+
7679
/* Error message displayed when the email address is already in use. Use short/abbreviated translation for 'email' which is less than 15 chars. */
7780
"EmailAlreadyInUseError" = "يستخدم حساب آخر عنوان البريد الإلكتروني.";
7881

@@ -185,7 +188,7 @@
185188
"UnlinkConfirmationActionTitle" = "إلغاء ربط الحساب";
186189

187190
/* Alert action message shown before updating email action. Use short/abbreviated translation for 'email' which is less than 15 chars. */
188-
"UpdateEmailAlertMessage" = "لتغيير عنوان البريد الإلكتروني المقترن بحسابك، يجب تسجيل الدخول من جديد.";
191+
"UpdateEmailAlertMessage" = "لتغيير عنوان البريد الإلكتروني المقترن بحسابك، سيلزمك تسجيل الدخول مرة أخرى.";
189192

190193
/* Alert action message shown before confirmation of updating email action. */
191194
"UpdateEmailVerificationAlertMessage" = "لتغيير كلمة المرور، يجب أولاً إدخال كلمة المرور الحالية.";

0 commit comments

Comments
 (0)