Skip to content

Commit 87e511d

Browse files
authored
Merge pull request #950 from firebase/release-4.11.0
Release 4.11.0
2 parents 5296665 + 03275eb commit 87e511d

File tree

66 files changed

+3919
-16
lines changed

Some content is hidden

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

66 files changed

+3919
-16
lines changed

Example/Auth/Sample/MainViewController.m

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@
9696
*/
9797
static NSString *const kSignInWithEmailLink = @"Sign in with Email Link";
9898

99+
/** @var kVerifyEmailLinkAccount
100+
@brief The text of the "Verify Email-link Account" button.
101+
*/
102+
static NSString *const kVerifyEmailLinkAccount = @"Verify Email-link Account";
103+
99104
/** @var kSendEmailSignInLink
100105
@brief The text of the "Send Email SignIn link" button
101106
*/
@@ -739,6 +744,8 @@ - (void)updateTable {
739744
action:^{ [weakSelf signInGoogle]; }],
740745
[StaticContentTableViewCell cellWithTitle:kSignInWithEmailLink
741746
action:^{ [weakSelf signInWithEmailLink]; }],
747+
[StaticContentTableViewCell cellWithTitle:kVerifyEmailLinkAccount
748+
action:^{ [weakSelf verifyEmailLinkAccount]; }],
742749
[StaticContentTableViewCell cellWithTitle:kSendEmailSignInLink
743750
action:^{ [weakSelf sendEmailSignInLink]; }],
744751
[StaticContentTableViewCell cellWithTitle:kSignInGoogleAndRetrieveDataButtonText
@@ -1784,6 +1791,29 @@ - (void)signInWithEmailLink {
17841791
}];
17851792
}
17861793

1794+
/** @fn verifyEmailLinkAccount
1795+
@brief Invoked to verify that the current user is an email-link user.
1796+
*/
1797+
- (void)verifyEmailLinkAccount {
1798+
if (![FIRAuth auth].currentUser.email) {
1799+
[self showMessagePrompt:@"There is no signed-in user available."];
1800+
return;
1801+
}
1802+
[[FIRAuth auth] fetchSignInMethodsForEmail:[FIRAuth auth].currentUser.email
1803+
completion:^(NSArray<NSString *> *_Nullable signInMethods,
1804+
NSError *_Nullable error) {
1805+
if (error) {
1806+
[self showMessagePrompt:@"There was an error fetching sign-in methods."];
1807+
return;
1808+
}
1809+
if (![signInMethods containsObject:FIREmailLinkAuthSignInMethod]) {
1810+
[self showMessagePrompt:@"Error: The current user is NOT an email-link user."];
1811+
return;
1812+
}
1813+
[self showMessagePrompt:@"The current user is an email-link user."];
1814+
}];
1815+
}
1816+
17871817
/** @fn sendEmailSignInLink
17881818
@brief Invoked when "Send email sign-in link" row is pressed.
17891819
*/

Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ target 'Core_Example_iOS' do
88
# The next line is the forcing function for the Firebase pod. The Firebase
99
# version's subspecs should depend on the component versions in their
1010
# corresponding podspec's.
11-
pod 'Firebase/Core', '4.10.1'
11+
pod 'Firebase/Core', '4.11.0'
1212

1313
target 'Core_Tests_iOS' do
1414
inherit! :search_paths

