From 06b201babc3fe3350174f5e086f8d6850a36ef87 Mon Sep 17 00:00:00 2001 From: Nicolas Gomollon Date: Mon, 9 Mar 2020 11:49:26 -0700 Subject: [PATCH] Fixed twitter-archive#120 --- TwitterCore/TwitterCore.podspec | 4 +- TwitterKit/TwitterKit.podspec | 6 +- .../TwitterKit.xcodeproj/project.pbxproj | 19 +-- .../Social/Identity/TWTRWebViewController.h | 38 ------ .../Social/Identity/TWTRWebViewController.m | 123 ------------------ .../TWTRWebAuthenticationViewController.h | 2 +- .../TWTRWebAuthenticationViewController.m | 30 +---- ...TWTRWebAuthenticationViewControllerTests.m | 10 -- .../Identity/TWTRWebViewControllerTests.m | 95 -------------- 9 files changed, 11 insertions(+), 316 deletions(-) delete mode 100644 TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.h delete mode 100644 TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.m delete mode 100644 TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebViewControllerTests.m diff --git a/TwitterCore/TwitterCore.podspec b/TwitterCore/TwitterCore.podspec index 3b361a02..51469885 100644 --- a/TwitterCore/TwitterCore.podspec +++ b/TwitterCore/TwitterCore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TwitterCore" - s.version = "3.2.3" + s.version = "3.2.4" s.summary = "Increase user engagement and app growth." s.license = { :type => "Commercial", :text => "Copyright Twitter, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Twitter Kit Agreement located at https://dev.twitter.com/overview/terms/twitterkit and the Developer Agreement located at https://dev.twitter.com/overview/terms/agreement. OSS: https://github.com/twitter/twitter-kit-ios/blob/master/OS_LICENSES.md" } s.homepage = "https://github.com/twitter/twitter-kit-ios" @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.social_media_url = "https://twitter.com/TwitterDev" s.authors = "Twitter" s.platform = :ios, "9.0" - s.source = { :git => 'https://github.com/Xempire/twitter-kit-ios.git', :tag => "v3.4.5" } + s.source = { :git => 'https://github.com/Xempire/twitter-kit-ios.git', :tag => "v3.4.6" } s.prefix_header_file = "TwitterCore/TwitterCore/Supporting Files/TwitterCore-Prefix.pch" s.public_header_files = "TwitterCore/TwitterCore-dynamic/TwitterCore.h", "TwitterCore/TwitterCore/Supporting Files/TWTRDefines.h", "TwitterCore/TwitterCore/TWTRConstants.h", "TwitterCore/TwitterCore/Identity/TWTRCoreOAuthSigning.h", "TwitterCore/TwitterCore/Identity/TWTRGuestSession.h", "TwitterCore/TwitterCore/Identity/TWTRSession.h", "TwitterCore/TwitterCore/Identity/V2/TWTRSessionStore.h", "TwitterCore/TwitterCore/Networking/TWTRAuthConfig.h", "TwitterCore/TwitterCore/Networking/TWTRAuthSession.h", "TwitterCore/TwitterCore/Networking/API/TWTRAPIErrorCode.h", "TwitterCore/TwitterCore/Utilities/TWTRColorUtil.h" s.private_header_files = "TwitterCore/TwitterCore/TWTRCoreConstants.h", "TwitterCore/TwitterCore/Analytics/TWTRIdentifier.h", "TwitterCore/TwitterCore/Analytics/TWTRUserSessionVerifier.h", "TwitterCore/TwitterCore/Identity/TWTRAppAuthProvider.h", "TwitterCore/TwitterCore/Identity/TWTRAppleSocialAuthenticaticationProvider.h", "TwitterCore/TwitterCore/Identity/TWTRAuthenticationConstants.h", "TwitterCore/TwitterCore/Identity/TWTRAuthenticationProvider_Private.h", "TwitterCore/TwitterCore/Identity/TWTRAuthenticationProvider.h", "TwitterCore/TwitterCore/Identity/TWTRAuthenticator.h", "TwitterCore/TwitterCore/Identity/TWTRCoreOAuthSigning+Private.h", "TwitterCore/TwitterCore/Identity/TWTRGenericKeychainItem.h", "TwitterCore/TwitterCore/Identity/TWTRGuestAuthProvider.h", "TwitterCore/TwitterCore/Identity/TWTRSecItemWrapper.h", "TwitterCore/TwitterCore/Identity/TWTRSession_Private.h", "TwitterCore/TwitterCore/Identity/TWTRSessionMigrating.h", "TwitterCore/TwitterCore/Identity/TWTRTokenOnlyAuthSession.h", "TwitterCore/TwitterCore/Identity/V2/TWTRGuestAuthRequestSigner.h", "TwitterCore/TwitterCore/Identity/V2/TWTRSessionRefreshStrategy.h", "TwitterCore/TwitterCore/Identity/V2/TWTRSessionStore_Private.h", "TwitterCore/TwitterCore/Identity/V2/TWTRUserAuthRequestSigner.h", "TwitterCore/TwitterCore/Networking/TWTRAPINetworkErrorsShim.h", "TwitterCore/TwitterCore/Networking/TWTRAPIServiceConfig.h", "TwitterCore/TwitterCore/Networking/TWTRAPIServiceConfigRegistry.h", "TwitterCore/TwitterCore/Networking/TWTRAppAPIClient.h", "TwitterCore/TwitterCore/Networking/TWTRAuthConfigSessionsValidator.h", "TwitterCore/TwitterCore/Networking/TWTRAuthConfigSessionsValidator_Private.h", "TwitterCore/TwitterCore/Networking/TWTRAuthConfigStore.h", "TwitterCore/TwitterCore/Networking/TWTRMultipartFormDocument.h", "TwitterCore/TwitterCore/Networking/TWTRNetworking.h", "TwitterCore/TwitterCore/Networking/TWTRNetworkingConstants.h", "TwitterCore/TwitterCore/Networking/TWTRNetworkingUtil.h", "TwitterCore/TwitterCore/Networking/TWTRUserAPIClient.h", "TwitterCore/TwitterCore/Networking/API/TWTRAPIConstants.h", "TwitterCore/TwitterCore/Networking/API/TWTRAPIConstantsUser.h", "TwitterCore/TwitterCore/Networking/Pipeline/TWTRAPIConstantsUser.h", "TwitterCore/TwitterCore/Networking/Pipeline/TWTRNetworkingPipeline.h", "TwitterCore/TwitterCore/Networking/Pipeline/TWTRNetworkingPipelinePackage.h", "TwitterCore/TwitterCore/Networking/Pipeline/TWTRNetworkingPipelineQueue.h", "TwitterCore/TwitterCore/Networking/Pipeline/TWTRRequestSigningOperation.h", "TwitterCore/TwitterCore/Networking/Pipeline/TWTRURLSessionDelegate.h", "TwitterCore/TwitterCore/Networking/ThirdParty/TWTRGCOAuth.h", "TwitterCore/TwitterCore/Resources/TWTRAppInstallationUUID.h", "TwitterCore/TwitterCore/Utilities/TWTRAssertionMacros.h", "TwitterCore/TwitterCore/Utilities/TWTRDateFormatters.h", "TwitterCore/TwitterCore/Utilities/TWTRDateFormatters_Private.h", "TwitterCore/TwitterCore/Utilities/TWTRDateUtil.h", "TwitterCore/TwitterCore/Utilities/TWTRDictUtil.h", "TwitterCore/TwitterCore/Utilities/TWTRKeychainWrapper.h", "TwitterCore/TwitterCore/Utilities/TWTRKeychainWrapper_Private.h", "TwitterCore/TwitterCore/Utilities/TWTRMultiThreadUtil.h", "TwitterCore/TwitterCore/Utilities/TWTRUtils.h" diff --git a/TwitterKit/TwitterKit.podspec b/TwitterKit/TwitterKit.podspec index 8fbd1168..7f59a6f1 100644 --- a/TwitterKit/TwitterKit.podspec +++ b/TwitterKit/TwitterKit.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "TwitterKit" - s.version = "3.4.5" + s.version = "3.4.6" s.summary = "Increase user engagement and app growth." s.license = { :type => "Commercial", :text => "Twitter Kit: Copyright Twitter, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Twitter Kit Agreement located at https://dev.twitter.com/overview/terms/twitterkit and the Developer Agreement located at https://dev.twitter.com/overview/terms/agreement. OSS: https://github.com/twitter/twitter-kit-ios/blob/master/OS_LICENSES.md"} s.homepage = "https://github.com/twitter/twitter-kit-ios" @@ -8,12 +8,12 @@ Pod::Spec.new do |s| s.social_media_url = "https://twitter.com/TwitterDev" s.authors = "Twitter" s.platform = :ios, "9.0" - s.source = { :git => 'https://github.com/Xempire/twitter-kit-ios.git', :tag => "v3.4.5" } + s.source = { :git => 'https://github.com/Xempire/twitter-kit-ios.git', :tag => "v3.4.6" } s.prefix_header_file = "TwitterKit/TwitterKit/Supporting Files/TwitterKit-Prefix.pch" s.public_header_files = "TwitterKit/TwitterKit/TWTRKit.h", "TwitterKit/TwitterKit/TWTRTwitter.h", "TwitterKit/TwitterKit/Networking/TWTRCollectionTimelineDataSource.h", "TwitterKit/TwitterKit/Networking/TWTRListTimelineDataSource.h", "TwitterKit/TwitterKit/Networking/TWTRSearchTimelineDataSource.h", "TwitterKit/TwitterKit/Networking/TWTRTimelineDataSource.h", "TwitterKit/TwitterKit/Networking/TWTRTimelineFilter.h", "TwitterKit/TwitterKit/Networking/TWTRUserTimelineDataSource.h", "TwitterKit/TwitterKit/Social/Identity/TWTRLogInButton.h", "TwitterKit/TwitterKit/Social/Identity/TWTROAuthSigning.h", "TwitterKit/TwitterKit/Social/Identity/API Client/TWTRAPIClient.h", "TwitterKit/TwitterKit/Social/Syndication/API/TWTRTimelineCursor.h", "TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRComposer.h", "TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRComposerViewController.h", "TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRTimelineDelegate.h", "TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRTimelineViewController.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRJSONConvertible.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRMediaEntitySize.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRTimelineType.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRTweet.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRTweetCashtagEntity.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRTweetEntity.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRTweetHashtagEntity.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRTweetUrlEntity.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRTweetUserMentionEntity.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRUser.h", "TwitterKit/TwitterKit/Social/Syndication/Models/TWTRVideoMetaData.h", "TwitterKit/TwitterKit/Social/Syndication/Notifications/TWTRNotificationConstants.h", "TwitterKit/TwitterKit/Social/Syndication/Views/TWTRTweetTableViewCell.h", "TwitterKit/TwitterKit/Social/Syndication/Views/TWTRTweetView.h", "TwitterKit/TwitterKit/Social/Syndication/Views/TWTRTweetViewDelegate.h", "TwitterKit/TwitterKit/Social/Syndication/Views/TWTRVideoPlaybackState.h" s.private_header_files = "TwitterKit/TwitterKit/Supporting Files/TWTRConstants_Private.h", "TwitterKit/TwitterKit/Social/Syndication/Utilities/TWTRDateFormatter.h" s.source_files = "TwitterKit/TwitterKit/*.{h,m}", "TwitterKit/TwitterKit/External/Punycode Cocoa/Pod/*.{h,m}", "TwitterKit/TwitterKit/Networking/*.{h,m}", "TwitterKit/TwitterKit/Persistence/*.{h,m}", "TwitterKit/TwitterKit/Resources/*.{h,m}", "TwitterKit/TwitterKit/Social/**/*.{h,m}", "TwitterKit/TwitterKit/Supporting Files/*.{h,m}", "TwitterKit/TwitterKit/TwitterShareExtensionUI/**/*.{h,m}", "TwitterKit/libextobjc/*.{h,m}" s.resources = ["TwitterKit/TwitterKitResources.bundle"] s.frameworks = "CoreText", "QuartzCore", "CoreData", "CoreGraphics", "Foundation", "Security", "UIKit", "CoreMedia", "AVFoundation", "SafariServices" - s.dependency "TwitterCore", ">= 3.2.3" + s.dependency "TwitterCore", ">= 3.2.4" end diff --git a/TwitterKit/TwitterKit.xcodeproj/project.pbxproj b/TwitterKit/TwitterKit.xcodeproj/project.pbxproj index 16cac24d..4b60ecf8 100644 --- a/TwitterKit/TwitterKit.xcodeproj/project.pbxproj +++ b/TwitterKit/TwitterKit.xcodeproj/project.pbxproj @@ -375,7 +375,6 @@ 92B9AC9119DF359D00E8BC68 /* UserWithEmailResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 92B9AC9019DF359D00E8BC68 /* UserWithEmailResponse.json */; }; 92B9AC9319DF388E00E8BC68 /* UserWithEmptyEmailResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 92B9AC9219DF388E00E8BC68 /* UserWithEmptyEmailResponse.json */; }; 92B9AC9519DF392E00E8BC68 /* UserWithNullEmailResponse.json in Resources */ = {isa = PBXBuildFile; fileRef = 92B9AC9419DF392E00E8BC68 /* UserWithNullEmailResponse.json */; }; - 99C96FBF19E4A7E100AF2304 /* TWTRWebViewControllerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 99C96FBE19E4A7E100AF2304 /* TWTRWebViewControllerTests.m */; }; 9D0AE5A91AC7359D00884B45 /* TWTRDateFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D0AE5A71AC7359D00884B45 /* TWTRDateFormatter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 9D0AE5AA1AC7359D00884B45 /* TWTRDateFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0AE5A81AC7359D00884B45 /* TWTRDateFormatter.m */; }; 9D0AE5AC1AC736C300884B45 /* TWTRDateFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9D0AE5AB1AC736C300884B45 /* TWTRDateFormatterTests.m */; }; @@ -394,7 +393,6 @@ A966541518EB687000B61CEE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A97654F618E0B29B00E25169 /* XCTest.framework */; }; A966541618EB687000B61CEE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A97654E818E0B29B00E25169 /* Foundation.framework */; }; A97654E918E0B29B00E25169 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A97654E818E0B29B00E25169 /* Foundation.framework */; }; - A976554418E0B45400E25169 /* TWTRWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A976552F18E0B45400E25169 /* TWTRWebViewController.m */; }; A9A7FF0E18E4AAA8008334E6 /* TWTRTwitter.h in Headers */ = {isa = PBXBuildFile; fileRef = A9A7FF0C18E4AAA8008334E6 /* TWTRTwitter.h */; settings = {ATTRIBUTES = (Public, ); }; }; A9A7FF0F18E4AAA8008334E6 /* TWTRTwitter.m in Sources */ = {isa = PBXBuildFile; fileRef = A9A7FF0D18E4AAA8008334E6 /* TWTRTwitter.m */; }; A9A955B919903E5E0074867E /* TWTRTwitter_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A9A955B819903E5E0074867E /* TWTRTwitter_Private.h */; }; @@ -526,8 +524,6 @@ BFE839921ADF287A0035CBA1 /* TWTRAPIClient_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3E0C37199440AF00E0C667 /* TWTRAPIClient_Private.h */; }; BFE839941ADF287E0035CBA1 /* TWTRAPIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D3CD7D81951202900FD6B72 /* TWTRAPIClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; BFE839961ADF28880035CBA1 /* TWTRLogInButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B154E1119CB5DE500B6B64C /* TWTRLogInButton.h */; settings = {ATTRIBUTES = (Public, ); }; }; - BFE839A01ADF28A40035CBA1 /* TWTRWebViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A976552E18E0B45400E25169 /* TWTRWebViewController.h */; }; - BFE839A11ADF28A50035CBA1 /* TWTRWebViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = A976552E18E0B45400E25169 /* TWTRWebViewController.h */; }; BFE839A31ADF28AC0035CBA1 /* TWTRSystemAccountSerializer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DE7F1AE1ACCAF720029CE5A /* TWTRSystemAccountSerializer.h */; }; BFE839A41ADF28AF0035CBA1 /* TWTRTwitter_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A9A955B819903E5E0074867E /* TWTRTwitter_Private.h */; }; BFE839A51ADF28B20035CBA1 /* TWTRTwitter.h in Headers */ = {isa = PBXBuildFile; fileRef = A9A7FF0C18E4AAA8008334E6 /* TWTRTwitter.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -1096,7 +1092,6 @@ 92B9AC9019DF359D00E8BC68 /* UserWithEmailResponse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; lineEnding = 0; path = UserWithEmailResponse.json; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.javascript; }; 92B9AC9219DF388E00E8BC68 /* UserWithEmptyEmailResponse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; lineEnding = 0; path = UserWithEmptyEmailResponse.json; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.javascript; }; 92B9AC9419DF392E00E8BC68 /* UserWithNullEmailResponse.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; lineEnding = 0; path = UserWithNullEmailResponse.json; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.javascript; }; - 99C96FBE19E4A7E100AF2304 /* TWTRWebViewControllerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWTRWebViewControllerTests.m; sourceTree = ""; }; 9D0AE5A71AC7359D00884B45 /* TWTRDateFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWTRDateFormatter.h; sourceTree = ""; }; 9D0AE5A81AC7359D00884B45 /* TWTRDateFormatter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWTRDateFormatter.m; sourceTree = ""; }; 9D0AE5AB1AC736C300884B45 /* TWTRDateFormatterTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWTRDateFormatterTests.m; sourceTree = ""; }; @@ -1114,8 +1109,6 @@ A97654E518E0B29B00E25169 /* libTwitterKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTwitterKit.a; sourceTree = BUILT_PRODUCTS_DIR; }; A97654E818E0B29B00E25169 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; A97654F618E0B29B00E25169 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - A976552E18E0B45400E25169 /* TWTRWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWTRWebViewController.h; sourceTree = ""; }; - A976552F18E0B45400E25169 /* TWTRWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TWTRWebViewController.m; sourceTree = ""; }; A9A7FF0C18E4AAA8008334E6 /* TWTRTwitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = TWTRTwitter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; A9A7FF0D18E4AAA8008334E6 /* TWTRTwitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = TWTRTwitter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; A9A955B819903E5E0074867E /* TWTRTwitter_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TWTRTwitter_Private.h; sourceTree = ""; }; @@ -2134,8 +2127,6 @@ DB09089A1B6057E200FE4CD3 /* TWTRSessionMigrator.m */, 9DE7F1AE1ACCAF720029CE5A /* TWTRSystemAccountSerializer.h */, 9DE7F1AF1ACCAF720029CE5A /* TWTRSystemAccountSerializer.m */, - A976552E18E0B45400E25169 /* TWTRWebViewController.h */, - A976552F18E0B45400E25169 /* TWTRWebViewController.m */, 3D45D6E31B9F7CAA00087F30 /* TWTRCookieStorageUtil.h */, 3D45D6E41B9F7CAA00087F30 /* TWTRCookieStorageUtil.m */, 373F514F1E9EF62600B37C86 /* TWTRMobileSSO.h */, @@ -2211,7 +2202,6 @@ BF8EF2DE1AFD4F65008B4829 /* TWTRSessionTests.m */, 3DCC41931B6B657800A08C7D /* TWTRTestSessionStore.h */, 3DCC41941B6B657800A08C7D /* TWTRTestSessionStore.m */, - 99C96FBE19E4A7E100AF2304 /* TWTRWebViewControllerTests.m */, 3D45D6FF1B9F8E7100087F30 /* TWTRCookieStorageUtilTests.m */, 3754A6471CCACAFD0044E159 /* TWTRLoginURLParserTests.m */, ); @@ -2785,7 +2775,6 @@ 3DF8F0551B1F630B00FAF579 /* TWTRImageLoaderCache.h in Headers */, 37F194781BB1D2F100703E53 /* TWTRRetweetView.h in Headers */, 3283C12319522F9A007FBF38 /* TWTRTweetUrlEntity.h in Headers */, - BFE839A01ADF28A40035CBA1 /* TWTRWebViewController.h in Headers */, AAF0C9DF2011991B0057F438 /* TWTRSEAccountTableViewCell.h in Headers */, 3DF8F0601B1F9BFF00FAF579 /* TWTRImageLoaderImageUtils.h in Headers */, DB9129741B8E3D5600AC397E /* TWTRWebAuthenticationTokenRequestor.h in Headers */, @@ -2818,7 +2807,6 @@ DB610F2D1CAC6A8D006F93E0 /* TWTRTweetCashtagEntity.h in Headers */, DB01619B1C87931500B329AD /* TWTRTweetDelegationHelper.h in Headers */, 3D6B3F1B1C91F9CC0087B8ED /* TWTRMoPubAdConfiguration.h in Headers */, - BFE839A11ADF28A50035CBA1 /* TWTRWebViewController.h in Headers */, 3DFAD0301B33991E0076E10A /* TWTRListTimelineDataSource.h in Headers */, DB52BC681B98ED22001715A4 /* TWTRTwitterTextEntity.h in Headers */, BFE839831ADF24CD0035CBA1 /* TWTRKit.h in Headers */, @@ -2978,6 +2966,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ko, ja, @@ -3190,7 +3179,6 @@ DB811E5E1C519CAF00A1F453 /* TWTRValueTransformersTests.m in Sources */, 374306A01B45ADC000D7C540 /* TWTRShareButtonTests.m in Sources */, 3DCC41961B6B657800A08C7D /* TWTRTestSessionStore.m in Sources */, - 99C96FBF19E4A7E100AF2304 /* TWTRWebViewControllerTests.m in Sources */, 3DC0C1171C63484E00F5DACA /* TWTRMoPubAdConfigurationTests.m in Sources */, 378E40A3198C129200EE3364 /* TWTRTableViewCellTests.m in Sources */, 37FBC2AF1B4DC67C006949E9 /* TWTRLikeButtonTests.m in Sources */, @@ -3352,7 +3340,6 @@ AAF0C9B62011991B0057F438 /* TWTRSETweetShareNavigationController.m in Sources */, 3D682B4A18E25A1300145716 /* TWTRTweet.m in Sources */, 3D5AD57B1CC06F2700239BBE /* TWTRMoPubVersionChecker.m in Sources */, - A976554418E0B45400E25169 /* TWTRWebViewController.m in Sources */, 3785414919AFE97E00789130 /* TWTRURLUtility.m in Sources */, AAF0C9BF2011991B0057F438 /* TWTRSEConfigurationSelectionTableViewCell.m in Sources */, 377AF9351E7A0359004099F9 /* TWTRSharedComposerWrapper.m in Sources */, @@ -3454,7 +3441,7 @@ SDKROOT = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "TwitterKitTests/TwitterKit Tests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; WRAPPER_EXTENSION = xctest; }; name = Debug; @@ -3473,7 +3460,7 @@ SDKROOT = iphoneos; SWIFT_OBJC_BRIDGING_HEADER = "TwitterKitTests/TwitterKit Tests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; WRAPPER_EXTENSION = xctest; }; name = Release; diff --git a/TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.h b/TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.h deleted file mode 100644 index b61476ca..00000000 --- a/TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2017 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -/** - This header is private to the Twitter Kit SDK and not exposed for public SDK consumption - */ - -#import - -@class TWTRWebViewController; - -typedef BOOL (^TWTRWebViewControllerShouldLoadCompletion)(UIViewController *controller, NSURLRequest *request, UIWebViewNavigationType navigationType); -typedef void (^TWTRWebViewControllerCancelCompletion)(TWTRWebViewController *webViewController); -typedef void (^TWTRWebViewControllerHandleError)(NSError *error); - -@interface TWTRWebViewController : UIViewController - -@property (nonatomic, strong) NSURLRequest *request; -@property (nonatomic, copy) TWTRWebViewControllerShouldLoadCompletion shouldStartLoadWithRequest; -@property (nonatomic, copy) TWTRWebViewControllerHandleError errorHandler; - -- (void)enableCancelButtonWithCancelCompletion:(TWTRWebViewControllerCancelCompletion)cancelCompletion; - -@end diff --git a/TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.m b/TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.m deleted file mode 100644 index 9fc6101a..00000000 --- a/TwitterKit/TwitterKit/Social/Identity/TWTRWebViewController.m +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2017 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#import "TWTRWebViewController.h" -#import - -@interface TWTRWebViewController () - -@property (nonatomic, strong) UIWebView *webView; -@property (nonatomic, assign) BOOL showCancelButton; -@property (nonatomic, copy) TWTRWebViewControllerCancelCompletion cancelCompletion; - -@end - -@implementation TWTRWebViewController - -- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil -{ - self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; - if (self) { - // Custom initialization - } - return self; -} - -- (void)viewDidLoad -{ - [super viewDidLoad]; - // Do any additional setup after loading the view. - [self setTitle:@"Twitter"]; - if ([self showCancelButton]) { - [[self navigationItem] setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancel)]]; - } - [self load]; -} - -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -#pragma mark - Interface implementations - -- (void)load -{ - [[self webView] loadRequest:[self request]]; -} - -#pragma mark - View controller lifecycle - -- (void)loadView -{ - [self setWebView:[[UIWebView alloc] init]]; - [[self webView] setScalesPageToFit:YES]; - [[self webView] setDelegate:self]; - [self setView:[self webView]]; -} - -#pragma mark - UIWebview delegate - -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType -{ - if (![self whitelistedDomain:request]) { - // Open in Safari if request is not whitelisted - NSLog(@"Opening link in Safari browser, as the host is not whitelisted: %@", request.URL); - [[UIApplication sharedApplication] openURL:request.URL]; - return NO; - } - if ([self shouldStartLoadWithRequest]) { - return [self shouldStartLoadWithRequest](self, request, navigationType); - } - return YES; -} - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error -{ - if (self.errorHandler) { - self.errorHandler(error); - self.errorHandler = nil; - } -} - -#pragma mark - Internal methods - -- (BOOL)whitelistedDomain:(NSURLRequest *)request -{ - NSString *whitelistedHostWildcard = [@"." stringByAppendingString:TWTRTwitterDomain]; - NSURL *url = request.URL; - NSString *host = url.host; - return ([host isEqualToString:TWTRTwitterDomain] || [host hasSuffix:whitelistedHostWildcard] || ([TWTRSDKScheme isEqualToString:url.scheme] && [TWTRSDKRedirectHost isEqualToString:host])); -} - -- (void)cancel -{ - if ([self cancelCompletion]) { - [self cancelCompletion](self); - self.cancelCompletion = nil; - } -} - -- (void)enableCancelButtonWithCancelCompletion:(TWTRWebViewControllerCancelCompletion)cancelCompletion -{ - NSAssert([self isViewLoaded] == NO, @"This method must be called before the view controller is presented"); - [self setShowCancelButton:YES]; - [self setCancelCompletion:cancelCompletion]; -} - -@end diff --git a/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.h b/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.h index ab86d091..26f75453 100644 --- a/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.h +++ b/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.h @@ -33,7 +33,7 @@ typedef void (^TWTRWebAuthenticationViewControllerCompletion)(TWTRSession *_Null @property (nonatomic, copy) TWTRWebAuthenticationViewControllerCompletion completion; /* - * Initialize either a WebViewController or SFSafariViewController based on existing session in TWTRSessionStore. + * Initialize an SFSafariViewController based on existing session in TWTRSessionStore. */ - (instancetype)initWithAuthenticationToken:(NSString *)token authConfig:(TWTRAuthConfig *)authConfig APIServiceConfig:(id)serviceConfig hasExistingSession:(BOOL)hasExistingSession; diff --git a/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.m b/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.m index e4e5204c..2c867976 100644 --- a/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.m +++ b/TwitterKit/TwitterKit/Social/Syndication/Controllers/TWTRWebAuthenticationViewController.m @@ -29,7 +29,6 @@ #import "TWTRErrors.h" #import "TWTRLoginURLParser.h" #import "TWTRTwitter_Private.h" -#import "TWTRWebViewController.h" @interface TWTRWebAuthenticationViewController () @@ -78,12 +77,8 @@ - (void)viewDidLoad - (UIViewController *)webController { - if (_useWebFlow) { - return [self webViewController]; - } else { - [self.navigationController setNavigationBarHidden:YES]; - return [self safariViewController]; - } + [self.navigationController setNavigationBarHidden:YES]; + return [self safariViewController]; } - (SFSafariViewController *)safariViewController @@ -93,27 +88,6 @@ - (SFSafariViewController *)safariViewController return safariVC; } -- (TWTRWebViewController *)webViewController -{ - TWTRWebViewController *webVC = [[TWTRWebViewController alloc] init]; - webVC.request = [NSURLRequest requestWithURL:self.authURL]; - - @weakify(self) webVC.errorHandler = ^(NSError *error) { - @strongify(self)[self failWithError:error]; - }; - - webVC.shouldStartLoadWithRequest = ^BOOL(UIViewController *controller, NSURLRequest *request, UIWebViewNavigationType navType) { - @strongify(self) NSURL *URL = request.URL; - if ([TWTRSDKScheme isEqualToString:URL.scheme] && [TWTRSDKRedirectHost isEqualToString:URL.host]) { - [self handleTwitterRedirectRequest:request]; - return NO; - } - return YES; - }; - - return webVC; -} - - (void)embedViewController:(UIViewController *)controller { controller.view.frame = self.view.bounds; diff --git a/TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebAuthenticationViewControllerTests.m b/TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebAuthenticationViewControllerTests.m index e413d189..6df8e578 100644 --- a/TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebAuthenticationViewControllerTests.m +++ b/TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebAuthenticationViewControllerTests.m @@ -26,7 +26,6 @@ #import "TWTRTwitter.h" #import "TWTRTwitter_Private.h" #import "TWTRWebAuthenticationViewController.h" -#import "TWTRWebViewController.h" @interface TWTRWebAuthenticationViewControllerTests : XCTestCase @@ -83,15 +82,6 @@ - (void)testScheme_callAuthenticate #pragma mark - Embedded View Controllers -- (void)testEmbededViewController_isWebViewController -{ - self.controller = [[TWTRWebAuthenticationViewController alloc] initWithAuthenticationToken:@"token23" authConfig:self.sessionStore.authConfig APIServiceConfig:self.sessionStore.APIServiceConfig hasExistingSession:YES]; - [self.controller view]; - - UIViewController *embeddedViewController = [[self.controller childViewControllers] firstObject]; - XCTAssertEqual([embeddedViewController class], [TWTRWebViewController class]); -} - - (void)testEmbededViewController_isSafariViewController { self.controller = [[TWTRWebAuthenticationViewController alloc] initWithAuthenticationToken:@"token23" authConfig:self.sessionStore.authConfig APIServiceConfig:self.sessionStore.APIServiceConfig hasExistingSession:NO]; diff --git a/TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebViewControllerTests.m b/TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebViewControllerTests.m deleted file mode 100644 index fbbd46b1..00000000 --- a/TwitterKit/TwitterKitTests/SocialTests/Identity/TWTRWebViewControllerTests.m +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2017 Twitter, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -#import -#import "TWTRTestCase.h" -#import "TWTRWebViewController.h" - -@interface TWTRWebViewController () - -@property (nonatomic, readonly) UIWebView *webView; - -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; - -@end - -@interface TWTRWebViewControllerTests : TWTRTestCase - -@property (nonatomic) TWTRWebViewController *webVC; - -@end - -@implementation TWTRWebViewControllerTests - -- (void)setUp -{ - [super setUp]; - TWTRWebViewControllerShouldLoadCompletion shouldLoadCompletion = ^BOOL(UIViewController *controller, NSURLRequest *urlRequest, UIWebViewNavigationType navType) { - return YES; - }; - self.webVC = [[TWTRWebViewController alloc] init]; - [self.webVC setShouldStartLoadWithRequest:shouldLoadCompletion]; -} - -- (void)testShouldStartLoadWithRequest_returnsYESForWhitelistedDomain -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://twitter.com/test"]]; - XCTAssert([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} - -- (void)testShouldStartLoadWithRequest_returnsYESForWhitelistedSubDomain -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://lol.twitter.com/test"]]; - XCTAssert([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} - -- (void)testShouldStartLoadWithRequest_returnsYESForWhitelistedScheme -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"twittersdk://callback"]]; - XCTAssert([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} - -- (void)testShouldStartLoadWithRequest_returnsNOForHackySchemeInQuery -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://lolp0wnedtwitter.com/twittersdk://callback"]]; - XCTAssertFalse([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} - -- (void)testShouldStartLoadWithRequest_returnsNOForHackyScheme -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"abctwittersdk://callback"]]; - XCTAssertFalse([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} - -- (void)testShouldStartLoadWithRequest_returnsNOForHackyCleverLOLDomain -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://lolp0wnedtwitter.com/test"]]; - XCTAssertFalse([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} - -- (void)testShouldStartLoadWithRequest_returnsYESForWhitelistedDomainButHackyQuery -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://twitter.com/test?query=twitter.com"]]; - XCTAssert([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} - -- (void)testShouldStartLoadWithRequest_returnsNOForNonWhitelistedDomain -{ - NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://google.com/test"]]; - XCTAssertFalse([self.webVC webView:nil shouldStartLoadWithRequest:request navigationType:0]); -} -@end