lpw
2021-04-20 b19a78b27247f5f0761c35b5b3e8a41876eabb05
frameworks/FBSDKCoreKit.framework/Headers/FBSDKGraphErrorRecoveryProcessor.h
@@ -16,39 +16,57 @@
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#import "TargetConditionals.h"
#if !TARGET_OS_TV
#import <Foundation/Foundation.h>
#ifdef BUCK
#import <FBSDKCoreKit/FBSDKConstants.h>
#else
#import "FBSDKConstants.h"
#endif
NS_ASSUME_NONNULL_BEGIN
@class FBSDKGraphErrorRecoveryProcessor;
@class FBSDKGraphRequest;
@protocol FBSDKGraphRequest;
/**
  Defines a delegate for `FBSDKGraphErrorRecoveryProcessor`.
 */
NS_SWIFT_NAME(GraphErrorRecoveryProcessorDelegate)
@protocol FBSDKGraphErrorRecoveryProcessorDelegate<NSObject>
/**
  Indicates the error recovery has been attempted.
 - Parameter processor: the processor instance.
 - Parameter didRecover: YES if the recovery was successful.
 - Parameter error: the error that that was attempted to be recovered from.
 @param processor the processor instance.
 @param didRecover YES if the recovery was successful.
 @param error the error that that was attempted to be recovered from.
 */
- (void)processorDidAttemptRecovery:(FBSDKGraphErrorRecoveryProcessor *)processor didRecover:(BOOL)didRecover error:(NSError *)error;
- (void)processorDidAttemptRecovery:(FBSDKGraphErrorRecoveryProcessor *)processor
                         didRecover:(BOOL)didRecover
                              error:(nullable NSError *)error;
@optional
/**
  Indicates the processor is about to process the error.
 - Parameter processor: the processor instance.
 - Parameter error: the error is about to be processed.
 @param processor the processor instance.
 @param error the error is about to be processed.
 return NO if the processor should not process the error. For example,
 if you want to prevent alerts of localized messages but otherwise perform retries and recoveries,
 you could return NO for errors where userInfo[FBSDKGraphRequestErrorCategoryKey] equal to FBSDKGraphRequestErrorCategoryOther
 you could return NO for errors where userInfo[FBSDKGraphRequestErrorKey] equal to FBSDKGraphRequestErrorOther
 */
- (BOOL)processorWillProcessError:(FBSDKGraphErrorRecoveryProcessor *)processor error:(NSError *)error;
- (BOOL)processorWillProcessError:(FBSDKGraphErrorRecoveryProcessor *)processor
                            error:(nullable NSError *)error;
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_BEGIN
/**
  Defines a type that can process Facebook NSErrors with best practices.
@@ -56,7 +74,7 @@
 Facebook NSErrors can contain FBSDKErrorRecoveryAttempting instances to recover from errors, or
 localized messages to present to the user. This class will process the instances as follows:
 1. If the error is temporary as indicated by FBSDKGraphRequestErrorCategoryKey, assume the recovery succeeded and
 1. If the error is temporary as indicated by FBSDKGraphRequestErrorKey, assume the recovery succeeded and
 notify the delegate.
 2. If a FBSDKErrorRecoveryAttempting instance is available, display an alert (dispatched to main thread)
 with the recovery options and call the instance's [ attemptRecoveryFromError:optionIndex:...].
@@ -69,31 +87,40 @@
 Note that Facebook recovery attempters can present UI or even cause app switches (such as to login). Any such
 work is dispatched to the main thread (therefore your request handlers may then run on the main thread).
 Login recovery requires FBSDKLoginKit. Login will use FBSDKLoginBehaviorNative and will prompt the user
 Login recovery requires FBSDKLoginKit. Login will prompt the user
 for all permissions last granted. If any are declined on the new request, the recovery is not successful but
 the `[FBSDKAccessToken currentAccessToken]` might still have been updated.
 .
 */
NS_SWIFT_UNAVAILABLE("")
@interface FBSDKGraphErrorRecoveryProcessor : NSObject
/**
  Gets the delegate. Note this is a strong reference, and is nil'ed out after recovery is complete.
  Gets the delegate for the current error being processed.
 */
@property (nonatomic, strong, readonly) id<FBSDKGraphErrorRecoveryProcessorDelegate>delegate;
@property (nonatomic, weak, readonly, nullable) id<FBSDKGraphErrorRecoveryProcessorDelegate>delegate
DEPRECATED_MSG_ATTRIBUTE("FBSDKGraphErrorRecoveryProcessor's delegate will be removed in the next major version release.");
/**
  Attempts to process the error, return YES if the error can be processed.
 - Parameter error: the error to process.
 - Parameter request: the related request that may be reissued.
 - Parameter delegate: the delegate that will be retained until recovery is complete.
 @param error the error to process.
 @param request the related request that may be reissued.
 @param delegate the delegate that will be retained until recovery is complete.
 */
- (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request delegate:(id<FBSDKGraphErrorRecoveryProcessorDelegate>) delegate;
- (BOOL)processError:(NSError *)error
             request:(id<FBSDKGraphRequest>)request
            delegate:(nullable id<FBSDKGraphErrorRecoveryProcessorDelegate>)delegate;
/**
  The callback for FBSDKErrorRecoveryAttempting
 - Parameter didRecover: if the recovery succeeded
 - Parameter contextInfo: unused
 @param didRecover if the recovery succeeded
 @param contextInfo unused
 */
- (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo;
- (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(nullable void *)contextInfo
DEPRECATED_MSG_ATTRIBUTE("didPresentErrorWithRecovery:contextInfo: will be removed in the next major version release.");
@end
NS_ASSUME_NONNULL_END
#endif