Skip to content

Commit e002709

Browse files
ryanwilsonpaulb777
authored andcommitted
Mark ObjC typedefs as unavailable in Swift. (#9387)
* Mark ObjC typedefs as unavailable in Swift. This is part of the larger Swift API improvements effort. These reduce visibility in autocomplete, and we've mostly migrated away from them already. This hides the unused type from the API surface to avoid cluttering the list of types avialable. * Revert FDL Test * Fix CombineSwift tests * Fixed Firestore tests * Revert unneeded changes for FDL internal headers.
1 parent 2d6980f commit e002709

File tree

19 files changed

+102
-71
lines changed

19 files changed

+102
-71
lines changed

FirebaseAuth/Interop/FIRAuthInterop.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ NS_ASSUME_NONNULL_BEGIN
2525
@brief The type of block which gets called when a token is ready.
2626
*/
2727
typedef void (^FIRTokenCallback)(NSString *_Nullable token, NSError *_Nullable error)
28-
NS_SWIFT_NAME(TokenCallback);
28+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
2929

3030
/// Common methods for Auth interoperability.
3131
NS_SWIFT_NAME(AuthInterop)
3232
@protocol FIRAuthInterop
3333

3434
/// Retrieves the Firebase authentication token, possibly refreshing it if it has expired.
3535
- (void)getTokenForcingRefresh:(BOOL)forceRefresh
36-
withCallback:(FIRTokenCallback)callback
36+
withCallback:
37+
(void (^)(NSString *_Nullable token, NSError *_Nullable error))callback
3738
NS_SWIFT_NAME(getToken(forcingRefresh:completion:));
3839

3940
/// Get the current Auth user's UID. Returns nil if there is no user signed in.

FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuth.h

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ NS_ASSUME_NONNULL_BEGIN
3535
/** @typedef FIRUserUpdateCallback
3636
@brief The type of block invoked when a request to update the current user is completed.
3737
*/
38-
typedef void (^FIRUserUpdateCallback)(NSError *_Nullable error) NS_SWIFT_NAME(UserUpdateCallback);
38+
typedef void (^FIRUserUpdateCallback)(NSError *_Nullable error)
39+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
3940

4041
/** @typedef FIRAuthStateDidChangeListenerHandle
4142
@brief The type of handle returned by `FIRAuth.addAuthStateDidChangeListener:`.
@@ -53,7 +54,7 @@ typedef id<NSObject> FIRAuthStateDidChangeListenerHandle
5354
@param user Optionally; the current signed in user, if any.
5455
*/
5556
typedef void (^FIRAuthStateDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullable user)
56-
NS_SWIFT_NAME(AuthStateDidChangeListenerBlock);
57+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
5758

5859
/** @typedef FIRIDTokenDidChangeListenerHandle
5960
@brief The type of handle returned by `FIRAuth.addIDTokenDidChangeListener:`.
@@ -71,7 +72,7 @@ typedef id<NSObject> FIRIDTokenDidChangeListenerHandle
7172
@param user Optionally; the current signed in user, if any.
7273
*/
7374
typedef void (^FIRIDTokenDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullable user)
74-
NS_SWIFT_NAME(IDTokenDidChangeListenerBlock);
75+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
7576

7677
/** @typedef FIRAuthDataResultCallback
7778
@brief The type of block invoked when sign-in related events complete.
@@ -82,7 +83,7 @@ typedef void (^FIRIDTokenDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullab
8283
*/
8384
typedef void (^FIRAuthDataResultCallback)(FIRAuthDataResult *_Nullable authResult,
8485
NSError *_Nullable error)
85-
NS_SWIFT_NAME(AuthDataResultCallback);
86+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
8687
/**
8788
@brief The name of the `NSNotificationCenter` notification which is posted when the auth state
8889
changes (for example, a new token has been produced, a user signs in or signs out). The
@@ -98,7 +99,7 @@ extern const NSNotificationName FIRAuthStateDidChangeNotification NS_SWIFT_NAME(
9899
problem. Set to nil otherwise.
99100
*/
100101
typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error)
101-
NS_SWIFT_NAME(AuthResultCallback);
102+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
102103

103104
/** @typedef FIRProviderQueryCallback
104105
@brief The type of block invoked when a list of identity providers for a given email address is
@@ -111,14 +112,14 @@ typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullabl
111112
*/
112113
typedef void (^FIRProviderQueryCallback)(NSArray<NSString *> *_Nullable providers,
113114
NSError *_Nullable error)
114-
NS_SWIFT_NAME(ProviderQueryCallback);
115+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
115116

