Skip to content

Commit

Permalink
Converted FBSDKErrorFactory to Swift
Browse files Browse the repository at this point in the history
Reviewed By: joesus

Differential Revision: D39710182

fbshipit-source-id: b36e73ce7f62801ad832c912c15ef7841dd51d09
  • Loading branch information
Pablo Brizuela Guardado authored and facebook-github-bot committed Sep 22, 2022
1 parent fcb4cd4 commit f0fd22f
Show file tree
Hide file tree
Showing 56 changed files with 264 additions and 380 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>

#import "FBSDKAppLink.h"
#import "FBSDKErrorFactory+Internal.h"
#import "FBSDKErrorReporter.h"
#import "FBSDKWebViewAppLinkResolverWebViewDelegate.h"

Expand Down Expand Up @@ -71,7 +70,7 @@ @implementation FBSDKWebViewAppLinkResolver

- (instancetype)init
{
FBSDKErrorFactory *factory = [[FBSDKErrorFactory alloc] initWithReporter:FBSDKErrorReporter.shared];
FBSDKErrorFactory *factory = [FBSDKErrorFactory new];
return [self initWithSessionProvider:NSURLSession.sharedSession
errorFactory:factory];
}
Expand Down
3 changes: 1 addition & 2 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKBridgeAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#import "FBSDKBridgeAPIResponseFactory.h"
#import "FBSDKContainerViewController.h"
#import "FBSDKDynamicFrameworkLoader.h"
#import "FBSDKErrorFactory+Internal.h"
#import "FBSDKErrorReporter.h"
#import "FBSDKInternalUtility+Internal.h"
#import "FBSDKLogger+Internal.h"
Expand Down Expand Up @@ -80,7 +79,7 @@ + (FBSDKBridgeAPI *)sharedInstance
static FBSDKBridgeAPI *_sharedInstance;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
FBSDKErrorFactory *errorFactory = [[FBSDKErrorFactory alloc] initWithReporter:FBSDKErrorReporter.shared];
FBSDKErrorFactory *errorFactory = [FBSDKErrorFactory new];
_sharedInstance = [[self alloc] initWithProcessInfo:NSProcessInfo.processInfo
logger:[[FBSDKLogger alloc] initWithLoggingBehavior:FBSDKLoggingBehaviorDeveloperErrors]
urlOpener:CoreUIApplication.shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#import <UIKit/UIKit.h>

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKCoreKit/FBSDKCoreKit-Swift.h>
#import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>

#import "FBSDKApplicationLifecycleNotifications.h"
#import "FBSDKBridgeAPIRequest.h"
#import "FBSDKConstants.h"
#import "FBSDKErrorFactory+Internal.h"
#import "FBSDKErrorReporter.h"
#import "FBSDKInternalUtility+Internal.h"
#import "FBSDKPasteboard.h"
Expand Down Expand Up @@ -73,7 +73,7 @@ @implementation FBSDKBridgeAPIProtocolNativeV1

- (instancetype)initWithAppScheme:(nullable NSString *)appScheme
{
id<FBSDKErrorCreating> errorFactory = [[FBSDKErrorFactory alloc] initWithReporter:FBSDKErrorReporter.shared];
id<FBSDKErrorCreating> errorFactory = [FBSDKErrorFactory new];
return [self initWithAppScheme:appScheme
pasteboard:UIPasteboard.generalPasteboard
dataLengthThreshold:FBSDKBridgeAPIProtocolNativeV1BridgeMaxBase64DataLengthThreshold
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

#import <UIKit/UIKit.h>

#import <FBSDKCoreKit/FBSDKCoreKit-Swift.h>
#import <FBSDKCoreKit/FBSDKConstants.h>
#import <FBSDKCoreKit_Basics/FBSDKCoreKit_Basics.h>

#import "FBSDKErrorFactory+Internal.h"
#import "FBSDKErrorReporter.h"
#import "FBSDKInternalUtility+Internal.h"

Expand All @@ -28,7 +28,7 @@ @implementation FBSDKBridgeAPIProtocolWebV1

- (instancetype)init
{
FBSDKErrorFactory *factory = [[FBSDKErrorFactory alloc] initWithReporter:FBSDKErrorReporter.shared];
FBSDKErrorFactory *factory = [FBSDKErrorFactory new];
return [self initWithErrorFactory:factory internalUtility:FBSDKInternalUtility.sharedUtility];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#import "FBSDKBridgeAPIProtocolWebV2.h"

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKCoreKit/FBSDKCoreKit-Swift.h>

#import "FBSDKBridgeAPIProtocolNativeV1.h"
#import "FBSDKBridgeAPIProtocolNativeV1BridgeParameterInputKeys.h"
#import "FBSDKBridgeAPIProtocolNativeV1InputKeys.h"
#import "FBSDKErrorFactory+Internal.h"
#import "FBSDKErrorReporter.h"
#import "FBSDKInternalUtility+Internal.h"

Expand All @@ -25,7 +25,7 @@ @implementation FBSDKBridgeAPIProtocolWebV2

- (instancetype)init
{
id<FBSDKErrorCreating> errorFactory = [[FBSDKErrorFactory alloc] initWithReporter:FBSDKErrorReporter.shared];
id<FBSDKErrorCreating> errorFactory = [FBSDKErrorFactory new];
id<FBSDKBridgeAPIProtocol> nativeBridge = [[FBSDKBridgeAPIProtocolNativeV1 alloc] initWithAppScheme:nil
pasteboard:nil
dataLengthThreshold:0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ final class CoreKitComponents {
let deviceInformationProvider: _DeviceInformationProviding = _AppEventsDeviceInfo.shared
let dialogConfigurationMapBuilder: _DialogConfigurationMapBuilding = _DialogConfigurationMapBuilder()
let errorConfigurationProvider: _ErrorConfigurationProviding = _ErrorConfigurationProvider()
let errorFactory: ErrorCreating = ErrorFactory(reporter: ErrorReporter.shared)
let errorFactory: ErrorCreating = _ErrorFactory()
let errorReporter: ErrorReporting = ErrorReporter.shared
let eventDeactivationManager: _AppEventsParameterProcessing & _EventsProcessing = EventDeactivationManager()
let eventLogger: EventLogging = AppEvents.shared
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ final class CoreKitConfigurator: CoreKitConfiguring {
configureAppEventsUtility()
configureAuthenticationToken()
configureButton()
configureErrorFactory()
configureGatekeeperManager()
configureGraphRequest()
configureGraphRequestConnection()
Expand Down Expand Up @@ -136,10 +135,6 @@ private extension CoreKitConfigurator {
)
}

func configureErrorFactory() {
ErrorFactory.configure(defaultReporter: components.errorReporter)
}

func configureGatekeeperManager() {
_GateKeeperManager.configure(
settings: components.settings,
Expand Down
26 changes: 0 additions & 26 deletions FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKErrorFactory+Internal.h

This file was deleted.

176 changes: 0 additions & 176 deletions FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKErrorFactory.m

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ extension _WebDialog: DependentAsType {
static var configuredDependencies: TypeDependencies?

static var defaultDependencies: TypeDependencies? = TypeDependencies(
errorFactory: ErrorFactory(reporter: ErrorReporter.shared),
errorFactory: _ErrorFactory(),
windowFinder: InternalUtility.shared
)
}
Expand Down
Loading

0 comments on commit f0fd22f

Please sign in to comment.