-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[auth-swift] Restore Objective-C defined public globals and typedefs (#…
- Loading branch information
Showing
25 changed files
with
712 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright 2017 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
const NSNotificationName FIRAuthStateDidChangeNotification = @"FIRAuthStateDidChangeNotification"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2017 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NSString *const FIRAuthErrorDomain = @"FIRAuthErrorDomain"; | ||
|
||
NSString *const FIRAuthInternalErrorDomain = @"FIRAuthInternalErrorDomain"; | ||
|
||
NSString *const FIRAuthErrorUserInfoDeserializedResponseKey = | ||
@"FIRAuthErrorUserInfoDeserializedResponseKey"; | ||
|
||
NSString *const FIRAuthErrorUserInfoDataKey = @"FIRAuthErrorUserInfoDataKey"; | ||
|
||
NSString *const FIRAuthErrorUserInfoEmailKey = @"FIRAuthErrorUserInfoEmailKey"; | ||
|
||
NSString *const FIRAuthErrorUserInfoUpdatedCredentialKey = | ||
@"FIRAuthErrorUserInfoUpdatedCredentialKey"; | ||
|
||
NSString *const FIRAuthErrorUserInfoNameKey = @"FIRAuthErrorUserInfoNameKey"; | ||
|
||
NSString *const FIRAuthErrorUserInfoMultiFactorResolverKey = | ||
@"FIRAuthErrorUserInfoMultiFactorResolverKey"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2017 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#pragma mark - Provider ID constants | ||
|
||
// Declared 'extern' in FIRGoogleAuthProvider.h | ||
NSString *const FIRGoogleAuthProviderID = @"google.com"; | ||
|
||
// Declared 'extern' in FIRFacebookAuthProvider.h | ||
NSString *const FIRFacebookAuthProviderID = @"facebook.com"; | ||
|
||
// Declared 'extern' in FIREmailAuthProvider.h | ||
NSString *const FIREmailAuthProviderID = @"password"; | ||
|
||
// Declared 'extern' in FIRTwitterAuthProvider.h | ||
NSString *const FIRTwitterAuthProviderID = @"twitter.com"; | ||
|
||
// Declared 'extern' in FIRGitHubAuthProvider.h | ||
NSString *const FIRGitHubAuthProviderID = @"github.com"; | ||
|
||
// Declared 'extern' in FIRPhoneAuthProvider.h | ||
NSString *const FIRPhoneAuthProviderID = @"phone"; | ||
|
||
// Declared 'extern' in FIRGameCenterAuthProvider.h | ||
NSString *const FIRGameCenterAuthProviderID = @"gc.apple.com"; | ||
|
||
#pragma mark - sign-in methods constants | ||
|
||
// Declared 'extern' in FIRGoogleAuthProvider.h | ||
NSString *const FIRGoogleAuthSignInMethod = @"google.com"; | ||
|
||
// Declared 'extern' in FIREmailAuthProvider.h | ||
NSString *const FIREmailPasswordAuthSignInMethod = @"password"; | ||
|
||
// Declared 'extern' in FIREmailAuthProvider.h | ||
NSString *const FIREmailLinkAuthSignInMethod = @"emailLink"; | ||
|
||
// Declared 'extern' in FIRTwitterAuthProvider.h | ||
NSString *const FIRTwitterAuthSignInMethod = @"twitter.com"; | ||
|
||
// Declared 'extern' in FIRFacebookAuthProvider.h | ||
NSString *const FIRFacebookAuthSignInMethod = @"facebook.com"; | ||
|
||
// Declared 'extern' in FIRGitHubAuthProvider.h | ||
NSString *const FIRGitHubAuthSignInMethod = @"github.com"; | ||
|
||
// Declared 'extern' in FIRPhoneAuthProvider.h | ||
NSString *const FIRPhoneAuthSignInMethod = @"phone"; | ||
|
||
// Declared 'extern' in FIRGameCenterAuthProvider.h | ||
NSString *const FIRGameCenterAuthSignInMethod = @"gc.apple.com"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2019 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <TargetConditionals.h> | ||
#if TARGET_OS_IOS | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#pragma mark - Multi Factor ID constants | ||
|
||
NSString *const FIRPhoneMultiFactorID = @"phone"; | ||
NSString *const FIRTOTPMultiFactorID = @"totp"; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* Copyright 2017 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
@brief The Firebase Auth error domain. | ||
*/ | ||
extern NSString *const FIRAuthErrorDomain NS_SWIFT_NAME(AuthErrorDomain); | ||
|
||
/** | ||
@brief The name of the key for the error short string of an error code. | ||
*/ | ||
extern NSString *const FIRAuthErrorUserInfoNameKey NS_SWIFT_NAME(AuthErrorUserInfoNameKey); | ||
|
||
/** | ||
@brief Errors with one of the following three codes: | ||
- `AuthErrorCodeAccountExistsWithDifferentCredential` | ||
- `AuthErrorCodeCredentialAlreadyInUse` | ||
- `AuthErrorCodeEmailAlreadyInUse` | ||
may contain an `NSError.userInfo` dictinary object which contains this key. The value | ||
associated with this key is an NSString of the email address of the account that already | ||
exists. | ||
*/ | ||
extern NSString *const FIRAuthErrorUserInfoEmailKey NS_SWIFT_NAME(AuthErrorUserInfoEmailKey); | ||
|
||
/** | ||
@brief The key used to read the updated Auth credential from the userInfo dictionary of the | ||
NSError object returned. This is the updated auth credential the developer should use for | ||
recovery if applicable. | ||
*/ | ||
// clang-format off | ||
// clang-format12 will merge lines and exceed 100 character limit. | ||
extern NSString *const FIRAuthErrorUserInfoUpdatedCredentialKey | ||
NS_SWIFT_NAME(AuthErrorUserInfoUpdatedCredentialKey); | ||
|
||
/** | ||
@brief The key used to read the MFA resolver from the userInfo dictionary of the NSError object | ||
returned when 2FA is required for sign-incompletion. | ||
*/ | ||
extern NSString *const FIRAuthErrorUserInfoMultiFactorResolverKey | ||
NS_SWIFT_NAME(AuthErrorUserInfoMultiFactorResolverKey); | ||
// clang-format on | ||
|
||
NS_ASSUME_NONNULL_END |
39 changes: 39 additions & 0 deletions
39
FirebaseAuth/Sources/Public/FirebaseAuth/FIREmailAuthProvider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2017 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
/** | ||
@brief A string constant identifying the email & password identity provider. | ||
*/ | ||
extern NSString *const FIREmailAuthProviderID NS_SWIFT_NAME(EmailAuthProviderID); | ||
|
||
/** | ||
@brief A string constant identifying the email-link sign-in method. | ||
*/ | ||
extern NSString *const FIREmailLinkAuthSignInMethod NS_SWIFT_NAME(EmailLinkAuthSignInMethod); | ||
|
||
/** | ||
@brief A string constant identifying the email & password sign-in method. | ||
*/ | ||
// clang-format off | ||
// clang-format12 merges the next two lines. | ||
extern NSString *const FIREmailPasswordAuthSignInMethod | ||
NS_SWIFT_NAME(EmailPasswordAuthSignInMethod); | ||
// clang-format on | ||
|
||
NS_ASSUME_NONNULL_END |
33 changes: 33 additions & 0 deletions
33
FirebaseAuth/Sources/Public/FirebaseAuth/FIRFacebookAuthProvider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2017 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class FIRAuthCredential; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
@brief A string constant identifying the Facebook identity provider. | ||
*/ | ||
extern NSString *const FIRFacebookAuthProviderID NS_SWIFT_NAME(FacebookAuthProviderID); | ||
|
||
/** | ||
@brief A string constant identifying the Facebook sign-in method. | ||
*/ | ||
extern NSString *const _Nonnull FIRFacebookAuthSignInMethod NS_SWIFT_NAME(FacebookAuthSignInMethod); | ||
|
||
NS_ASSUME_NONNULL_END |
32 changes: 32 additions & 0 deletions
32
FirebaseAuth/Sources/Public/FirebaseAuth/FIRFederatedAuthProvider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2017 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class FIRAuthCredential; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** @typedef FIRAuthCredentialCallback | ||
@brief The type of block invoked when obtaining an auth credential. | ||
@param credential The credential obtained. | ||
@param error The error that occurred if any. | ||
*/ | ||
typedef void (^FIRAuthCredentialCallback)(FIRAuthCredential *_Nullable credential, | ||
NSError *_Nullable error) | ||
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead."); | ||
|
||
NS_ASSUME_NONNULL_END |
43 changes: 43 additions & 0 deletions
43
FirebaseAuth/Sources/Public/FirebaseAuth/FIRGameCenterAuthProvider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2018 Google | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class FIRAuthCredential; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
@brief A string constant identifying the Game Center identity provider. | ||
*/ | ||
extern NSString *const FIRGameCenterAuthProviderID NS_SWIFT_NAME(GameCenterAuthProviderID); | ||
|
||
/** | ||
@brief A string constant identifying the Game Center sign-in method. | ||
*/ | ||
extern NSString *const _Nonnull FIRGameCenterAuthSignInMethod NS_SWIFT_NAME( | ||
GameCenterAuthSignInMethod); | ||
|
||
/** @typedef FIRGameCenterCredentialCallback | ||
@brief The type of block invoked when the Game Center credential code has finished. | ||
@param credential On success, the credential will be provided, nil otherwise. | ||
@param error On error, the error that occurred, nil otherwise. | ||
*/ | ||
typedef void (^FIRGameCenterCredentialCallback)(FIRAuthCredential *_Nullable credential, | ||
NSError *_Nullable error) | ||
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead."); | ||
|
||
NS_ASSUME_NONNULL_END |
Oops, something went wrong.