116117
/** @typedef FIRSignInMethodQueryCallback
117118
@brief The type of block invoked when a list of sign-in methods for a given email address is
118119
requested.
119120
*/
120121
typedef void (^FIRSignInMethodQueryCallback)(NSArray<NSString *> *_Nullable, NSError *_Nullable)
121-
NS_SWIFT_NAME(SignInMethodQueryCallback);
122+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
122123

123124
/** @typedef FIRSendPasswordResetCallback
124125
@brief The type of block invoked when sending a password reset email.
@@ -127,13 +128,13 @@ typedef void (^FIRSignInMethodQueryCallback)(NSArray<NSString *> *_Nullable, NSE
127128
problem. Set to nil otherwise.
128129
*/
129130
typedef void (^FIRSendPasswordResetCallback)(NSError *_Nullable error)
130-
NS_SWIFT_NAME(SendPasswordResetCallback);
131+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
131132

132133
/** @typedef FIRSendSignInLinkToEmailCallback
133134
@brief The type of block invoked when sending an email sign-in link email.
134135
*/
135136
typedef void (^FIRSendSignInLinkToEmailCallback)(NSError *_Nullable error)
136-
NS_SWIFT_NAME(SendSignInLinkToEmailCallback);
137+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
137138

138139
/** @typedef FIRConfirmPasswordResetCallback
139140
@brief The type of block invoked when performing a password reset.
@@ -142,7 +143,7 @@ typedef void (^FIRSendSignInLinkToEmailCallback)(NSError *_Nullable error)
142143
problem. Set to nil otherwise.
143144
*/
144145
typedef void (^FIRConfirmPasswordResetCallback)(NSError *_Nullable error)
145-
NS_SWIFT_NAME(ConfirmPasswordResetCallback);
146+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
146147

147148
/** @typedef FIRVerifyPasswordResetCodeCallback
148149
@brief The type of block invoked when verifying that an out of band code should be used to
@@ -154,7 +155,7 @@ typedef void (^FIRConfirmPasswordResetCallback)(NSError *_Nullable error)
154155
*/
155156
typedef void (^FIRVerifyPasswordResetCodeCallback)(NSString *_Nullable email,
156157
NSError *_Nullable error)
157-
NS_SWIFT_NAME(VerifyPasswordResetCodeCallback);
158+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
158159

159160
/** @typedef FIRApplyActionCodeCallback
160161
@brief The type of block invoked when applying an action code.
@@ -163,9 +164,10 @@ typedef void (^FIRVerifyPasswordResetCodeCallback)(NSString *_Nullable email,
163164
problem. Set to nil otherwise.
164165
*/
165166
typedef void (^FIRApplyActionCodeCallback)(NSError *_Nullable error)
166-
NS_SWIFT_NAME(ApplyActionCodeCallback);
167+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
167168

168-
typedef void (^FIRAuthVoidErrorCallback)(NSError *_Nullable) NS_SWIFT_NAME(AuthVoidErrorCallback);
169+
typedef void (^FIRAuthVoidErrorCallback)(NSError *_Nullable)
170+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
169171

170172
/** @class FIRActionCodeInfo
171173
@brief Manages information regarding action codes.
@@ -279,7 +281,7 @@ NS_SWIFT_NAME(ActionCodeURL)
279281
*/
280282
typedef void (^FIRCheckActionCodeCallBack)(FIRActionCodeInfo *_Nullable info,
281283
NSError *_Nullable error)
282-
NS_SWIFT_NAME(CheckActionCodeCallback);
284+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
283285

284286
/** @class FIRAuth
285287
@brief Manages authentication for Firebase apps.

FirebaseAuth/Sources/Public/FirebaseAuth/FIRFederatedAuthProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ NS_SWIFT_NAME(FederatedAuthProvider)
3535
*/
3636
typedef void (^FIRAuthCredentialCallback)(FIRAuthCredential *_Nullable credential,
3737
NSError *_Nullable error)
38-
NS_SWIFT_NAME(AuthCredentialCallback);
38+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
3939

4040
/** @fn getCredentialWithUIDelegate:completion:
4141
@brief Used to obtain an auth credential via a mobile web flow.

FirebaseAuth/Sources/Public/FirebaseAuth/FIRGameCenterAuthProvider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extern NSString *const _Nonnull FIRGameCenterAuthSignInMethod NS_SWIFT_NAME(
3838
*/
3939
typedef void (^FIRGameCenterCredentialCallback)(FIRAuthCredential *_Nullable credential,
4040
NSError *_Nullable error)
41-
NS_SWIFT_NAME(GameCenterCredentialCallback);
41+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
4242

