diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0635f94 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "Deps/gtm-session-fetcher"] + path = Deps/gtm-session-fetcher + url = https://github.com/google/gtm-session-fetcher.git + branch = master diff --git a/Deps/README.md b/Deps/README.md new file mode 100644 index 0000000..c8e6d96 --- /dev/null +++ b/Deps/README.md @@ -0,0 +1,6 @@ +This directory contains git submodules for the other projects that this project +depends on. + +It is mainly here for the samples. Using this module via CocoaPods will directly +pull in the dependencies. + diff --git a/Deps/gtm-session-fetcher b/Deps/gtm-session-fetcher new file mode 160000 index 0000000..d001d7d --- /dev/null +++ b/Deps/gtm-session-fetcher @@ -0,0 +1 @@ +Subproject commit d001d7db238a8bc11d122b65382e50651f62d1e8 diff --git a/Examples/OAuth2Sample/OAuth2Sample.xcodeproj/project.pbxproj b/Examples/OAuth2Sample/OAuth2Sample.xcodeproj/project.pbxproj index 0975524..4419870 100644 --- a/Examples/OAuth2Sample/OAuth2Sample.xcodeproj/project.pbxproj +++ b/Examples/OAuth2Sample/OAuth2Sample.xcodeproj/project.pbxproj @@ -12,12 +12,11 @@ 4F24471B121F205800FEE1DA /* GTMOAuth2Window.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F244718121F205800FEE1DA /* GTMOAuth2Window.xib */; }; 4F24471C121F205800FEE1DA /* GTMOAuth2WindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F24471A121F205800FEE1DA /* GTMOAuth2WindowController.m */; }; 4F244A4D121F5CA400FEE1DA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F244A4C121F5CA400FEE1DA /* MainMenu.xib */; }; - 4F5617B212FB232D00C7F0F2 /* GTMHTTPFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F5617B112FB232D00C7F0F2 /* GTMHTTPFetcher.m */; }; 4F78829712F795CC001EE2A6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F78829612F795CC001EE2A6 /* main.m */; }; - 4FD316D7133BDC35007A58B5 /* GTMHTTPFetchHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FD316D6133BDC35007A58B5 /* GTMHTTPFetchHistory.m */; }; 4FDE34C71132165E00700DC8 /* OAuth2SampleAppController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4FDE34C61132165E00700DC8 /* OAuth2SampleAppController.m */; }; 4FDE353C1132197800700DC8 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FDE353B1132197800700DC8 /* Security.framework */; }; 4FDE359D11321EAA00700DC8 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FDE359C11321EAA00700DC8 /* WebKit.framework */; }; + 4FEE14211BB2204F002ACBF8 /* GTMSessionFetcherOSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FEE14201BB2204F002ACBF8 /* GTMSessionFetcherOSX.framework */; }; 4FF23D5911753FA800E96C5A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FF23D5811753FA800E96C5A /* SystemConfiguration.framework */; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; /* End PBXBuildFile section */ @@ -35,15 +34,12 @@ 4F244719121F205800FEE1DA /* GTMOAuth2WindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMOAuth2WindowController.h; path = ../../Source/Mac/GTMOAuth2WindowController.h; sourceTree = SOURCE_ROOT; }; 4F24471A121F205800FEE1DA /* GTMOAuth2WindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMOAuth2WindowController.m; path = ../../Source/Mac/GTMOAuth2WindowController.m; sourceTree = SOURCE_ROOT; }; 4F244A4C121F5CA400FEE1DA /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = ""; }; - 4F5617B012FB232D00C7F0F2 /* GTMHTTPFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMHTTPFetcher.h; path = ../../HTTPFetcher/GTMHTTPFetcher.h; sourceTree = SOURCE_ROOT; }; - 4F5617B112FB232D00C7F0F2 /* GTMHTTPFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMHTTPFetcher.m; path = ../../HTTPFetcher/GTMHTTPFetcher.m; sourceTree = SOURCE_ROOT; }; 4F78829612F795CC001EE2A6 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 4FD316D5133BDC35007A58B5 /* GTMHTTPFetchHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMHTTPFetchHistory.h; path = ../../HTTPFetcher/GTMHTTPFetchHistory.h; sourceTree = SOURCE_ROOT; }; - 4FD316D6133BDC35007A58B5 /* GTMHTTPFetchHistory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMHTTPFetchHistory.m; path = ../../HTTPFetcher/GTMHTTPFetchHistory.m; sourceTree = SOURCE_ROOT; }; 4FDE34C51132165E00700DC8 /* OAuth2SampleAppController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAuth2SampleAppController.h; sourceTree = ""; }; 4FDE34C61132165E00700DC8 /* OAuth2SampleAppController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAuth2SampleAppController.m; sourceTree = ""; }; 4FDE353B1132197800700DC8 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = ""; }; 4FDE359C11321EAA00700DC8 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = /System/Library/Frameworks/WebKit.framework; sourceTree = ""; }; + 4FEE14201BB2204F002ACBF8 /* GTMSessionFetcherOSX.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GTMSessionFetcherOSX.framework; path = ../../Deps/gtm-session-fetcher/Source/build/Debug/GTMSessionFetcherOSX.framework; sourceTree = ""; }; 4FF23D5811753FA800E96C5A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = /System/Library/Frameworks/SystemConfiguration.framework; sourceTree = ""; }; 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 8D1107320486CEB800E47090 /* OAuth2Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OAuth2Sample.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -54,6 +50,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4FEE14211BB2204F002ACBF8 /* GTMSessionFetcherOSX.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 4FDE353C1132197800700DC8 /* Security.framework in Frameworks */, 4FDE359D11321EAA00700DC8 /* WebKit.framework in Frameworks */, @@ -119,6 +116,7 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 4FEE14201BB2204F002ACBF8 /* GTMSessionFetcherOSX.framework */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); @@ -134,10 +132,6 @@ 4F2446BF121F1F5B00FEE1DA /* GTMOAuth2Authentication.m */, 4F2446C0121F1F5B00FEE1DA /* GTMOAuth2SignIn.h */, 4F2446C1121F1F5B00FEE1DA /* GTMOAuth2SignIn.m */, - 4F5617B012FB232D00C7F0F2 /* GTMHTTPFetcher.h */, - 4F5617B112FB232D00C7F0F2 /* GTMHTTPFetcher.m */, - 4FD316D5133BDC35007A58B5 /* GTMHTTPFetchHistory.h */, - 4FD316D6133BDC35007A58B5 /* GTMHTTPFetchHistory.m */, 4F244718121F205800FEE1DA /* GTMOAuth2Window.xib */, ); name = "OAuth Sources"; @@ -170,7 +164,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0620; + LastUpgradeCheck = 0730; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "OAuth2Sample" */; compatibilityVersion = "Xcode 3.2"; @@ -213,8 +207,6 @@ 4F2446C6121F1F5B00FEE1DA /* GTMOAuth2SignIn.m in Sources */, 4F24471C121F205800FEE1DA /* GTMOAuth2WindowController.m in Sources */, 4F78829712F795CC001EE2A6 /* main.m in Sources */, - 4F5617B212FB232D00C7F0F2 /* GTMHTTPFetcher.m in Sources */, - 4FD316D7133BDC35007A58B5 /* GTMHTTPFetchHistory.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -232,8 +224,14 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = OAuth2Sample_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + "GTM_OAUTH2_USE_FRAMEWORK_IMPORTS=1", + "GTM_OAUTH2_USE_PLATFORM_FRAMEWORK=1", + ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_BUNDLE_IDENTIFIER = "com.example.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = OAuth2Sample; }; name = Debug; @@ -247,8 +245,14 @@ GCC_MODEL_TUNING = G5; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = OAuth2Sample_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + "GTM_OAUTH2_USE_FRAMEWORK_IMPORTS=1", + "GTM_OAUTH2_USE_PLATFORM_FRAMEWORK=1", + ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; + MACOSX_DEPLOYMENT_TARGET = 10.10; + PRODUCT_BUNDLE_IDENTIFIER = "com.example.${PRODUCT_NAME:identifier}"; PRODUCT_NAME = OAuth2Sample; }; name = Release; @@ -256,6 +260,7 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c99; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_ABOUT_RETURN_TYPE = YES; diff --git a/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/contents.xcworkspacedata b/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..83ec9c5 --- /dev/null +++ b/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/xcshareddata/xcschemes/OAuth2Sample.xcscheme b/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/xcshareddata/xcschemes/OAuth2Sample.xcscheme new file mode 100644 index 0000000..079e111 --- /dev/null +++ b/Examples/OAuth2Sample/OAuth2Sample.xcworkspace/xcshareddata/xcschemes/OAuth2Sample.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcodeproj/project.pbxproj b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcodeproj/project.pbxproj index ac21e15..c248f72 100644 --- a/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcodeproj/project.pbxproj +++ b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcodeproj/project.pbxproj @@ -16,11 +16,11 @@ 13E350AA119CA9AE00B2EB5A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; 13E350AB119CA9AE00B2EB5A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1397AC501137075C00DE52FD /* Security.framework */; }; 13E350AC119CA9AE00B2EB5A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FF23DC011754C0300E96C5A /* SystemConfiguration.framework */; }; - 4F2447EF121F220A00FEE1DA /* GTMHTTPFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F2447ED121F220A00FEE1DA /* GTMHTTPFetcher.m */; }; 4F2447F3121F227900FEE1DA /* GTMOAuth2ViewControllerTouch.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F2447D6121F211300FEE1DA /* GTMOAuth2ViewControllerTouch.m */; }; 4F244813121F263E00FEE1DA /* OAuth2SampleMainTouch.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F244810121F253B00FEE1DA /* OAuth2SampleMainTouch.xib */; }; 4F64A4071305E3F90058B9BA /* GTMOAuth2Authentication.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F64A4041305E3F90058B9BA /* GTMOAuth2Authentication.m */; }; 4F64A4081305E3F90058B9BA /* GTMOAuth2SignIn.m in Sources */ = {isa = PBXBuildFile; fileRef = 4F64A4061305E3F90058B9BA /* GTMOAuth2SignIn.m */; }; + 4FB495671CAB2398000D1487 /* GTMSessionFetcherIOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FB495661CAB2398000D1487 /* GTMSessionFetcherIOS.framework */; }; 4FEED6C512233486006FB4BC /* GTMOAuth2ViewTouch.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4F2447D7121F211300FEE1DA /* GTMOAuth2ViewTouch.xib */; }; /* End PBXBuildFile section */ @@ -41,13 +41,12 @@ 4F2447D5121F211300FEE1DA /* GTMOAuth2ViewControllerTouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMOAuth2ViewControllerTouch.h; path = ../../Source/Touch/GTMOAuth2ViewControllerTouch.h; sourceTree = SOURCE_ROOT; }; 4F2447D6121F211300FEE1DA /* GTMOAuth2ViewControllerTouch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMOAuth2ViewControllerTouch.m; path = ../../Source/Touch/GTMOAuth2ViewControllerTouch.m; sourceTree = SOURCE_ROOT; }; 4F2447D7121F211300FEE1DA /* GTMOAuth2ViewTouch.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = GTMOAuth2ViewTouch.xib; path = ../../Source/Touch/GTMOAuth2ViewTouch.xib; sourceTree = SOURCE_ROOT; }; - 4F2447EC121F220A00FEE1DA /* GTMHTTPFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMHTTPFetcher.h; path = ../../HTTPFetcher/GTMHTTPFetcher.h; sourceTree = SOURCE_ROOT; }; - 4F2447ED121F220A00FEE1DA /* GTMHTTPFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMHTTPFetcher.m; path = ../../HTTPFetcher/GTMHTTPFetcher.m; sourceTree = SOURCE_ROOT; }; 4F244810121F253B00FEE1DA /* OAuth2SampleMainTouch.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OAuth2SampleMainTouch.xib; sourceTree = ""; }; 4F64A4031305E3F90058B9BA /* GTMOAuth2Authentication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMOAuth2Authentication.h; path = ../../Source/GTMOAuth2Authentication.h; sourceTree = SOURCE_ROOT; }; 4F64A4041305E3F90058B9BA /* GTMOAuth2Authentication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMOAuth2Authentication.m; path = ../../Source/GTMOAuth2Authentication.m; sourceTree = SOURCE_ROOT; }; 4F64A4051305E3F90058B9BA /* GTMOAuth2SignIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMOAuth2SignIn.h; path = ../../Source/GTMOAuth2SignIn.h; sourceTree = SOURCE_ROOT; }; 4F64A4061305E3F90058B9BA /* GTMOAuth2SignIn.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMOAuth2SignIn.m; path = ../../Source/GTMOAuth2SignIn.m; sourceTree = SOURCE_ROOT; }; + 4FB495661CAB2398000D1487 /* GTMSessionFetcherIOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GTMSessionFetcherIOS.framework; path = "../../Deps/gtm-session-fetcher/Source/build/Debug-iphoneos/GTMSessionFetcherIOS.framework"; sourceTree = ""; }; 4FF23DC011754C0300E96C5A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; F49B45D213315AA200EAA732 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; /* End PBXFileReference section */ @@ -57,6 +56,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4FB495671CAB2398000D1487 /* GTMSessionFetcherIOS.framework in Frameworks */, 13E350A8119CA9AE00B2EB5A /* Foundation.framework in Frameworks */, 13E350A9119CA9AE00B2EB5A /* UIKit.framework in Frameworks */, 13E350AA119CA9AE00B2EB5A /* CoreGraphics.framework in Frameworks */, @@ -105,7 +105,7 @@ 13C82E9111373B3000ACAEDD /* Sample App Classes */, 4F41065D1149BCAE009202D9 /* OAuth Classes and Resources */, 29B97315FDCFA39411CA2CEA /* Other Sample App Sources */, - 29B97323FDCFA39411CA2CEA /* System Frameworks */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); name = CustomTemplate; @@ -120,16 +120,17 @@ name = "Other Sample App Sources"; sourceTree = ""; }; - 29B97323FDCFA39411CA2CEA /* System Frameworks */ = { + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 4FB495661CAB2398000D1487 /* GTMSessionFetcherIOS.framework */, 4FF23DC011754C0300E96C5A /* SystemConfiguration.framework */, 1D30AB110D05D00D00671497 /* Foundation.framework */, 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, 1397AC501137075C00DE52FD /* Security.framework */, 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, ); - name = "System Frameworks"; + name = Frameworks; sourceTree = ""; }; 4F41065D1149BCAE009202D9 /* OAuth Classes and Resources */ = { @@ -141,8 +142,6 @@ 4F64A4041305E3F90058B9BA /* GTMOAuth2Authentication.m */, 4F64A4051305E3F90058B9BA /* GTMOAuth2SignIn.h */, 4F64A4061305E3F90058B9BA /* GTMOAuth2SignIn.m */, - 4F2447EC121F220A00FEE1DA /* GTMHTTPFetcher.h */, - 4F2447ED121F220A00FEE1DA /* GTMHTTPFetcher.m */, 4F2447D7121F211300FEE1DA /* GTMOAuth2ViewTouch.xib */, ); name = "OAuth Classes and Resources"; @@ -218,7 +217,6 @@ 13E350A1119CA9AE00B2EB5A /* OAuth2SampleAppDelegateTouch.m in Sources */, 13E350A2119CA9AE00B2EB5A /* OAuth2SampleRootViewControllerTouch.m in Sources */, 4F2447F3121F227900FEE1DA /* GTMOAuth2ViewControllerTouch.m in Sources */, - 4F2447EF121F220A00FEE1DA /* GTMHTTPFetcher.m in Sources */, 4F64A4071305E3F90058B9BA /* GTMOAuth2Authentication.m in Sources */, 4F64A4081305E3F90058B9BA /* GTMOAuth2SignIn.m in Sources */, ); @@ -236,8 +234,12 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = prefixTouch.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + "GTM_OAUTH2_USE_FRAMEWORK_IMPORTS=1", + "GTM_OAUTH2_USE_PLATFORM_FRAMEWORK=1", + ); INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; PRODUCT_NAME = OAuthSampleTouch; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -250,8 +252,12 @@ COPY_PHASE_STRIP = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = prefixTouch.pch; + GCC_PREPROCESSOR_DEFINITIONS = ( + "GTM_OAUTH2_USE_FRAMEWORK_IMPORTS=1", + "GTM_OAUTH2_USE_PLATFORM_FRAMEWORK=1", + ); INFOPLIST_FILE = Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; PRODUCT_NAME = OAuthSampleTouch; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -273,7 +279,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; OTHER_CFLAGS = "-DDEBUG=1"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; @@ -300,7 +306,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; "WARNING_CFLAGS[arch=*]" = ( diff --git a/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/contents.xcworkspacedata b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..583b089 --- /dev/null +++ b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..08de0be --- /dev/null +++ b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + diff --git a/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/xcshareddata/xcschemes/OAuthSampleTouch.xcscheme b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/xcshareddata/xcschemes/OAuthSampleTouch.xcscheme new file mode 100644 index 0000000..980a119 --- /dev/null +++ b/Examples/OAuth2SampleTouch/OAuth2SampleTouch.xcworkspace/xcshareddata/xcschemes/OAuthSampleTouch.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/GTMOAuth2Authentication.h b/Source/GTMOAuth2Authentication.h index bbfb680..dce8989 100644 --- a/Source/GTMOAuth2Authentication.h +++ b/Source/GTMOAuth2Authentication.h @@ -33,15 +33,29 @@ #define GTM_OAUTH2_USE_FRAMEWORK_IMPORTS 0 #endif +#ifndef GTM_OAUTH2_USE_PLATFORM_FRAMEWORK +#define GTM_OAUTH2_USE_PLATFORM_FRAMEWORK 0 +#endif + #if GTM_USE_SESSION_FETCHER #if GTM_OAUTH2_USE_FRAMEWORK_IMPORTS - #import + #if GTM_OAUTH2_USE_PLATFORM_FRAMEWORK + // App project file use. + #if TARGET_OS_IPHONE + #import + #else + #import + #endif // TARGET_OS_IPHONE + #else + // Cocoapod use. + #import + #endif // GTM_OAUTH2_USE_PLATFORM_FRAMEWORK #else #import "GTMSessionFetcher.h" #endif // GTM_OAUTH2_USE_FRAMEWORK_IMPORTS #else #if GTM_OAUTH2_USE_FRAMEWORK_IMPORTS - #import + #error GTMHTTPFetcher lacks a framework build #else #import "GTMHTTPFetcher.h" #endif // GTM_OAUTH2_USE_FRAMEWORK_IMPORTS @@ -180,17 +194,17 @@ extern NSString *const kGTMOAuth2NetworkFound; // the library. // Request properties -@property (copy) NSString *clientID; -@property (copy) NSString *clientSecret; -@property (copy) NSString *redirectURI; -@property (retain) NSString *scope; -@property (retain) NSString *tokenType; -@property (retain) NSString *assertion; -@property (retain) NSString *refreshScope; +@property (atomic, copy) NSString *clientID; +@property (atomic, copy) NSString *clientSecret; +@property (atomic, copy) NSString *redirectURI; +@property (atomic, retain) NSString *scope; +@property (atomic, retain) NSString *tokenType; +@property (atomic, retain) NSString *assertion; +@property (atomic, retain) NSString *refreshScope; // Apps may optionally add parameters here to be provided to the token // endpoint on token requests and refreshes. -@property (retain) NSDictionary *additionalTokenRequestParameters; +@property (atomic, retain) NSDictionary *additionalTokenRequestParameters; // Apps may optionally add parameters here to be provided to the token // endpoint on specific token requests and refreshes, keyed by the grant_type. @@ -201,31 +215,31 @@ extern NSString *const kGTMOAuth2NetworkFound; // @"authorization_code" : @{ @"type" : @"code" }, // @"refresh_token" : @{ @"type" : @"refresh" } // }; -@property (retain) NSDictionary *additionalGrantTypeRequestParameters; +@property (atomic, retain) NSDictionary *additionalGrantTypeRequestParameters; // Response properties // Dictionary of response and other properties; not KVO compliant -@property (readonly) NSDictionary *parameters; +@property (atomic, readonly) NSDictionary *parameters; -@property (retain) NSString *accessToken; -@property (retain) NSString *refreshToken; -@property (retain) NSNumber *expiresIn; -@property (retain) NSString *code; -@property (retain) NSString *errorString; +@property (atomic, retain) NSString *accessToken; +@property (atomic, retain) NSString *refreshToken; +@property (atomic, retain) NSNumber *expiresIn; +@property (atomic, retain) NSString *code; +@property (atomic, retain) NSString *errorString; // URL for obtaining access tokens -@property (copy) NSURL *tokenURL; +@property (atomic, copy) NSURL *tokenURL; // Calculated expiration date (expiresIn seconds added to the // time the access token was received.) -@property (copy) NSDate *expirationDate; +@property (atomic, copy) NSDate *expirationDate; // Service identifier, like "Google"; not used for authentication // // The provider name is just for allowing stored authorization to be associated // with the authorizing service. -@property (copy) NSString *serviceProvider; +@property (atomic, copy) NSString *serviceProvider; // User ID; not used for authentication @property (retain) NSString *userID; @@ -235,36 +249,36 @@ extern NSString *const kGTMOAuth2NetworkFound; // The verified string can be checked with -boolValue. If the result is false, // then the email address is listed with the account on the server, but the // address has not been confirmed as belonging to the owner of the account. -@property (retain) NSString *userEmail; -@property (retain) NSString *userEmailIsVerified; +@property (atomic, retain) NSString *userEmail; +@property (atomic, retain) NSString *userEmailIsVerified; // Property indicating if this auth has a refresh or access token so is suitable // for authorizing a request. This does not guarantee that the token is valid. -@property (readonly) BOOL canAuthorize; +@property (atomic, readonly) BOOL canAuthorize; // Property indicating if this object will authorize plain http request // (as well as any non-https requests.) Default is NO, only requests with the // scheme https are authorized, since security may be compromised if tokens // are sent over the wire using an unencrypted protocol like http. -@property (assign) BOOL shouldAuthorizeAllRequests; +@property (atomic, assign) BOOL shouldAuthorizeAllRequests; // userData is retained for the convenience of the caller -@property (retain) id userData; +@property (atomic, retain) id userData; // Stored property values are retained for the convenience of the caller -@property (retain) NSDictionary *properties; +@property (atomic, retain) NSDictionary *properties; // Property for the optional fetcher service instance to be used to create // fetchers // // Fetcher service objects retain authorizations, so this is weak to avoid // circular retains. -@property (assign) id fetcherService; // WEAK +@property (atomic, assign) id fetcherService; // WEAK // Key for the response parameter used for the authorization header; by default, // "access_token" is used, but some servers may expect alternatives, like // "id_token". -@property (copy) NSString *authorizationTokenKey; +@property (atomic, copy) NSString *authorizationTokenKey; // Convenience method for creating an authentication object + (id)authenticationWithServiceProvider:(NSString *)serviceProvider @@ -319,7 +333,7 @@ extern NSString *const kGTMOAuth2NetworkFound; // // Pending fetcher to get a new access token, if any -@property (retain) GTMOAuth2Fetcher *refreshFetcher; +@property (atomic, retain) GTMOAuth2Fetcher *refreshFetcher; // Check if a request is queued up to be authorized - (BOOL)isAuthorizingRequest:(NSURLRequest *)request; diff --git a/Source/GTMOAuth2Authentication.m b/Source/GTMOAuth2Authentication.m index 04ec229..e0c0a6a 100644 --- a/Source/GTMOAuth2Authentication.m +++ b/Source/GTMOAuth2Authentication.m @@ -97,12 +97,12 @@ @interface GTMOAuth2AuthorizationArgs : NSObject { NSError *error_; } -@property (retain) NSMutableURLRequest *request; -@property (retain) id delegate; -@property (assign) SEL selector; -@property (copy) id completionHandler; -@property (retain) NSThread *thread; -@property (retain) NSError *error; +@property (atomic, retain) NSMutableURLRequest *request; +@property (atomic, retain) id delegate; +@property (atomic, assign) SEL selector; +@property (atomic, copy) id completionHandler; +@property (atomic, retain) NSThread *thread; +@property (atomic, retain) NSError *error; + (GTMOAuth2AuthorizationArgs *)argsWithRequest:(NSMutableURLRequest *)req delegate:(id)delegate @@ -149,7 +149,7 @@ - (void)dealloc { @interface GTMOAuth2Authentication () -@property (retain) NSMutableArray *authorizationQueue; +@property (atomic, retain) NSMutableArray *authorizationQueue; @property (readonly) NSString *authorizationToken; - (void)setKeysForResponseJSONData:(NSData *)data; diff --git a/Source/GTMOAuth2SignIn.m b/Source/GTMOAuth2SignIn.m index c43070f..1f8452f 100644 --- a/Source/GTMOAuth2SignIn.m +++ b/Source/GTMOAuth2SignIn.m @@ -23,14 +23,14 @@ // URI indicating an installed app is signing in. This is described at // -// http://code.google.com/apis/accounts/docs/OAuth2.html#IA +// https://developers.google.com/identity/protocols/OAuth2InstalledApp#formingtheurl // -NSString *const kOOBString = @"urn:ietf:wg:oauth:2.0:oob"; +static NSString *const kOOBString = @"urn:ietf:wg:oauth:2.0:oob"; @interface GTMOAuth2SignIn () -@property (assign) BOOL hasHandledCallback; -@property (retain) GTMOAuth2Fetcher *pendingFetcher; +@property (atomic, assign) BOOL hasHandledCallback; +@property (atomic, retain) GTMOAuth2Fetcher *pendingFetcher; #if !GTM_OAUTH2_SKIP_GOOGLE_SUPPORT @property (nonatomic, retain, readwrite) NSDictionary *userProfile; #endif diff --git a/Source/Mac/GTMOAuth2WindowController.m b/Source/Mac/GTMOAuth2WindowController.m index c0312f2..252c54e 100644 --- a/Source/Mac/GTMOAuth2WindowController.m +++ b/Source/Mac/GTMOAuth2WindowController.m @@ -46,7 +46,7 @@ - (void)handleCookiesForResponse:(NSURLResponse *)response; - (NSURLRequest *)addCookiesToRequest:(NSURLRequest *)request; @end -const char *kKeychainAccountName = "OAuth"; +static const char *kKeychainAccountName = "OAuth"; @implementation GTMOAuth2WindowController @@ -360,7 +360,12 @@ - (void)destroyWindow { // Avoid more callbacks after the close happens, as the window // controller may be gone. - [self.webView stopLoading:nil]; + // + // We don't want to do this during handling of webView:resource:willSendRequest: as + // that causes a crash (during non-Google sign-in) so defer it to a later runloop. + [self.webView performSelectorOnMainThread:@selector(stopLoading:) + withObject:nil + waitUntilDone:NO]; NSWindow *parentWindow = self.sheetModalForWindow; if (parentWindow) {