Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Commit

Permalink
Revert "Updates LoginManager (#516)" (#522)
Browse files Browse the repository at this point in the history
This reverts commit 90cd224.
  • Loading branch information
joesus authored and Jak Jonnalagadda committed Sep 1, 2019
1 parent 90cd224 commit 7dc47ad
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 901 deletions.
3 changes: 2 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ disabled_rules:
- number_separator
- prefixed_toplevel_constant
- switch_case_on_newline
- file_name
# TODO: All below to move to Opt In
- discouraged_optional_boolean
- discouraged_optional_collection
Expand Down Expand Up @@ -87,6 +86,7 @@ opt_in_rules:
- empty_parentheses_with_trailing_closure
- empty_xctest_method
- explicit_init
- explicit_type_interface
- extension_access_modifier
- fallthrough
- fatal_error_message
Expand Down Expand Up @@ -119,6 +119,7 @@ opt_in_rules:
- lower_acl_than_parent
- mark
- modifier_order
- multiline_arguments
- multiline_function_chains
- multiline_parameters
- multiple_closures_with_trailing_closure
Expand Down
76 changes: 16 additions & 60 deletions FacebookSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@
81D646AF1D2C8D7800690609 /* Enums+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81D646821D2C8D7800690609 /* Enums+Extensions.swift */; };
81FC4B601D064F68003F3A46 /* LoginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81FC4B5F1D064F68003F3A46 /* LoginManager.swift */; };
81FC4C981D067448003F3A46 /* Permission.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81FC4C971D067448003F3A46 /* Permission.swift */; };
F43A7E2C2315666E00591F76 /* LoginManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F43A7E2B2315666E00591F76 /* LoginManagerTests.swift */; };
F43A7E2E2315684600591F76 /* AuthenticationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F43A7E2D2315684600591F76 /* AuthenticationService.swift */; };
F43A7E3F23156CDA00591F76 /* AuthenticationServiceSpy.swift in Sources */ = {isa = PBXBuildFile; fileRef = F43A7E3D23156CCB00591F76 /* AuthenticationServiceSpy.swift */; };
F448850F231592080000BB6C /* SampleError.swift in Sources */ = {isa = PBXBuildFile; fileRef = F448850E231592080000BB6C /* SampleError.swift */; };
F4488511231592470000BB6C /* SampleAccessToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4488510231592470000BB6C /* SampleAccessToken.swift */; };
F44885132315927B0000BB6C /* SampleLoginManagerLoginResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44885122315927B0000BB6C /* SampleLoginManagerLoginResult.swift */; };
F4488517231593580000BB6C /* LoginInformationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4488516231593580000BB6C /* LoginInformationTests.swift */; };
F44885192315958F0000BB6C /* LoginInformation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F44885182315958F0000BB6C /* LoginInformation.swift */; };
F46EC6652314BBAF00C55CA7 /* FacebookLoginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46EC6642314BBAF00C55CA7 /* FacebookLoginTests.swift */; };
F46EC6672314BBAF00C55CA7 /* FacebookLogin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 811C5DFD1CFFD36600E4A925 /* FacebookLogin.framework */; };
F46EC6742314BBBF00C55CA7 /* FacebookCoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F46EC6732314BBBF00C55CA7 /* FacebookCoreTests.swift */; };
F46EC6762314BBBF00C55CA7 /* FacebookCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8115C0D81CFE540D001FF33B /* FacebookCore.framework */; };
Expand Down Expand Up @@ -282,15 +275,8 @@
81D646821D2C8D7800690609 /* Enums+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Enums+Extensions.swift"; sourceTree = "<group>"; };
81FC4B5F1D064F68003F3A46 /* LoginManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginManager.swift; sourceTree = "<group>"; };
81FC4C971D067448003F3A46 /* Permission.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Permission.swift; sourceTree = "<group>"; };
F43A7E2B2315666E00591F76 /* LoginManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginManagerTests.swift; sourceTree = "<group>"; };
F43A7E2D2315684600591F76 /* AuthenticationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationService.swift; sourceTree = "<group>"; };
F43A7E3D23156CCB00591F76 /* AuthenticationServiceSpy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationServiceSpy.swift; sourceTree = "<group>"; };
F448850E231592080000BB6C /* SampleError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleError.swift; sourceTree = "<group>"; };
F4488510231592470000BB6C /* SampleAccessToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleAccessToken.swift; sourceTree = "<group>"; };
F44885122315927B0000BB6C /* SampleLoginManagerLoginResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleLoginManagerLoginResult.swift; sourceTree = "<group>"; };
F4488516231593580000BB6C /* LoginInformationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginInformationTests.swift; sourceTree = "<group>"; };
F44885182315958F0000BB6C /* LoginInformation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginInformation.swift; sourceTree = "<group>"; };
F46EC6622314BBAE00C55CA7 /* FacebookLoginTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FacebookLoginTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F46EC6642314BBAF00C55CA7 /* FacebookLoginTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FacebookLoginTests.swift; sourceTree = "<group>"; };
F46EC6662314BBAF00C55CA7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F46EC6712314BBBF00C55CA7 /* FacebookCoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FacebookCoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
F46EC6732314BBBF00C55CA7 /* FacebookCoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FacebookCoreTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -433,8 +419,6 @@
813C9B551D1DB16F00288BFA /* FBLoginButton.swift */,
81FC4B5F1D064F68003F3A46 /* LoginManager.swift */,
F4E214EF230718D4009656AE /* FBSDKLoginKit+Typealiases.swift */,
F43A7E2D2315684600591F76 /* AuthenticationService.swift */,
F44885182315958F0000BB6C /* LoginInformation.swift */,
);
path = Login;
sourceTree = "<group>";
Expand Down Expand Up @@ -562,24 +546,6 @@
name = ObjC;
sourceTree = "<group>";
};
F44885142315929F0000BB6C /* Samples */ = {
isa = PBXGroup;
children = (
F448850E231592080000BB6C /* SampleError.swift */,
F4488510231592470000BB6C /* SampleAccessToken.swift */,
F44885122315927B0000BB6C /* SampleLoginManagerLoginResult.swift */,
);
path = Samples;
sourceTree = "<group>";
};
F4488515231592BD0000BB6C /* Spies */ = {
isa = PBXGroup;
children = (
F43A7E3D23156CCB00591F76 /* AuthenticationServiceSpy.swift */,
);
path = Spies;
sourceTree = "<group>";
};
F46EC65A2314BB5700C55CA7 /* Tests */ = {
isa = PBXGroup;
children = (
Expand All @@ -593,11 +559,8 @@
F46EC6632314BBAF00C55CA7 /* FacebookLoginTests */ = {
isa = PBXGroup;
children = (
F46EC6642314BBAF00C55CA7 /* FacebookLoginTests.swift */,
F46EC6662314BBAF00C55CA7 /* Info.plist */,
F43A7E2B2315666E00591F76 /* LoginManagerTests.swift */,
F4488515231592BD0000BB6C /* Spies */,
F44885142315929F0000BB6C /* Samples */,
F4488516231593580000BB6C /* LoginInformationTests.swift */,
);
path = FacebookLoginTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -1082,11 +1045,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F44885192315958F0000BB6C /* LoginInformation.swift in Sources */,
813C9B561D1DB16F00288BFA /* FBLoginButton.swift in Sources */,
F4E214F0230718D4009656AE /* FBSDKLoginKit+Typealiases.swift in Sources */,
81FC4B601D064F68003F3A46 /* LoginManager.swift in Sources */,
F43A7E2E2315684600591F76 /* AuthenticationService.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -1103,12 +1064,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F448850F231592080000BB6C /* SampleError.swift in Sources */,
F43A7E3F23156CDA00591F76 /* AuthenticationServiceSpy.swift in Sources */,
F4488517231593580000BB6C /* LoginInformationTests.swift in Sources */,
F44885132315927B0000BB6C /* SampleLoginManagerLoginResult.swift in Sources */,
F43A7E2C2315666E00591F76 /* LoginManagerTests.swift in Sources */,
F4488511231592470000BB6C /* SampleAccessToken.swift in Sources */,
F46EC6652314BBAF00C55CA7 /* FacebookLoginTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1299,8 +1255,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Tests/FacebookLoginTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
INFOPLIST_FILE = FacebookLoginTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1355,8 +1311,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Tests/FacebookLoginTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
INFOPLIST_FILE = FacebookLoginTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1416,8 +1372,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Tests/FacebookCoreTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
INFOPLIST_FILE = FacebookCoreTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1472,8 +1428,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Tests/FacebookCoreTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
INFOPLIST_FILE = FacebookCoreTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1533,8 +1489,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Tests/FacebookShareTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
INFOPLIST_FILE = FacebookShareTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
Expand Down Expand Up @@ -1589,8 +1545,8 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INFOPLIST_FILE = Tests/FacebookShareTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
INFOPLIST_FILE = FacebookShareTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,7 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "F46EC6612314BBAE00C55CA7"
BuildableName = "FacebookLoginTests.xctest"
BlueprintName = "FacebookLoginTests"
ReferencedContainer = "container:FacebookSwift.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "811C5DF21CFFD36600E4A925"
BuildableName = "FacebookLogin.framework"
BlueprintName = "FacebookLogin"
ReferencedContainer = "container:FacebookSwift.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
Expand Down
34 changes: 7 additions & 27 deletions Samples/Catalog/Sources/LoginManagerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,13 @@ class LoginManagerViewController: UIViewController {
func loginManagerDidComplete(_ result: LoginResult) {
let alertController: UIAlertController
switch result {
case .success(let loginInformation):
alertController = UIAlertController(
title: "Login Success",
message: "Login succeeded with granted permissions: \(loginInformation.grantedPermissions)"
)

case .failure(let error as LoginManager.LoginManagerError):
switch error {
case .cancelled:
alertController = UIAlertController(title: "Login Cancelled", message: "User cancelled login.")
case .missingAccessToken:
alertController = UIAlertController(
title: "Missing Access Token",
message: "The response from the server was missing an access token"
)
case .missingResult:
alertController = UIAlertController(
title: "Missing Result",
message: "The response from the server was missing information"
)
}

case .failure(let error):
alertController = UIAlertController(
title: "Error",
message: "Received unexpected error: \(error)"
)
case .cancelled:
alertController = UIAlertController(title: "Login Cancelled", message: "User cancelled login.")
case .failed(let error):
alertController = UIAlertController(title: "Login Fail", message: "Login failed with error \(error)")
case .success(let grantedPermissions, _, _):
alertController = UIAlertController(title: "Login Success",
message: "Login succeeded with granted permissions: \(grantedPermissions)")
}
self.present(alertController, animated: true, completion: nil)
}
Expand Down
46 changes: 0 additions & 46 deletions Sources/Login/AuthenticationService.swift

This file was deleted.

3 changes: 1 addition & 2 deletions Sources/Login/FBSDKLoginKit+Typealiases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ public typealias LoginError = FBSDKLoginKit.LoginError
Wrapper for `FBSDKLoginKit.LoginManager`
- SeeAlso: `FBSDKLoginKit.LoginManager`
- Tag: FBSDKLoginKit.LoginManager
*/
typealias FBLoginManager = FBSDKLoginKit.LoginManager
public typealias LoginManager = FBSDKLoginKit.LoginManager

/**
Wrapper for `FBSDKLoginKit.LoginManagerLoginResult`
Expand Down
41 changes: 0 additions & 41 deletions Sources/Login/LoginInformation.swift

This file was deleted.

Loading

0 comments on commit 7dc47ad

Please sign in to comment.