4343
/** @class FIRGameCenterAuthProvider
4444
@brief A concrete implementation of @c FIRAuthProvider for Game Center Sign In. Not available on

FirebaseAuth/Sources/Public/FirebaseAuth/FIRMultiFactor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ NS_ASSUME_NONNULL_BEGIN
3131
*/
3232
typedef void (^FIRMultiFactorSessionCallback)(FIRMultiFactorSession *_Nullable session,
3333
NSError *_Nullable error)
34-
NS_SWIFT_NAME(MultiFactorSessionCallback) API_UNAVAILABLE(macos, tvos, watchos);
34+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.")
35+
API_UNAVAILABLE(macos, tvos, watchos);
3536

3637
/**
3738
@brief The string identifier for second factors. e.g. "phone".

FirebaseAuth/Sources/Public/FirebaseAuth/FIRPhoneAuthProvider.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ extern NSString *const _Nonnull FIRPhoneAuthSignInMethod NS_SWIFT_NAME(PhoneAuth
4747
*/
4848
typedef void (^FIRVerificationResultCallback)(NSString *_Nullable verificationID,
4949
NSError *_Nullable error)
50-
NS_SWIFT_NAME(VerificationResultCallback) API_UNAVAILABLE(macos, tvos, watchos);
50+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.")
51+
API_UNAVAILABLE(macos, tvos, watchos);
5152

5253
/** @class FIRPhoneAuthProvider
5354
@brief A concrete implementation of `FIRAuthProvider` for phone auth providers.
@@ -86,7 +87,8 @@ NS_SWIFT_NAME(PhoneAuthProvider) API_UNAVAILABLE(macos, tvos, watchos)
8687
*/
8788
- (void)verifyPhoneNumber:(NSString *)phoneNumber
8889
UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
89-
completion:(nullable FIRVerificationResultCallback)completion;
90+
completion:(nullable void (^)(NSString *_Nullable verificationID,
91+
NSError *_Nullable error))completion;
9092

9193
/** @fn verifyPhoneNumber:UIDelegate:multiFactorSession:completion:
9294
@brief Verify ownership of the second factor phone number by the current user.
@@ -101,7 +103,8 @@ NS_SWIFT_NAME(PhoneAuthProvider) API_UNAVAILABLE(macos, tvos, watchos)
101103
- (void)verifyPhoneNumber:(NSString *)phoneNumber
102104
UIDelegate:(nullable id<FIRAuthUIDelegate>)UIDelegate
103105
multiFactorSession:(nullable FIRMultiFactorSession *)session
104-
completion:(nullable FIRVerificationResultCallback)completion;
106+
completion:(nullable void (^)(NSString *_Nullable verificationID,
107+
NSError *_Nullable error))completion;
105108

106109
/** @fn verifyPhoneNumberWithMultiFactorInfo:UIDelegate:multiFactorSession:completion:
107110
@brief Verify ownership of the second factor phone number by the current user.

FirebaseAuth/Sources/Public/FirebaseAuth/FIRUser.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ NS_ASSUME_NONNULL_BEGIN
4040
@remarks One of: `token` or `error` will always be non-nil.
4141
*/
4242
typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullable error)
43-
NS_SWIFT_NAME(AuthTokenCallback);
43+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
4444

4545
/** @typedef FIRAuthTokenResultCallback
4646
@brief The type of block called when a token is ready for use.
@@ -55,23 +55,23 @@ typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullab
5555
*/
5656
typedef void (^FIRAuthTokenResultCallback)(FIRAuthTokenResult *_Nullable tokenResult,
5757
NSError *_Nullable error)
58-
NS_SWIFT_NAME(AuthTokenResultCallback);
58+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
5959

6060
/** @typedef FIRUserProfileChangeCallback
6161
@brief The type of block called when a user profile change has finished.
6262
6363
@param error Optionally; the error which occurred - or nil if the request was successful.
6464
*/
6565
typedef void (^FIRUserProfileChangeCallback)(NSError *_Nullable error)
66-
NS_SWIFT_NAME(UserProfileChangeCallback);
66+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
6767

6868
/** @typedef FIRSendEmailVerificationCallback
6969
@brief The type of block called when a request to send an email verification has finished.
7070
7171
@param error Optionally; the error which occurred - or nil if the request was successful.
7272
*/
7373
typedef void (^FIRSendEmailVerificationCallback)(NSError *_Nullable error)
74-
NS_SWIFT_NAME(SendEmailVerificationCallback);
74+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
7575

