From a0efcb6b04a90737414ce1d60b6e8c958df18d4e Mon Sep 17 00:00:00 2001 From: Morgan Chen Date: Mon, 27 Nov 2023 16:33:54 -0800 Subject: [PATCH 1/2] redeclare protocol method so it can be added to docs --- .../Public/FirebaseAppCheck/FIRAppAttestProvider.h | 13 +++++++++++++ .../FirebaseAppCheck/FIRAppCheckDebugProvider.h | 13 +++++++++++++ .../FirebaseAppCheck/FIRDeviceCheckProvider.h | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h index d7b730946d1..69f0888da44 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h @@ -40,6 +40,19 @@ NS_SWIFT_NAME(AppAttestProvider) /// required parameters. - (nullable instancetype)initWithApp:(FIRApp *)app; +/* Jazzy doesn't generate documentation for protocol-inherited + * methods, so this is copied over from the protocol declaration. + */ +/// Returns a new Firebase App Check token. +/// When implementing this method for your custom provider, the token returned should be suitable +/// for consumption in a limited-use scenario. If you do not implement this method, the +/// getTokenWithCompletion will be invoked instead whenever a limited-use token is requested. +/// @param handler The completion handler. Make sure to call the handler with either a token +/// or an error. +- (void)getLimitedUseTokenWithCompletion: + (void (^)(FIRAppCheckToken *_Nullable token, NSError *_Nullable error))handler + NS_SWIFT_NAME(getLimitedUseToken(completion:)); + @end NS_ASSUME_NONNULL_END diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h index 78b4e0b74bd..baf81266956 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h @@ -79,6 +79,19 @@ NS_SWIFT_NAME(AppCheckDebugProvider) */ - (NSString *)currentDebugToken; +/* Jazzy doesn't generate documentation for protocol-inherited + * methods, so this is copied over from the protocol declaration. + */ +/// Returns a new Firebase App Check token. +/// When implementing this method for your custom provider, the token returned should be suitable +/// for consumption in a limited-use scenario. If you do not implement this method, the +/// getTokenWithCompletion will be invoked instead whenever a limited-use token is requested. +/// @param handler The completion handler. Make sure to call the handler with either a token +/// or an error. +- (void)getLimitedUseTokenWithCompletion: + (void (^)(FIRAppCheckToken *_Nullable token, NSError *_Nullable error))handler + NS_SWIFT_NAME(getLimitedUseToken(completion:)); + @end NS_ASSUME_NONNULL_END diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h index 44ed77766bd..5a991faf69f 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h @@ -41,6 +41,19 @@ NS_SWIFT_NAME(DeviceCheckProvider) /// required parameters. - (nullable instancetype)initWithApp:(FIRApp *)app; +/* Jazzy doesn't generate documentation for protocol-inherited + * methods, so this is copied over from the protocol declaration. + */ +/// Returns a new Firebase App Check token. +/// When implementing this method for your custom provider, the token returned should be suitable +/// for consumption in a limited-use scenario. If you do not implement this method, the +/// getTokenWithCompletion will be invoked instead whenever a limited-use token is requested. +/// @param handler The completion handler. Make sure to call the handler with either a token +/// or an error. +- (void)getLimitedUseTokenWithCompletion: + (void (^)(FIRAppCheckToken *_Nullable token, NSError *_Nullable error))handler + NS_SWIFT_NAME(getLimitedUseToken(completion:)); + @end NS_ASSUME_NONNULL_END From a88bd01a804421c34dd50ecf342996c026bd8fcf Mon Sep 17 00:00:00 2001 From: Morgan Chen Date: Tue, 28 Nov 2023 13:17:39 -0800 Subject: [PATCH 2/2] Add other protocol method --- .../Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h | 7 +++++++ .../Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h | 7 +++++++ .../Public/FirebaseAppCheck/FIRDeviceCheckProvider.h | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h index 69f0888da44..e75042102ff 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppAttestProvider.h @@ -44,6 +44,13 @@ NS_SWIFT_NAME(AppAttestProvider) * methods, so this is copied over from the protocol declaration. */ /// Returns a new Firebase App Check token. +/// @param handler The completion handler. Make sure to call the handler with either a token +/// or an error. +- (void)getTokenWithCompletion: + (void (^)(FIRAppCheckToken *_Nullable token, NSError *_Nullable error))handler + NS_SWIFT_NAME(getToken(completion:)); + +/// Returns a new Firebase App Check token. /// When implementing this method for your custom provider, the token returned should be suitable /// for consumption in a limited-use scenario. If you do not implement this method, the /// getTokenWithCompletion will be invoked instead whenever a limited-use token is requested. diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h index baf81266956..08502c6d8f6 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRAppCheckDebugProvider.h @@ -83,6 +83,13 @@ NS_SWIFT_NAME(AppCheckDebugProvider) * methods, so this is copied over from the protocol declaration. */ /// Returns a new Firebase App Check token. +/// @param handler The completion handler. Make sure to call the handler with either a token +/// or an error. +- (void)getTokenWithCompletion: + (void (^)(FIRAppCheckToken *_Nullable token, NSError *_Nullable error))handler + NS_SWIFT_NAME(getToken(completion:)); + +/// Returns a new Firebase App Check token. /// When implementing this method for your custom provider, the token returned should be suitable /// for consumption in a limited-use scenario. If you do not implement this method, the /// getTokenWithCompletion will be invoked instead whenever a limited-use token is requested. diff --git a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h index 5a991faf69f..ae0f88de50c 100644 --- a/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h +++ b/FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRDeviceCheckProvider.h @@ -45,6 +45,13 @@ NS_SWIFT_NAME(DeviceCheckProvider) * methods, so this is copied over from the protocol declaration. */ /// Returns a new Firebase App Check token. +/// @param handler The completion handler. Make sure to call the handler with either a token +/// or an error. +- (void)getTokenWithCompletion: + (void (^)(FIRAppCheckToken *_Nullable token, NSError *_Nullable error))handler + NS_SWIFT_NAME(getToken(completion:)); + +/// Returns a new Firebase App Check token. /// When implementing this method for your custom provider, the token returned should be suitable /// for consumption in a limited-use scenario. If you do not implement this method, the /// getTokenWithCompletion will be invoked instead whenever a limited-use token is requested.