Firebase/Auth/Source/FIRAuth.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ - (void)fetchSignInMethodsForEmail:(nonnull NSString *)email
533533
FIRCreateAuthURIRequest *request =
534534
[[FIRCreateAuthURIRequest alloc] initWithIdentifier:email
535535
continueURI:@"http://www.google.com/"
536-
requestConfiguration:_requestConfiguration];
536+
requestConfiguration:self->_requestConfiguration];
537537
[FIRAuthBackend createAuthURI:request callback:^(FIRCreateAuthURIResponse *_Nullable response,
538538
NSError *_Nullable error) {
539539
if (completion) {
@@ -1124,7 +1124,7 @@ - (void)sendSignInLinkToEmail:(nonnull NSString *)email
11241124
FIRGetOOBConfirmationCodeRequest *request =
11251125
[FIRGetOOBConfirmationCodeRequest signInWithEmailLinkRequest:email
11261126
actionCodeSettings:actionCodeSettings
1127-
requestConfiguration:_requestConfiguration];
1127+
requestConfiguration:self->_requestConfiguration];
11281128
[FIRAuthBackend getOOBConfirmationCode:request
11291129
callback:^(FIRGetOOBConfirmationCodeResponse *_Nullable response,
11301130
NSError *_Nullable error) {

Firebase/Auth/Source/FIRAuthProvider.m

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#import <Foundation/Foundation.h>
1818

19+
#pragma mark - Provider ID constants
20+
1921
// Declared 'extern' in FIRGoogleAuthProvider.h
2022
NSString *const FIRGoogleAuthProviderID = @"google.com";
2123

@@ -36,3 +38,26 @@
3638

3739
// Declared 'extern' in FIRPhoneAuthProvider.h
3840
NSString *const FIRPhoneAuthProviderID = @"phone";
41+
42+
#pragma mark - sign-in methods constants
43+
44+
// Declared 'extern' in FIRGoogleAuthProvider.h
45+
NSString *const FIRGoogleAuthSignInMethod = @"google.com";
46+
47+
// Declared 'extern' in FIREmailAuthProvider.h
48+
NSString *const FIREmailPasswordAuthSignInMethod = @"password";
49+
50+
// Declared 'extern' in FIREmailAuthProvider.h
51+
NSString *const FIREmailLinkAuthSignInMethod = @"emailLink";
52+
53+
// Declared 'extern' in FIRTwitterAuthProvider.h
54+
NSString *const FIRTwitterAuthSignInMethod = @"twitter.com";
55+
56+
// Declared 'extern' in FIRFacebookAuthProvider.h
57+
NSString *const FIRFacebookAuthSignInMethod = @"facebook.com";
58+
59+
// Declared 'extern' in FIRGitHubAuthProvider.h
60+
NSString *const FIRGitHubAuthSignInMethod = @"github.com";
61+
62+
// Declared 'extern' in FIRPhoneAuthProvider.h
63+
NSString *const FIRPhoneAuthSignInMethod = @"phone";

Firebase/Auth/Source/Public/FIREmailAuthProvider.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ NS_ASSUME_NONNULL_BEGIN
2525
*/
2626
extern NSString *const FIREmailAuthProviderID NS_SWIFT_NAME(EmailAuthProviderID);
2727

28+
/**
29+
@brief A string constant identifying the email-link sign-in method.
30+
*/
31+
extern NSString *const FIREmailLinkAuthSignInMethod NS_SWIFT_NAME(EmailLinkAuthSignInMethod);
32+
33+
/**
34+
@brief A string constant identifying the email & password sign-in method.
35+
*/
36+
extern NSString *const FIREmailPasswordAuthSignInMethod
37+
NS_SWIFT_NAME(EmailPasswordAuthSignInMethod);
38+
2839
/**
2940
@brief Please use `FIREmailAuthProviderID` for Objective-C or `EmailAuthProviderID` for Swift instead.
3041
*/

Firebase/Auth/Source/Public/FIRFacebookAuthProvider.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ NS_ASSUME_NONNULL_BEGIN
2525
*/
2626
extern NSString *const FIRFacebookAuthProviderID NS_SWIFT_NAME(FacebookAuthProviderID);
2727

28+
/**
29+
@brief A string constant identifying the Facebook sign-in method.
30+
*/
31+
extern NSString *const _Nonnull FIRFacebookAuthSignInMethod NS_SWIFT_NAME(FacebookAuthSignInMethod);
32+
2833
/** @class FIRFacebookAuthProvider
2934
@brief Utility class for constructing Facebook credentials.
3035
*/

Firebase/Auth/Source/Public/FIRGitHubAuthProvider.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ NS_ASSUME_NONNULL_BEGIN
2525
*/
2626
extern NSString *const FIRGitHubAuthProviderID NS_SWIFT_NAME(GitHubAuthProviderID);
2727

28+
/**
29+
@brief A string constant identifying the GitHub sign-in method.
30+
*/
31+
extern NSString *const _Nonnull FIRGitHubAuthSignInMethod NS_SWIFT_NAME(GitHubAuthSignInMethod);
32+
33+
2834
/** @class FIRGitHubAuthProvider
2935
@brief Utility class for constructing GitHub credentials.
3036
*/

Firebase/Auth/Source/Public/FIRGoogleAuthProvider.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ NS_ASSUME_NONNULL_BEGIN
2525
*/
2626
extern NSString *const FIRGoogleAuthProviderID NS_SWIFT_NAME(GoogleAuthProviderID);
2727

28+
/**
29+
@brief A string constant identifying the Google sign-in method.
30+
*/
31+
extern NSString *const _Nonnull FIRGoogleAuthSignInMethod NS_SWIFT_NAME(GoogleAuthSignInMethod);
32+
2833
/** @class FIRGoogleAuthProvider
2934
@brief Utility class for constructing Google Sign In credentials.
3035
*/

Firebase/Auth/Source/Public/FIRPhoneAuthProvider.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ NS_ASSUME_NONNULL_BEGIN
2727
*/
2828
extern NSString *const FIRPhoneAuthProviderID NS_SWIFT_NAME(PhoneAuthProviderID);
2929

30+
/** @var FIRPhoneAuthProviderID
31+
@brief A string constant identifying the phone sign-in method.
32+
*/
33+
extern NSString *const _Nonnull FIRPhoneAuthSignInMethod NS_SWIFT_NAME(PhoneAuthSignInMethod);
34+
35+
3036
/** @typedef FIRVerificationResultCallback
3137
@brief The type of block invoked when a request to send a verification code has finished.
3238

Firebase/Auth/Source/Public/FIRTwitterAuthProvider.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ NS_ASSUME_NONNULL_BEGIN
2525
*/
2626
extern NSString *const FIRTwitterAuthProviderID NS_SWIFT_NAME(TwitterAuthProviderID);
2727

28+
/**
29+
@brief A string constant identifying the Twitter sign-in method.
30+
*/
31+
extern NSString *const _Nonnull FIRTwitterAuthSignInMethod NS_SWIFT_NAME(TwitterAuthSignInMethod);
32+
33+
2834
/** @class FIRTwitterAuthProvider
2935
@brief Utility class for constructing Twitter credentials.
3036
*/

Firebase/Core/FIROptions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
NSString *const kFIRLibraryVersionID =
4444
@"4" // Major version (one or more digits)
4545
@"00" // Minor version (exactly 2 digits)
46-
@"17" // Build number (exactly 2 digits)
46+
@"18" // Build number (exactly 2 digits)
4747
@"000"; // Fixed "000"
4848
// Plist file name.
4949
NSString *const kServiceInfoFileName = @"GoogleService-Info";

FirebaseAuth.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseAuth'
3-
s.version = '4.4.4'
3+
s.version = '4.5.0'
44
s.summary = 'The official iOS client for Firebase Authentication'
55

66
s.description = <<-DESC

FirebaseCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'FirebaseCore'
3-
s.version = '4.0.17'
3+
s.version = '4.0.18'
44
s.summary = 'Firebase Core for iOS'
55

66
s.description = <<-DESC

FirebaseFirestore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'FirebaseFirestore'
11-
s.version = '0.10.3'
11+
s.version = '0.10.4'
1212
s.summary = 'Google Cloud Firestore for iOS'
1313

1414
s.description = <<-DESC

FirebaseFunctions.podspec

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# Be sure to run `pod lib lint FirebaseFunctions.podspec' to ensure this is a
3+
# valid spec before submitting.
4+
#
5+
# Any lines starting with a # are optional, but their use is encouraged
6+
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
7+
#
8+
9+
Pod::Spec.new do |s|
10+
s.name = 'FirebaseFunctions'
11+
s.version = '1.0.0'
12+
s.summary = 'Cloud Functions for Firebase iOS SDK.'
13+
14+
s.description = <<-DESC
15+
iOS SDK for Cloud Functions for Firebase.
16+
DESC
17+
18+
s.homepage = 'https://developers.google.com/'
19+
s.authors = 'Google, Inc.'
20+
s.source = { :git => 'https://github.com/TBD/FirebaseFunctions.git', :tag => s.version.to_s }
21+
22+
s.ios.deployment_target = '8.0'
23+
24+
s.cocoapods_version = '>= 1.4.0'
25+
s.static_framework = true
26+
s.prefix_header_file = false
27+
28+
s.source_files = 'Functions/FirebaseFunctions/**/*'
29+
s.public_header_files = 'Functions/FirebaseFunctions/Public/*.h'
30+
31+
s.dependency 'FirebaseCore', '~> 4.0'
32+
s.dependency 'GTMSessionFetcher/Core', '~> 1.1'
33+
end

Firestore/Example/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The next line is the forcing function for the Firebase pod. The Firebase
22
# version's subspecs should depend on the component versions in their
33
# corresponding podspec's.
4-
pod 'Firebase/Core', '4.10.1'
4+
pod 'Firebase/Core', '4.11.0'
55

66
use_frameworks!
77
platform :ios, '8.0'

Firestore/Source/Util/FSTDispatchQueue.mm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,11 @@ - (FSTDelayedCallback *)dispatchAfterDelay:(NSTimeInterval)delay
230230
block:(void (^)(void))block {
231231
// While not necessarily harmful, we currently don't expect to have multiple callbacks with the
232232
// same timerID in the queue, so defensively reject them.
233-
FSTAssert(![self containsDelayedCallbackWithTimerID:timerID],
234-
@"Attempted to schedule multiple callbacks with id %ld", (unsigned long)timerID);
233+
// TODO(b/74749605): If a user change happens while offline we can end up with multiple backoff
234+
// callbacks in the dispatch queue. This is non-harmful so I'm just disabling the assert until we
235+
// get that cleaned up.
236+
// FSTAssert(![self containsDelayedCallbackWithTimerID:timerID],
237+
// @"Attempted to schedule multiple callbacks with id %ld", (unsigned long)timerID);
235238
FSTDelayedCallback *delayedCallback = [FSTDelayedCallback createAndScheduleWithQueue:self
236239
timerID:timerID
237240
delay:delay

Functions/.clang-format

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
BasedOnStyle: Google
2+
ColumnLimit: 100
3+
BinPackParameters: false
4+
AllowAllParametersOfDeclarationOnNextLine: true
5+
ObjCSpaceBeforeProtocolList: false
6+
SpacesInContainerLiterals: true
7+
PointerAlignment: Right

Functions/Backend/index.js

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
const assert = require('assert');
2+
const functions = require('firebase-functions');
3+
4+
exports.dataTest = functions.https.onRequest((request, response) => {
5+
assert.deepEqual(request.body, {
6+
data: {
7+
bool: true,
8+
int: 2,
9+
long: {
10+
value: '3',
11+
'@type': 'type.googleapis.com/google.protobuf.Int64Value',
12+
},
13+
string: 'four',
14+
array: [5, 6],
15+
'null': null,
16+
}
17+
});
18+
response.send({
19+
data: {
20+
message: 'stub response',
21+
code: 42,
22+
long: {
23+
value: '420',
24+
'@type': 'type.googleapis.com/google.protobuf.Int64Value',
25+
},
26+
}
27+
});
28+
});
29+
30+
exports.scalarTest = functions.https.onRequest((request, response) => {
31+
assert.deepEqual(request.body, { data: 17 });
32+
response.send({ data: 76 });
33+
});
34+
35+
exports.tokenTest = functions.https.onRequest((request, response) => {
36+
assert.equal('Bearer token', request.get('Authorization'));
37+
assert.deepEqual(request.body, { data: {} });
38+
response.send({ data: {} });
39+
});
40+
41+
exports.instanceIdTest = functions.https.onRequest((request, response) => {
42+
assert.equal(request.get('Firebase-Instance-ID-Token'), 'iid');
43+
assert.deepEqual(request.body, { data: {} });
44+
response.send({ data: {} });
45+
});
46+
47+
exports.nullTest = functions.https.onRequest((request, response) => {
48+
assert.deepEqual(request.body, { data: null });
49+
response.send({ data: null });
50+
});
51+
52+
exports.missingResultTest = functions.https.onRequest((request, response) => {
53+
assert.deepEqual(request.body, { data: null });
54+
response.send({});
55+
});
56+
57+
exports.unhandledErrorTest = functions.https.onRequest((request, response) => {
58+
// Fail in a way that the client shouldn't see.
59+
throw 'nope';
60+
});
61+
62+
exports.unknownErrorTest = functions.https.onRequest((request, response) => {
63+
// Send an http error with a body with an explicit code.
64+
response.status(400).send({
65+
error: {
66+
status: 'THIS_IS_NOT_VALID',
67+
message: 'this should be ignored',
68+
},
69+
});
70+
});
71+
72+
exports.explicitErrorTest = functions.https.onRequest((request, response) => {
73+
// Send an http error with a body with an explicit code.
74+
// Note that eventually the SDK will have a helper to automatically return
75+
// the appropriate http status code for an error.
76+
response.status(400).send({
77+
error: {
78+
status: 'OUT_OF_RANGE',
79+
message: 'explicit nope',
80+
details: {
81+
start: 10,
82+
end: 20,
83+
long: {
84+
value: '30',
85+
'@type': 'type.googleapis.com/google.protobuf.Int64Value',
86+
},
87+
},
88+
},
89+
});
90+
});
91+
92+
exports.httpErrorTest = functions.https.onRequest((request, response) => {
93+
// Send an http error with no body.
94+
response.status(400).send();
95+
});

0 commit comments

Comments
 (0)