7676
/** @class FIRUser
7777
@brief Represents a user. Firebase Auth does not attempt to validate users

FirebaseCombineSwift/Tests/Unit/Firestore/GetDocumentsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class GetDocumentsTests: XCTestCase {
2727
var verifySource: ((_ source: FirestoreSource) -> Void)?
2828

2929
override func getDocuments(source: FirestoreSource,
30-
completion: @escaping FIRQuerySnapshotBlock) {
30+
completion: @escaping (QuerySnapshot?, Error?) -> Void) {
3131
do {
3232
verifySource?(source)
3333
let snapshot = try mockGetDocuments()

FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
NS_ASSUME_NONNULL_BEGIN
2222

2323
/** A block that takes a BOOL and has no return value. */
24-
typedef void (^FIRAppVoidBoolCallback)(BOOL success) NS_SWIFT_NAME(FirebaseAppVoidBoolCallback);
24+
typedef void (^FIRAppVoidBoolCallback)(BOOL success)
25+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
2526

2627
/**
2728
* The entry point of Firebase SDKs.
@@ -96,7 +97,7 @@ NS_SWIFT_NAME(FirebaseApp)
9697
* Cleans up the current `FirebaseApp`, freeing associated data and returning its name to the pool
9798
* for future use. This method is thread safe.
9899
*/
99-
- (void)deleteApp:(FIRAppVoidBoolCallback)completion;
100+
- (void)deleteApp:(void (^)(BOOL success))completion;
100101

101102
/**
102103
* `FirebaseApp` instances should not be initialized directly. Call `FirebaseApp.configure()`,

FirebaseDynamicLinks/Sources/Public/FirebaseDynamicLinks/FDLURLComponents.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ typedef NS_ENUM(NSInteger, FIRShortDynamicLinkPathLength) {
4343
typedef void (^FIRDynamicLinkShortenerCompletion)(NSURL *_Nullable shortURL,
4444
NSArray<NSString *> *_Nullable warnings,
4545
NSError *_Nullable error)
46-
NS_SWIFT_NAME(DynamicLinkShortenerCompletion);
46+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
4747

4848
/**
4949
* @class FIRDynamicLinkGoogleAnalyticsParameters
@@ -541,15 +541,19 @@ NS_SWIFT_NAME(DynamicLinkComponents)
541541
*/
542542
+ (void)shortenURL:(NSURL *)url
543543
options:(FIRDynamicLinkComponentsOptions *_Nullable)options
544-
completion:(FIRDynamicLinkShortenerCompletion)completion;
544+
completion:(void (^)(NSURL *_Nullable shortURL,
545+
NSArray<NSString *> *_Nullable warnings,
546+
NSError *_Nullable error))completion;
545547

546548
/**
547549
* @method shortenWithCompletion:
548550
* @abstract Generates a short Dynamic Link URL using all set parameters.
549551
* @param completion A block to be executed upon completion of the shortening attempt. It is
550552
* guaranteed to be executed once and on the main thread.
551553
*/
552-
- (void)shortenWithCompletion:(FIRDynamicLinkShortenerCompletion)completion;
554+
- (void)shortenWithCompletion:(void (^)(NSURL *_Nullable shortURL,
555+
NSArray<NSString *> *_Nullable warnings,
556+
NSError *_Nullable error))completion;
553557

554558
@end
555559

FirebaseDynamicLinks/Sources/Public/FirebaseDynamicLinks/FIRDynamicLinks.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ NS_SWIFT_NAME(DynamicLinks)
8080
* universal link URL.
8181
*/
8282
- (void)dynamicLinkFromUniversalLinkURL:(NSURL *)url
83-
completion:(FIRDynamicLinkUniversalLinkHandler)completion
83+
completion:(void (^)(FIRDynamicLink *_Nullable dynamicLink,
84+
NSError *_Nullable error))completion
8485
NS_SWIFT_NAME(dynamicLink(fromUniversalLink:completion:));
8586

8687
/**
@@ -104,15 +105,18 @@ NS_SWIFT_NAME(DynamicLinks)
104105
* @param completion A block that handles the outcome of attempting to create a FIRDynamicLink.
105106
* @return YES if FIRDynamicLinks is handling the link, otherwise, NO.
106107
*/
107-
- (BOOL)handleUniversalLink:(NSURL *)url completion:(FIRDynamicLinkUniversalLinkHandler)completion;
108+
- (BOOL)handleUniversalLink:(NSURL *)url
109+
completion:(void (^)(FIRDynamicLink *_Nullable dynamicLink,
110+
NSError *_Nullable error))completion;
108111

