Skip to content

Commit

Permalink
Deprecate system and web login behaviors (#969)
Browse files Browse the repository at this point in the history
* Fix carthage with Xcode 10.2

Summary: OHHTTPStubs has finally been updated for Xcode 10.2 compatibility; it’s been causing Carthage builds to fail if the Xcode 10.2 beta is used.

Reviewed By: codytwinton

Differential Revision: D14512664

fbshipit-source-id: 443e8c01a96678bbc9149b3bb69197eba5c7b696

* Remove System Account auth (#964)

Summary:
Pull Request resolved: #964

The System Account login behavior has not been supported for several iOS versions and is due to be removed.

Reviewed By: codytwinton, dreamolight

Differential Revision: D14492788

fbshipit-source-id: 675f044df9ebdf3a62164c9a6976f2d94ca07068

* Remove FBSDKLoginBehaviorWeb

Summary: WebViews no longer share cookies with Safari (and haven’t for some time), so it’s time for FBSDKLoginBehaviorWeb to go in favor of ASWebAuthenticationSession or SFAuthenticationSession.

Reviewed By: codytwinton

Differential Revision: D14530004

fbshipit-source-id: 20730b1d0cd65cc0c29907b2441d1933c6832ab7

* Move deprecations to separate section
  • Loading branch information
robtimp authored and codytwinton committed Mar 22, 2019
1 parent 25cf0d0 commit 684d8be
Show file tree
Hide file tree
Showing 23 changed files with 21 additions and 558 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Collections/Dictionaries became non null when at all possible
- Class creation methods become Swift inits

### Deprecated

- `FBSDKLoginBehaviorSystemAccount`
- `FBSDKLoginBehaviorWeb`
- `[FBSDKLoginManager renewSystemCredentials] `

### Removed

- Deprecated methods
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "AliSoftware/OHHTTPStubs" "826a9217fcd468220d154ed0075cbc1a20d0c5c9"
github "AliSoftware/OHHTTPStubs" "543182991a0d59db81f5b835a40901a9a386847d"
github "facebook/Tweaks" "858506f594462073a1dee82a4c8254e23d10aef0"
github "erikdoe/ocmock" "c4be5d9d9238fcd10449424f651fba2b7aff87c0"
github "facebook/xctool" "fe6fb5dfab112cfbb0a2fbda1f6a528abbe0d272"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "AliSoftware/OHHTTPStubs" "826a9217fcd468220d154ed0075cbc1a20d0c5c9"
github "AliSoftware/OHHTTPStubs" "543182991a0d59db81f5b835a40901a9a386847d"
github "BoltsFramework/Bolts-ObjC" "1b247a7047546e9eecd36387a121977b53e2ea43"
github "erikdoe/ocmock" "c4be5d9d9238fcd10449424f651fba2b7aff87c0"
github "facebook/Tweaks" "858506f594462073a1dee82a4c8254e23d10aef0"
Expand Down
2 changes: 1 addition & 1 deletion Carthage/Checkouts/OHHTTPStubs
Submodule OHHTTPStubs updated 73 files
+1 −0 .gitignore
+17 −8 .travis.yml
+30 −0 CHANGELOG.md
+0 −7 Examples/ObjC/MainViewController.m
+17 −33 Examples/ObjC/OHHTTPStubsDemo.xcodeproj/project.pbxproj
+1 −3 Examples/ObjC/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme
+1 −1 Examples/ObjC/Podfile
+11 −11 Examples/ObjC/Podfile.lock
+3 −3 Examples/ObjC/Pods/Local Podspecs/OHHTTPStubs.podspec.json
+11 −11 Examples/ObjC/Pods/Manifest.lock
+269 −254 Examples/ObjC/Pods/Pods.xcodeproj/project.pbxproj
+4 −5 Examples/ObjC/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.xcconfig
+3 −4 Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.debug.xcconfig
+3 −4 Examples/ObjC/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.release.xcconfig
+9 −2 Examples/Swift/AppDelegate.swift
+21 −21 Examples/Swift/OHHTTPStubsDemo.xcodeproj/project.pbxproj
+1 −3 Examples/Swift/OHHTTPStubsDemo.xcodeproj/xcshareddata/xcschemes/OHHTTPStubsDemo.xcscheme
+11 −11 Examples/Swift/Podfile.lock
+3 −3 Examples/Swift/Pods/Local Podspecs/OHHTTPStubs.podspec.json
+11 −11 Examples/Swift/Pods/Manifest.lock
+386 −347 Examples/Swift/Pods/Pods.xcodeproj/project.pbxproj
+1 −1 Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs-Info.plist
+4 −6 Examples/Swift/Pods/Target Support Files/OHHTTPStubs/OHHTTPStubs.xcconfig
+26 −0 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-Info.plist
+64 −13 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo-frameworks.sh
+6 −6 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.debug.xcconfig
+6 −6 Examples/Swift/Pods/Target Support Files/Pods-OHHTTPStubsDemo/Pods-OHHTTPStubsDemo.release.xcconfig
+2 −2 OHHTTPStubs.podspec
+45 −165 OHHTTPStubs/OHHTTPStubs.xcodeproj/project.pbxproj
+1 −3 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs Mac Framework.xcscheme
+1 −3 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS Framework.xcscheme
+1 −3 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs iOS StaticLib.xcscheme
+1 −3 OHHTTPStubs/OHHTTPStubs.xcodeproj/xcshareddata/xcschemes/OHHTTPStubs tvOS Framework.xcscheme
+30 −0 OHHTTPStubs/OHHTTPStubsProject.xcconfig
+1 −1 OHHTTPStubs/Podfile
+6 −2 OHHTTPStubs/Podfile.lock
+6 −2 OHHTTPStubs/Pods/Manifest.lock
+782 −958 OHHTTPStubs/Pods/Pods.xcodeproj/project.pbxproj
+5 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-c94d3492/AFNetworking-c94d3492-dummy.m
+8 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-c94d3492/AFNetworking-c94d3492-prefix.pch
+9 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-c94d3492/AFNetworking-c94d3492.xcconfig
+5 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS/AFNetworking-iOS-dummy.m
+8 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS/AFNetworking-iOS-prefix.pch
+9 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS/AFNetworking-iOS.xcconfig
+0 −5 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS7.0/AFNetworking-iOS7.0-dummy.m
+0 −15 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS7.0/AFNetworking-iOS7.0-prefix.pch
+0 −9 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS7.0/AFNetworking-iOS7.0.xcconfig
+0 −5 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS8.0/AFNetworking-iOS8.0-dummy.m
+0 −9 OHHTTPStubs/Pods/Target Support Files/AFNetworking-iOS8.0/AFNetworking-iOS8.0.xcconfig
+5 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-tvOS/AFNetworking-tvOS-dummy.m
+8 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-tvOS/AFNetworking-tvOS-prefix.pch
+9 −0 OHHTTPStubs/Pods/Target Support Files/AFNetworking-tvOS/AFNetworking-tvOS.xcconfig
+0 −5 OHHTTPStubs/Pods/Target Support Files/AFNetworking-tvOS9.0/AFNetworking-tvOS9.0-dummy.m
+0 −9 OHHTTPStubs/Pods/Target Support Files/AFNetworking-tvOS9.0/AFNetworking-tvOS9.0.xcconfig
+0 −5 ...chability-Security-Serialization/AFNetworking.root-NSURLSession-Reachability-Security-Serialization-dummy.m
+0 −9 ...hability-Security-Serialization/AFNetworking.root-NSURLSession-Reachability-Security-Serialization.xcconfig
+3 −1 ... Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests-acknowledgements.plist
+5 −4 ... Support Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests.debug.xcconfig
+5 −4 ...upport Files/Pods-TestingPods-OHHTTPStubs Mac Tests/Pods-TestingPods-OHHTTPStubs Mac Tests.release.xcconfig
+3 −1 ...ods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests-acknowledgements.plist
+5 −4 ... Files/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests.debug.xcconfig
+5 −4 ...iles/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests/Pods-TestingPods-OHHTTPStubs iOS Fmk Tests.release.xcconfig
+3 −1 ...ods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests-acknowledgements.plist
+5 −4 ... Files/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests.debug.xcconfig
+5 −4 ...iles/Pods-TestingPods-OHHTTPStubs iOS Lib Tests/Pods-TestingPods-OHHTTPStubs iOS Lib Tests.release.xcconfig
+3 −1 ...s-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests-acknowledgements.plist
+5 −4 ...iles/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests.debug.xcconfig
+5 −4 ...es/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests/Pods-TestingPods-OHHTTPStubs tvOS Fmk Tests.release.xcconfig
+25 −4 OHHTTPStubs/Sources/OHHTTPStubs.m
+10 −0 OHHTTPStubs/Sources/Swift/OHHTTPStubsSwift.swift
+73 −17 OHHTTPStubs/UnitTests/Test Suites/NSURLSessionTests.m
+2 −2 OHHTTPStubs/UnitTests/Test Suites/SwiftHelpersTests.swift
+12 −28 README.md
12 changes: 0 additions & 12 deletions FBSDKCoreKit/FBSDKCoreKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@
814AC8501D1B528900D61E6C /* FBSDKLogo.h in Headers */ = {isa = PBXBuildFile; fileRef = 893F44931A6444DF001DB0B6 /* FBSDKLogo.h */; };
814AC8511D1B528900D61E6C /* FBSDKGraphRequestMetadata.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DF2A3FD1A70572B00DFB2FD /* FBSDKGraphRequestMetadata.h */; };
814AC8521D1B528900D61E6C /* FBSDKPaymentObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0BC14A1A8D236200BE8BA4 /* FBSDKPaymentObserver.h */; };
81B71D001D19C87400933E93 /* FBSDKSystemAccountStoreAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DD696ED1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.m */; };
81B71D011D19C87400933E93 /* FBSDKGraphRequestPiggybackManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA81B281AA65FA200B9FE0B /* FBSDKGraphRequestPiggybackManager.m */; };
81B71D021D19C87400933E93 /* FBSDKAppEventsStateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0BC15E1A8D428700BE8BA4 /* FBSDKAppEventsStateManager.m */; };
81B71D031D19C87400933E93 /* FBSDKServerConfigurationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 89830F2A1A7805D100226ABB /* FBSDKServerConfigurationManager.m */; };
Expand Down Expand Up @@ -306,7 +305,6 @@
81B71D531D19C87400933E93 /* FBSDKGraphErrorRecoveryProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DD50A3A1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.h */; settings = {ATTRIBUTES = (Public, ); }; };
81B71D541D19C87400933E93 /* FBSDKMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D30292A1A65E6680086B9ED /* FBSDKMacros.h */; settings = {ATTRIBUTES = (Public, ); }; };
81B71D551D19C87400933E93 /* FBSDKBase64.h in Headers */ = {isa = PBXBuildFile; fileRef = 894C0B0F1A7021F8009137EF /* FBSDKBase64.h */; };
81B71D561D19C87400933E93 /* FBSDKSystemAccountStoreAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DD696EC1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.h */; };
81B71D571D19C87400933E93 /* FBSDKAppEventsUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0BC1591A8D427800BE8BA4 /* FBSDKAppEventsUtility.h */; };
81B71D581D19C87400933E93 /* FBSDKAppEvents+Internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0BC1531A8D23DB00BE8BA4 /* FBSDKAppEvents+Internal.h */; };
81B71D591D19C87400933E93 /* FBSDKErrorConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D3AF44E1A9EA4BE00EEF724 /* FBSDKErrorConfiguration.h */; };
Expand Down Expand Up @@ -633,8 +631,6 @@
9DD3FEE11D62454D00D35472 /* FBSDKURLSessionTask.m in Sources */ = {isa = PBXBuildFile; fileRef = EA4CF23E1D344BFC007AA2EB /* FBSDKURLSessionTask.m */; };
9DD50A3C1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DD50A3A1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.h */; settings = {ATTRIBUTES = (Public, ); }; };
9DD50A3D1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DD50A3B1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.m */; };
9DD696EE1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DD696EC1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.h */; };
9DD696EF1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DD696ED1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.m */; };
9DDC11281BEC412C00A88306 /* FBSDKIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 891687D11AB33CA200F55364 /* FBSDKIcon.m */; };
9DDC11291BEC413000A88306 /* FBSDKIcon.h in Headers */ = {isa = PBXBuildFile; fileRef = 891687D01AB33CA200F55364 /* FBSDKIcon.h */; };
9DDC112A1BEC413900A88306 /* FBSDKLogo.m in Sources */ = {isa = PBXBuildFile; fileRef = 893F44941A6444DF001DB0B6 /* FBSDKLogo.m */; };
Expand Down Expand Up @@ -1194,8 +1190,6 @@
9DC658A11A6EE7E200B85AAF /* FBSDKGraphRequestBody.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSDKGraphRequestBody.m; sourceTree = "<group>"; };
9DD50A3A1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSDKGraphErrorRecoveryProcessor.h; sourceTree = "<group>"; };
9DD50A3B1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSDKGraphErrorRecoveryProcessor.m; sourceTree = "<group>"; };
9DD696EC1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSDKSystemAccountStoreAdapter.h; sourceTree = "<group>"; };
9DD696ED1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSDKSystemAccountStoreAdapter.m; sourceTree = "<group>"; };
9DE1F3BF1A89C57A00B54D98 /* FBSDKAccessTokenCacheV3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSDKAccessTokenCacheV3.h; sourceTree = "<group>"; };
9DE1F3C01A89C57A00B54D98 /* FBSDKAccessTokenCacheV3.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSDKAccessTokenCacheV3.m; sourceTree = "<group>"; };
9DE1F3C31A89C9BE00B54D98 /* FBSDKAccessTokenCacheV3_17.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSDKAccessTokenCacheV3_17.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1465,8 +1459,6 @@
ADEA17721B7ECA1A0070EDC0 /* FBSDKMonotonicTime.m */,
9DE6C46D1AAF6E2800EC4C99 /* FBSDKProfile+Internal.h */,
9DA830421A699A2200770955 /* FBSDKSettings+Internal.h */,
9DD696EC1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.h */,
9DD696ED1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.m */,
89D05A931AA0E89B00609300 /* FBSDKTriStateBOOL.h */,
89D05A941AA0E89B00609300 /* FBSDKTriStateBOOL.m */,
C5696FA1209CCEB3009C931F /* FBSDKSwizzler.h */,
Expand Down Expand Up @@ -2059,7 +2051,6 @@
81B71D541D19C87400933E93 /* FBSDKMacros.h in Headers */,
52963A89215992F400C7B252 /* FBSDKAppLinkReturnToRefererController.h in Headers */,
81B71D551D19C87400933E93 /* FBSDKBase64.h in Headers */,
81B71D561D19C87400933E93 /* FBSDKSystemAccountStoreAdapter.h in Headers */,
81B71D571D19C87400933E93 /* FBSDKAppEventsUtility.h in Headers */,
81B71D581D19C87400933E93 /* FBSDKAppEvents+Internal.h in Headers */,
9D28F1941DB14DBB0057D709 /* FBSDKImageDownloader.h in Headers */,
Expand Down Expand Up @@ -2175,7 +2166,6 @@
9DD50A3C1A9BBA1B0088AAAA /* FBSDKGraphErrorRecoveryProcessor.h in Headers */,
9D30292B1A65E6680086B9ED /* FBSDKMacros.h in Headers */,
894C0B111A7021F8009137EF /* FBSDKBase64.h in Headers */,
9DD696EE1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.h in Headers */,
9D0BC15B1A8D427800BE8BA4 /* FBSDKAppEventsUtility.h in Headers */,
9D0BC1541A8D23DB00BE8BA4 /* FBSDKAppEvents+Internal.h in Headers */,
9D28F1931DB14DBB0057D709 /* FBSDKImageDownloader.h in Headers */,
Expand Down Expand Up @@ -2839,7 +2829,6 @@
buildActionMask = 2147483647;
files = (
EA8D50491D356BDC00622F03 /* FBSDKURLSessionTask.m in Sources */,
81B71D001D19C87400933E93 /* FBSDKSystemAccountStoreAdapter.m in Sources */,
81B71D011D19C87400933E93 /* FBSDKGraphRequestPiggybackManager.m in Sources */,
81B71D021D19C87400933E93 /* FBSDKAppEventsStateManager.m in Sources */,
81B71D031D19C87400933E93 /* FBSDKServerConfigurationManager.m in Sources */,
Expand Down Expand Up @@ -2935,7 +2924,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9DD696EF1AAADE4000838AF2 /* FBSDKSystemAccountStoreAdapter.m in Sources */,
9DA81B2A1AA65FA200B9FE0B /* FBSDKGraphRequestPiggybackManager.m in Sources */,
9D0BC1601A8D428700BE8BA4 /* FBSDKAppEventsStateManager.m in Sources */,
89830F2C1A7805D100226ABB /* FBSDKServerConfigurationManager.m in Sources */,
Expand Down
21 changes: 0 additions & 21 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphErrorRecoveryProcessor.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ - (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request deleg
case FBSDKGraphRequestErrorRecoverable :
if ([request.tokenString isEqualToString:[FBSDKAccessToken currentAccessToken].tokenString]) {
_recoveryAttempter = error.recoveryAttempter;
BOOL isLoginRecoveryAttempter = [_recoveryAttempter isKindOfClass:NSClassFromString(@"_FBSDKLoginRecoveryAttempter")];

// Set up a block to do the typical recovery work so that we can chain it for ios auth special cases.
// the block returns YES if recovery UI is started (meaning we wait for the alertviewdelegate to resume control flow).
Expand All @@ -72,26 +71,6 @@ - (BOOL)processError:(NSError *)error request:(FBSDKGraphRequest *)request deleg
return NO;
};

if ([request.tokenString isEqualToString:[FBSDKSystemAccountStoreAdapter sharedInstance].accessTokenString] &&
isLoginRecoveryAttempter) {
// special system auth case: if user has granted permissions we can simply renew. On a successful
// renew, treat this as immediately recovered without the standard alert prompty.
// (for example, this can repair expired tokens seamlessly)
[[FBSDKSystemAccountStoreAdapter sharedInstance]
renewSystemAuthorization:^(ACAccountCredentialRenewResult result, NSError *renewError) {
dispatch_async(dispatch_get_main_queue(), ^{
if (result == ACAccountCredentialRenewResultRenewed) {
[self.delegate processorDidAttemptRecovery:self didRecover:YES error:nil];
self.delegate = nil;
} else if (!standardRecoveryWork()) {
[self.delegate processorDidAttemptRecovery:self didRecover:NO error:self->_error];
};
});
}];
// short-circuit YES so that the renew callback resumes the control flow.
return YES;
}

return standardRecoveryWork();
}
return NO;
Expand Down
31 changes: 1 addition & 30 deletions FBSDKCoreKit/FBSDKCoreKit/FBSDKGraphRequestConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -793,43 +793,14 @@ - (void)processResultBody:(NSDictionary *)body error:(NSError *)error metadata:(

};

FBSDKSystemAccountStoreAdapter *adapter = [FBSDKSystemAccountStoreAdapter sharedInstance];
NSString *metadataTokenString = metadata.request.tokenString;
NSString *currentTokenString = [FBSDKAccessToken currentAccessToken].tokenString;
NSString *accountStoreTokenString = adapter.accessTokenString;
BOOL isAccountStoreLogin = [metadataTokenString isEqualToString:accountStoreTokenString];

if ([metadataTokenString isEqualToString:currentTokenString] || isAccountStoreLogin) {
if ([metadataTokenString isEqualToString:currentTokenString]) {
NSInteger errorCode = [error.userInfo[FBSDKGraphRequestErrorGraphErrorCodeKey] integerValue];
NSInteger errorSubcode = [error.userInfo[FBSDKGraphRequestErrorGraphErrorSubcodeKey] integerValue];
if (errorCode == 190 || errorCode == 102) {
if (isAccountStoreLogin) {
if (errorSubcode == 460) {
// For iOS6, when the password is changed on the server, the system account store
// will continue to issue the old token until the user has changed the
// password AND _THEN_ a renew call is made. To prevent opening
// with an old token which would immediately be closed, we tell our adapter
// that we want to force a blocking renew until success.
adapter.forceBlockingRenew = YES;
} else {
[adapter renewSystemAuthorization:^(ACAccountCredentialRenewResult result, NSError *renewError) {
NSOperationQueue *queue = self->_delegateQueue ?: [NSOperationQueue mainQueue];
[queue addOperationWithBlock:^{
clearToken(errorSubcode);
finishAndInvokeCompletionHandler();
}];
}];
return;
}
}
clearToken(errorSubcode);
} else if (errorCode >= 200 && errorCode < 300) {
// permission error
[adapter renewSystemAuthorization:^(ACAccountCredentialRenewResult result, NSError *renewError) {
NSOperationQueue *queue = self->_delegateQueue ?: [NSOperationQueue mainQueue];
[queue addOperationWithBlock:finishAndInvokeCompletionHandler];
}];
return;
}
}
#endif
Expand Down
1 change: 0 additions & 1 deletion FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKCoreKit+Internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#import "FBSDKContainerViewController.h"
#import "BridgeAPI/FBSDKBridgeAPI.h"
#import "FBSDKMonotonicTime.h"
#import "FBSDKSystemAccountStoreAdapter.h"
#import "FBSDKTriStateBOOL.h"
#import "UI/FBSDKCloseIcon.h"
#import "UI/FBSDKColor.h"
Expand Down
2 changes: 0 additions & 2 deletions FBSDKCoreKit/FBSDKCoreKitTests/FBSDKCoreKitTestUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@
*/
+ (id)mainBundleMock;

+ (id)mockAccountStoreAdapter;

@end
6 changes: 0 additions & 6 deletions FBSDKCoreKit/FBSDKCoreKitTests/FBSDKCoreKitTestUtility.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,4 @@ + (id)mainBundleMock
return mockNSBundle;
}

+ (id)mockAccountStoreAdapter
{
id mockAccountStoreAdapter = [OCMockObject partialMockForObject:[FBSDKSystemAccountStoreAdapter sharedInstance]];
[[[mockAccountStoreAdapter stub]andReturn:nil] accessTokenString];
return mockAccountStoreAdapter;
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ @interface FBSDKGraphRequestConnectionTests : XCTestCase <FBSDKGraphRequestConne
@property (nonatomic, copy) void (^requestConnectionCallback)(FBSDKGraphRequestConnection *connection, NSError *error);
@end

static id g_mockAccountStoreAdapter;
static id g_mockNSBundle;

@implementation FBSDKGraphRequestConnectionTests
Expand All @@ -51,15 +50,12 @@ + (void)setUp
{
[FBSDKSettings setAppID:@"appid"];
g_mockNSBundle = [FBSDKCoreKitTestUtility mainBundleMock];
g_mockAccountStoreAdapter = [FBSDKCoreKitTestUtility mockAccountStoreAdapter];
}

+ (void)tearDown
{
[g_mockNSBundle stopMocking];
g_mockNSBundle = nil;
[g_mockAccountStoreAdapter stopMocking];
g_mockAccountStoreAdapter = nil;
}

#pragma mark - Helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
static NSString *const kAppLinkURLString = @"http://example.com/1234567890";
static NSString *const kAppLinkURL2String = @"http://example.com/0987654321";
static NSString *const kAppLinksKey = @"app_links";
static id g_mockAccountStoreAdapter;

typedef void (^HTTPStubCallback)(NSURLRequest *request);

Expand All @@ -55,17 +54,6 @@ @implementation FBSDKAppLinkResolverTests
id _mockNSBundle;
}

+ (void)setUp
{
g_mockAccountStoreAdapter = [FBSDKCoreKitTestUtility mockAccountStoreAdapter];
}

+ (void)tearDown
{
[g_mockAccountStoreAdapter stopMocking];
g_mockAccountStoreAdapter = nil;
}

#pragma mark - HTTP stubbing helpers

- (void)stubAllResponsesWithResult:(id)result
Expand Down
4 changes: 0 additions & 4 deletions FBSDKLoginKit/FBSDKLoginKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
6B5D2DEE1A8EB1D200D3EF09 /* FBSDKLoginCompletion.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D2DEC1A8EB1D200D3EF09 /* FBSDKLoginCompletion.h */; };
6B5D2DEF1A8EB1D200D3EF09 /* FBSDKLoginCompletion.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D2DED1A8EB1D200D3EF09 /* FBSDKLoginCompletion.m */; };
6B6276341A8C1BBF0030FEBD /* FBSDKLoginUtilityTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B6276331A8C1BBF0030FEBD /* FBSDKLoginUtilityTests.m */; };
6BCDC8301A8AD43900D589BF /* FBSDKSystemAccountAuthenticationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BCDC82F1A8AD43900D589BF /* FBSDKSystemAccountAuthenticationTests.m */; };
817491551D1C6D08006E09DF /* FBSDKCoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8118B6811D0A5B9400962084 /* FBSDKCoreKit.framework */; };
818EB4251D1A283100252851 /* FBSDKLoginButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D65ACA71A803FF200E375C2 /* FBSDKLoginButton.m */; };
818EB4261D1A283100252851 /* FBSDKLoginCompletion.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D2DED1A8EB1D200D3EF09 /* FBSDKLoginCompletion.m */; };
Expand Down Expand Up @@ -254,7 +253,6 @@
6B6276331A8C1BBF0030FEBD /* FBSDKLoginUtilityTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSDKLoginUtilityTests.m; sourceTree = "<group>"; };
6BADA8CF1A9544BC00A5ADC1 /* FBSDKLoginKit+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FBSDKLoginKit+Internal.h"; sourceTree = "<group>"; };
6BAFD01F1A9531EA0096E4B5 /* FBSDKLoginCompletion+Internal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FBSDKLoginCompletion+Internal.h"; sourceTree = "<group>"; };
6BCDC82F1A8AD43900D589BF /* FBSDKSystemAccountAuthenticationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSDKSystemAccountAuthenticationTests.m; sourceTree = "<group>"; };
8118B6781D0A5B9400962084 /* FBSDKCoreKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = FBSDKCoreKit.xcodeproj; path = ../FBSDKCoreKit/FBSDKCoreKit.xcodeproj; sourceTree = "<group>"; };
812E0CFC1D23840500291B71 /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = "<group>"; };
812E0CFE1D23840500291B71 /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -551,7 +549,6 @@
6B6276321A8C1BBF0030FEBD /* FBSDKLoginUtilityTests.h */,
6B6276331A8C1BBF0030FEBD /* FBSDKLoginUtilityTests.m */,
9D641F831A7B69160048F563 /* FBSDKLoginManagerTests.m */,
6BCDC82F1A8AD43900D589BF /* FBSDKSystemAccountAuthenticationTests.m */,
9D9DB8E91A114E500086167B /* Supporting Files */,
);
path = FBSDKLoginKitTests;
Expand Down Expand Up @@ -967,7 +964,6 @@
buildActionMask = 2147483647;
files = (
9D641F841A7B69160048F563 /* FBSDKLoginManagerTests.m in Sources */,
6BCDC8301A8AD43900D589BF /* FBSDKSystemAccountAuthenticationTests.m in Sources */,
6B6276341A8C1BBF0030FEBD /* FBSDKLoginUtilityTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Loading

0 comments on commit 684d8be

Please sign in to comment.