109112
/**
110113
* @method resolveShortLink:completion:
111114
* @abstract Retrieves the details of the Dynamic Link that the shortened URL represents.
112115
* @param url A Short Dynamic Link.
113116
* @param completion Block to be run upon completion.
114117
*/
115-
- (void)resolveShortLink:(NSURL *)url completion:(FIRDynamicLinkResolverHandler)completion;
118+
- (void)resolveShortLink:(NSURL *)url
119+
completion:(void (^)(NSURL *_Nullable url, NSError *_Nullable error))completion;
116120

117121
/**
118122
* @method matchesShortLinkFormat:

FirebaseDynamicLinks/Sources/Public/FirebaseDynamicLinks/FIRDynamicLinksCommon.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ NS_ASSUME_NONNULL_BEGIN
2929
* @abstract The definition of the block used by |resolveShortLink:completion:|
3030
*/
3131
typedef void (^FIRDynamicLinkResolverHandler)(NSURL* _Nullable url, NSError* _Nullable error)
32-
NS_SWIFT_NAME(DynamicLinkResolverHandler);
32+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
3333

3434
/**
3535
* @abstract The definition of the block used by |handleUniversalLink:completion:|
3636
*/
3737
typedef void (^FIRDynamicLinkUniversalLinkHandler)(FIRDynamicLink* _Nullable dynamicLink,
3838
NSError* _Nullable error)
39-
NS_SWIFT_NAME(DynamicLinkUniversalLinkHandler);
39+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
4040

4141
NS_ASSUME_NONNULL_END

FirebaseInstallations/Source/Library/Public/FirebaseInstallations/FIRInstallations.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ FOUNDATION_EXPORT NSString *const kFIRInstallationIDDidChangeNotificationAppName
3838
*/
3939
typedef void (^FIRInstallationsIDHandler)(NSString *__nullable identifier,
4040
NSError *__nullable error)
41-
NS_SWIFT_NAME(InstallationsIDHandler);
41+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
4242

4343
/**
4444
* An authorization token handler block.
@@ -48,7 +48,7 @@ typedef void (^FIRInstallationsIDHandler)(NSString *__nullable identifier,
4848
*/
4949
typedef void (^FIRInstallationsTokenHandler)(
5050
FIRInstallationsAuthTokenResult *__nullable tokenResult, NSError *__nullable error)
51-
NS_SWIFT_NAME(InstallationsTokenHandler);
51+
NS_SWIFT_UNAVAILABLE("Use Swift's closure syntax instead.");
5252

5353
/**
5454
* The class provides API for Firebase Installations.
@@ -83,20 +83,20 @@ NS_SWIFT_NAME(Installations)
8383
* The method creates or retrieves an installation ID. The installation ID is a stable identifier
8484
* that uniquely identifies the app instance. NOTE: If the application already has an existing
8585
* FirebaseInstanceID then the InstanceID identifier will be used.
86-
* @param completion A completion handler which is invoked when the operation completes. See
87-
* `InstallationsIDHandler` for additional details.
86+
* @param completion A completion handler which is invoked when the operation completes.
8887
*/
89-
- (void)installationIDWithCompletion:(FIRInstallationsIDHandler)completion;
88+
- (void)installationIDWithCompletion:(void (^)(NSString *__nullable identifier,
89+
NSError *__nullable error))completion;
9090

9191
/**
9292
* Retrieves (locally if it exists or from the server) a valid installation auth token. An existing
9393
* token may be invalidated or expired, so it is recommended to fetch the installation auth token
9494
* before each server request. The method does the same as `Installations.authTokenForcingRefresh(:,
9595
* completion:)` with forcing refresh `NO`.
96-
* @param completion A completion handler which is invoked when the operation completes. See
97-
* `InstallationsTokenHandler` for additional details.
96+
* @param completion A completion handler which is invoked when the operation completes.
9897
*/
99-
- (void)authTokenWithCompletion:(FIRInstallationsTokenHandler)completion;
98+
- (void)authTokenWithCompletion:(void (^)(FIRInstallationsAuthTokenResult *__nullable tokenResult,
99+
NSError *__nullable error))completion;
100100

101101
/**
102102
* Retrieves (locally or from the server depending on `forceRefresh` value) a valid installation
@@ -111,7 +111,8 @@ NS_SWIFT_NAME(Installations)
111111
* `InstallationsTokenHandler` for additional details.
112112
*/
113113
- (void)authTokenForcingRefresh:(BOOL)forceRefresh
114-
completion:(FIRInstallationsTokenHandler)completion;
114+
completion:(void (^)(FIRInstallationsAuthTokenResult *__nullable tokenResult,
115+
NSError *__nullable error))completion;
115116

116117
/**
117118
* Deletes all the installation data including the unique identifier, auth tokens and

0 commit comments

Comments
 (0)