From 643fcc52146e642fbf0de9f0bd0fbad134208e1e Mon Sep 17 00:00:00 2001 From: metasmile Date: Fri, 11 Mar 2016 11:55:23 +0900 Subject: [PATCH 1/9] The `:local` option of the Podfile has been renamed to `:path` and it is deprecated. --- Examples/AppClientExample/Podfile | 2 +- Examples/PhotoPostExample/Podfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/AppClientExample/Podfile b/Examples/AppClientExample/Podfile index 7b4d7e57..63f7faea 100644 --- a/Examples/AppClientExample/Podfile +++ b/Examples/AppClientExample/Podfile @@ -1,3 +1,3 @@ platform :ios, '5.0' -pod 'TMTumblrSDK/AppClient', :local => '../..' +pod 'TMTumblrSDK/AppClient', :path => '../..' diff --git a/Examples/PhotoPostExample/Podfile b/Examples/PhotoPostExample/Podfile index 81e9cb5a..b09b4453 100644 --- a/Examples/PhotoPostExample/Podfile +++ b/Examples/PhotoPostExample/Podfile @@ -1,3 +1,3 @@ platform :ios, '5.0' -pod 'TMTumblrSDK/APIClient', :local => '../..' +pod 'TMTumblrSDK/APIClient', :path => '../..' From a130b34eedb052498aa3c51af55c3c45667b757f Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 11:04:01 +0900 Subject: [PATCH 2/9] Fixes Podfile Add target fixes #129 --- Examples/AppClientExample/Podfile | 4 +++- Examples/PhotoPostExample/Podfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Examples/AppClientExample/Podfile b/Examples/AppClientExample/Podfile index 63f7faea..a9d8cc1e 100644 --- a/Examples/AppClientExample/Podfile +++ b/Examples/AppClientExample/Podfile @@ -1,3 +1,5 @@ platform :ios, '5.0' -pod 'TMTumblrSDK/AppClient', :path => '../..' +target 'AppClientExample' do + pod 'TMTumblrSDK/AppClient', :path => '../..' +end diff --git a/Examples/PhotoPostExample/Podfile b/Examples/PhotoPostExample/Podfile index b09b4453..891bb59e 100644 --- a/Examples/PhotoPostExample/Podfile +++ b/Examples/PhotoPostExample/Podfile @@ -1,3 +1,5 @@ platform :ios, '5.0' -pod 'TMTumblrSDK/APIClient', :path => '../..' +target 'PhotoPostExample' do + pod 'TMTumblrSDK/APIClient', :path => '../..' +end From 226d4b58db8e995cfac6cc28f294c2d31aad714f Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 11:29:46 +0900 Subject: [PATCH 3/9] Change Pods archive file name Add target refs #129 --- .../project.pbxproj | 54 ++++++++++++++++--- .../project.pbxproj | 46 +++++++++++----- 2 files changed, 80 insertions(+), 20 deletions(-) diff --git a/Examples/AppClientExample/AppClientExample.xcodeproj/project.pbxproj b/Examples/AppClientExample/AppClientExample.xcodeproj/project.pbxproj index a6e77188..f4a6ec49 100644 --- a/Examples/AppClientExample/AppClientExample.xcodeproj/project.pbxproj +++ b/Examples/AppClientExample/AppClientExample.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 00B5D1ABE4A6431E804EB5DA /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E241EBDBBDCF4E3393680DED /* libPods.a */; }; + 62DB9DC6FE73D58C41DB57D5 /* libPods-AppClientExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 081ECCB5093BF5EA249E3DF9 /* libPods-AppClientExample.a */; }; 9330594416F92D6B00868C9C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9330594316F92D6B00868C9C /* UIKit.framework */; }; 9330594616F92D6B00868C9C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9330594516F92D6B00868C9C /* Foundation.framework */; }; 9330594816F92D6B00868C9C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9330594716F92D6B00868C9C /* CoreGraphics.framework */; }; @@ -22,7 +22,9 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 081ECCB5093BF5EA249E3DF9 /* libPods-AppClientExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AppClientExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 86EFED2E98293EED7501CFB5 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 8D22401278BF22DBBEFA9323 /* Pods-AppClientExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppClientExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-AppClientExample/Pods-AppClientExample.release.xcconfig"; sourceTree = ""; }; 9330594016F92D6B00868C9C /* AppClientExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppClientExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9330594316F92D6B00868C9C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 9330594516F92D6B00868C9C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -39,6 +41,7 @@ 9330596016F92DA000868C9C /* TMAppClientExampleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TMAppClientExampleController.h; sourceTree = ""; }; 9330596116F92DA000868C9C /* TMAppClientExampleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TMAppClientExampleController.m; sourceTree = ""; }; 9330596316F930CB00868C9C /* tumblr.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tumblr.png; sourceTree = ""; }; + 9553335344D46A5856131B86 /* Pods-AppClientExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AppClientExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-AppClientExample/Pods-AppClientExample.debug.xcconfig"; sourceTree = ""; }; E241EBDBBDCF4E3393680DED /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; F7D2F48E989E7862098B14AB /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -51,7 +54,7 @@ 9330594416F92D6B00868C9C /* UIKit.framework in Frameworks */, 9330594616F92D6B00868C9C /* Foundation.framework in Frameworks */, 9330594816F92D6B00868C9C /* CoreGraphics.framework in Frameworks */, - 00B5D1ABE4A6431E804EB5DA /* libPods.a in Frameworks */, + 62DB9DC6FE73D58C41DB57D5 /* libPods-AppClientExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -83,6 +86,7 @@ 9330594516F92D6B00868C9C /* Foundation.framework */, 9330594716F92D6B00868C9C /* CoreGraphics.framework */, E241EBDBBDCF4E3393680DED /* libPods.a */, + 081ECCB5093BF5EA249E3DF9 /* libPods-AppClientExample.a */, ); name = Frameworks; sourceTree = ""; @@ -119,6 +123,8 @@ children = ( 86EFED2E98293EED7501CFB5 /* Pods.debug.xcconfig */, F7D2F48E989E7862098B14AB /* Pods.release.xcconfig */, + 9553335344D46A5856131B86 /* Pods-AppClientExample.debug.xcconfig */, + 8D22401278BF22DBBEFA9323 /* Pods-AppClientExample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -130,10 +136,12 @@ isa = PBXNativeTarget; buildConfigurationList = 9330595D16F92D6B00868C9C /* Build configuration list for PBXNativeTarget "AppClientExample" */; buildPhases = ( + 56CEBD4B6B45E4B652B7EB98 /* [CP] Check Pods Manifest.lock */, 9330593C16F92D6B00868C9C /* Sources */, 9330593D16F92D6B00868C9C /* Frameworks */, 9330593E16F92D6B00868C9C /* Resources */, - C05FF4C5F704428AA6529B95 /* Copy Pods Resources */, + C05FF4C5F704428AA6529B95 /* [CP] Copy Pods Resources */, + A75750A438D3014DFB3EC95A /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -187,19 +195,49 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - C05FF4C5F704428AA6529B95 /* Copy Pods Resources */ = { + 56CEBD4B6B45E4B652B7EB98 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + A75750A438D3014DFB3EC95A /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AppClientExample/Pods-AppClientExample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + C05FF4C5F704428AA6529B95 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AppClientExample/Pods-AppClientExample-resources.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -286,7 +324,7 @@ }; 9330595E16F92D6B00868C9C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 86EFED2E98293EED7501CFB5 /* Pods.debug.xcconfig */; + baseConfigurationReference = 9553335344D46A5856131B86 /* Pods-AppClientExample.debug.xcconfig */; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AppClientExample/AppClientExample-Prefix.pch"; @@ -298,7 +336,7 @@ }; 9330595F16F92D6B00868C9C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F7D2F48E989E7862098B14AB /* Pods.release.xcconfig */; + baseConfigurationReference = 8D22401278BF22DBBEFA9323 /* Pods-AppClientExample.release.xcconfig */; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AppClientExample/AppClientExample-Prefix.pch"; diff --git a/Examples/PhotoPostExample/PhotoPostExample.xcodeproj/project.pbxproj b/Examples/PhotoPostExample/PhotoPostExample.xcodeproj/project.pbxproj index f4d6129b..fab796e7 100644 --- a/Examples/PhotoPostExample/PhotoPostExample.xcodeproj/project.pbxproj +++ b/Examples/PhotoPostExample/PhotoPostExample.xcodeproj/project.pbxproj @@ -18,12 +18,13 @@ 9379E32117496C4300998F0C /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9379E32017496C4300998F0C /* Default-568h@2x.png */; }; 9379E32917496C6400998F0C /* TMPhotoPostController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9379E32817496C6400998F0C /* TMPhotoPostController.m */; }; 9379E32B17496CF700998F0C /* blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 9379E32A17496CF700998F0C /* blue.png */; }; - BDC17B63FEDE443FA3BCACC7 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89AC8A9EE01E437BB669FB46 /* libPods.a */; }; + AA81B9E9B3478BFAAF8ED830 /* libPods-PhotoPostExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F975E8F71A331D3138DC9E59 /* libPods-PhotoPostExample.a */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 2E49474A41D2A02B1E127BFD /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 618DF6CDE4B7B60312CF0D9D /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 62BBAF696902435E7A49CF46 /* Pods-PhotoPostExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PhotoPostExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-PhotoPostExample/Pods-PhotoPostExample.release.xcconfig"; sourceTree = ""; }; 89AC8A9EE01E437BB669FB46 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 9379E30717496C4300998F0C /* PhotoPostExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PhotoPostExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 9379E30A17496C4300998F0C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; @@ -41,6 +42,8 @@ 9379E32717496C6400998F0C /* TMPhotoPostController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TMPhotoPostController.h; sourceTree = ""; }; 9379E32817496C6400998F0C /* TMPhotoPostController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TMPhotoPostController.m; sourceTree = ""; }; 9379E32A17496CF700998F0C /* blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = blue.png; sourceTree = ""; }; + A37AC9E7D93CA3E198D194BE /* Pods-PhotoPostExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PhotoPostExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-PhotoPostExample/Pods-PhotoPostExample.debug.xcconfig"; sourceTree = ""; }; + F975E8F71A331D3138DC9E59 /* libPods-PhotoPostExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-PhotoPostExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -51,7 +54,7 @@ 9379E30B17496C4300998F0C /* UIKit.framework in Frameworks */, 9379E30D17496C4300998F0C /* Foundation.framework in Frameworks */, 9379E30F17496C4300998F0C /* CoreGraphics.framework in Frameworks */, - BDC17B63FEDE443FA3BCACC7 /* libPods.a in Frameworks */, + AA81B9E9B3478BFAAF8ED830 /* libPods-PhotoPostExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -83,6 +86,7 @@ 9379E30C17496C4300998F0C /* Foundation.framework */, 9379E30E17496C4300998F0C /* CoreGraphics.framework */, 89AC8A9EE01E437BB669FB46 /* libPods.a */, + F975E8F71A331D3138DC9E59 /* libPods-PhotoPostExample.a */, ); name = Frameworks; sourceTree = ""; @@ -119,6 +123,8 @@ children = ( 618DF6CDE4B7B60312CF0D9D /* Pods.debug.xcconfig */, 2E49474A41D2A02B1E127BFD /* Pods.release.xcconfig */, + A37AC9E7D93CA3E198D194BE /* Pods-PhotoPostExample.debug.xcconfig */, + 62BBAF696902435E7A49CF46 /* Pods-PhotoPostExample.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -130,11 +136,12 @@ isa = PBXNativeTarget; buildConfigurationList = 9379E32417496C4300998F0C /* Build configuration list for PBXNativeTarget "PhotoPostExample" */; buildPhases = ( - AD905AC7A4C643AEB9B8A657 /* Check Pods Manifest.lock */, + AD905AC7A4C643AEB9B8A657 /* [CP] Check Pods Manifest.lock */, 9379E30317496C4200998F0C /* Sources */, 9379E30417496C4200998F0C /* Frameworks */, 9379E30517496C4200998F0C /* Resources */, - F1BC47DF41B74E268B400A1C /* Copy Pods Resources */, + F1BC47DF41B74E268B400A1C /* [CP] Copy Pods Resources */, + 490248F73D65A2FDA43F60DB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -188,33 +195,48 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - AD905AC7A4C643AEB9B8A657 /* Check Pods Manifest.lock */ = { + 490248F73D65A2FDA43F60DB /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Check Pods Manifest.lock"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sanbox is not in sync with the Podfile.lock. Run 'pod install'.\nEOM\n exit 1\nfi\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PhotoPostExample/Pods-PhotoPostExample-frameworks.sh\"\n"; + showEnvVarsInLog = 0; }; - F1BC47DF41B74E268B400A1C /* Copy Pods Resources */ = { + AD905AC7A4C643AEB9B8A657 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Copy Pods Resources"; + name = "[CP] Check Pods Manifest.lock"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + }; + F1BC47DF41B74E268B400A1C /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PhotoPostExample/Pods-PhotoPostExample-resources.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -301,7 +323,7 @@ }; 9379E32517496C4300998F0C /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 618DF6CDE4B7B60312CF0D9D /* Pods.debug.xcconfig */; + baseConfigurationReference = A37AC9E7D93CA3E198D194BE /* Pods-PhotoPostExample.debug.xcconfig */; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "PhotoPostExample/PhotoPostExample-Prefix.pch"; @@ -313,7 +335,7 @@ }; 9379E32617496C4300998F0C /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2E49474A41D2A02B1E127BFD /* Pods.release.xcconfig */; + baseConfigurationReference = 62BBAF696902435E7A49CF46 /* Pods-PhotoPostExample.release.xcconfig */; buildSettings = { GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "PhotoPostExample/PhotoPostExample-Prefix.pch"; From dfcec0fc9b5fcad4fbe193bca81e8c30a871dc7d Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 11:47:11 +0900 Subject: [PATCH 4/9] Use cocoapods-keys refs #129 --- Examples/AppClientExample/Podfile | 8 ++++++++ .../PhotoPostExample/TMPhotoPostController.m | 9 ++++----- Examples/PhotoPostExample/Podfile | 8 ++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Examples/AppClientExample/Podfile b/Examples/AppClientExample/Podfile index a9d8cc1e..3e909400 100644 --- a/Examples/AppClientExample/Podfile +++ b/Examples/AppClientExample/Podfile @@ -3,3 +3,11 @@ platform :ios, '5.0' target 'AppClientExample' do pod 'TMTumblrSDK/AppClient', :path => '../..' end + +plugin 'cocoapods-keys', { + :project => 'AppClientExample', + :keys => [ + "OAuthConsumerKey", + "OAuthConsumerSecret" + ] +} diff --git a/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m b/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m index 1dfaa408..ef02cc24 100644 --- a/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m +++ b/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m @@ -9,6 +9,7 @@ #import "TMPhotoPostController.h" #import "TMAPIClient.h" +#import @implementation TMPhotoPostController @@ -21,12 +22,10 @@ - (void)viewDidLoad { [button addTarget:self action:@selector(postPhoto) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:button]; - // TODO: Fill in your keys and secrets - [TMAPIClient sharedInstance].OAuthConsumerKey = @""; - [TMAPIClient sharedInstance].OAuthConsumerSecret = @""; - [TMAPIClient sharedInstance].OAuthToken = @""; - [TMAPIClient sharedInstance].OAuthTokenSecret = @""; + PhotoPostExampleKeys *keys = [[PhotoPostExampleKeys alloc] init]; + [TMAPIClient sharedInstance].OAuthConsumerKey = keys.oAuthConsumerKey; + [TMAPIClient sharedInstance].OAuthConsumerSecret = keys.oAuthConsumerSecret; } - (void)postPhoto { diff --git a/Examples/PhotoPostExample/Podfile b/Examples/PhotoPostExample/Podfile index 891bb59e..8e4e4a52 100644 --- a/Examples/PhotoPostExample/Podfile +++ b/Examples/PhotoPostExample/Podfile @@ -3,3 +3,11 @@ platform :ios, '5.0' target 'PhotoPostExample' do pod 'TMTumblrSDK/APIClient', :path => '../..' end + +plugin 'cocoapods-keys', { + :project => 'PhotoPostExample', + :keys => [ + "OAuthConsumerKey", + "OAuthConsumerSecret" + ] +} From 0a0450c5e6c67eab574bf25a1a43959470599566 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 12:18:35 +0900 Subject: [PATCH 5/9] Fixes post photo button position centering, so easily tap. refs #129 --- .../PhotoPostExample/PhotoPostExample/TMPhotoPostController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m b/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m index 1dfaa408..b6e44583 100644 --- a/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m +++ b/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m @@ -19,6 +19,10 @@ - (void)viewDidLoad { [button setTitle:@"Post photo" forState:UIControlStateNormal]; [button sizeToFit]; [button addTarget:self action:@selector(postPhoto) forControlEvents:UIControlEventTouchUpInside]; + + CGRect screenRect = [[UIScreen mainScreen] bounds]; + button.center = CGPointMake(screenRect.size.width / 2, screenRect.size.height / 2); + [self.view addSubview:button]; // TODO: Fill in your keys and secrets From fcc1c017bf22cc044e306aeecebdbf371c5c201b Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 14:33:02 +0900 Subject: [PATCH 6/9] Fixes post photo - Add `authenticate` - Retrieve blog name from `userInfo` response - Use `post` and `type` is photo, replace of `photo` fixes #129 --- .../PhotoPostExample-Info.plist | 11 ++++++ .../PhotoPostExample/TMAppDelegate.m | 7 ++++ .../PhotoPostExample/TMPhotoPostController.m | 39 +++++++++++++------ 3 files changed, 45 insertions(+), 12 deletions(-) diff --git a/Examples/PhotoPostExample/PhotoPostExample/PhotoPostExample-Info.plist b/Examples/PhotoPostExample/PhotoPostExample/PhotoPostExample-Info.plist index 2a6746fc..35288820 100644 --- a/Examples/PhotoPostExample/PhotoPostExample/PhotoPostExample-Info.plist +++ b/Examples/PhotoPostExample/PhotoPostExample/PhotoPostExample-Info.plist @@ -20,6 +20,17 @@ 1.0 CFBundleSignature ???? + CFBundleURLTypes + + + CFBundleTypeRole + Editor + CFBundleURLSchemes + + PhotoPostExample + + + CFBundleVersion 1.0 LSRequiresIPhoneOS diff --git a/Examples/PhotoPostExample/PhotoPostExample/TMAppDelegate.m b/Examples/PhotoPostExample/PhotoPostExample/TMAppDelegate.m index 4b3964c2..9e552706 100644 --- a/Examples/PhotoPostExample/PhotoPostExample/TMAppDelegate.m +++ b/Examples/PhotoPostExample/PhotoPostExample/TMAppDelegate.m @@ -9,6 +9,7 @@ #import "TMAppDelegate.h" #import "TMPhotoPostController.h" +#import "TMAPIClient.h" @implementation TMAppDelegate @@ -21,4 +22,10 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } +#pragma mark - URL Scheme + +- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { + return [[TMAPIClient sharedInstance] handleOpenURL:url]; +} + @end diff --git a/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m b/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m index bc389d86..0f0baf48 100644 --- a/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m +++ b/Examples/PhotoPostExample/PhotoPostExample/TMPhotoPostController.m @@ -33,19 +33,34 @@ - (void)viewDidLoad { } - (void)postPhoto { - // TODO: Fill in your blog name + void (^userInfoDone)(id, NSError *) = ^(id response, NSError *error) { + [[TMAPIClient sharedInstance] post:response[@"user"][@"name"] + type:@"photo" + parameters:@{@"data64" : [self base64ImageNamed:@"blue.png"], @"caption" : @"Caption"} + callback:^(id response, NSError *error) { + if (error) + NSLog(@"Error posting to Tumblr"); + else + NSLog(@"Posted to Tumblr"); + }]; + }; - [[TMAPIClient sharedInstance] photo:@"" - filePathArray:@[[[NSBundle mainBundle] pathForResource:@"blue" ofType:@"png"]] - contentTypeArray:@[@"image/png"] - fileNameArray:@[@"blue.png"] - parameters:@{@"caption" : @"Caption"} - callback:^(id response, NSError *error) { - if (error) - NSLog(@"Error posting to Tumblr"); - else - NSLog(@"Posted to Tumblr"); - }]; + void (^authticateDone)(NSError *) = ^(NSError * error) { + if (error) + NSLog(@"Error authenticate to Tumblr"); + else + [[TMAPIClient sharedInstance] userInfo:userInfoDone]; + }; + + [[TMAPIClient sharedInstance] authenticate:@"PhotoPostExample" + fromViewController:self + callback:authticateDone]; +} + +#pragma mark - Private + +- (NSString *)base64ImageNamed:(NSString *)name { + return UIImagePNGRepresentation([UIImage imageNamed:name]).base64Encoding; } @end From 1db52b3fef65f70f9adc0ef20cab749fc7b56b7c Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 14:58:41 +0900 Subject: [PATCH 7/9] Add PhotoPostExample README refs #129 --- Examples/PhotoPostExample/README.md | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Examples/PhotoPostExample/README.md diff --git a/Examples/PhotoPostExample/README.md b/Examples/PhotoPostExample/README.md new file mode 100644 index 00000000..4c833d06 --- /dev/null +++ b/Examples/PhotoPostExample/README.md @@ -0,0 +1,33 @@ +# PhotoPostExample + +## Installation + +Install `cocoapods-keys`. + +https://github.com/orta/cocoapods-keys + +``` +$ gem install cocoapods-keys +``` + +Get `OAuth consumer Key` and `OAuth consumer Secret`. + +https://www.tumblr.com/oauth/apps + +Install libraries and set up keys. +Type your keys. + +``` +$ pod install + + CocoaPods-Keys has detected a keys mismatch for your setup. + What is the key for OAuthConsumerKey + > + +Saved OAuthConsumerKey to PhotoPostExample. + What is the key for OAuthConsumerSecret + > + +Saved OAuthConsumerSecret to PhotoPostExample. +... +``` From 74d785f03b82473941cb687e854808221d36c682 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 21:38:39 +0900 Subject: [PATCH 8/9] Remove cocoapods-keys from AppClientExample No need keys for AppClientExample refs #129 --- Examples/AppClientExample/Podfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Examples/AppClientExample/Podfile b/Examples/AppClientExample/Podfile index 3e909400..a9d8cc1e 100644 --- a/Examples/AppClientExample/Podfile +++ b/Examples/AppClientExample/Podfile @@ -3,11 +3,3 @@ platform :ios, '5.0' target 'AppClientExample' do pod 'TMTumblrSDK/AppClient', :path => '../..' end - -plugin 'cocoapods-keys', { - :project => 'AppClientExample', - :keys => [ - "OAuthConsumerKey", - "OAuthConsumerSecret" - ] -} From 65749f57b2c5de4a9a0921177169d855d63a8bc9 Mon Sep 17 00:00:00 2001 From: Yoshiyuki Kawashima Date: Fri, 23 Jun 2017 21:44:20 +0900 Subject: [PATCH 9/9] Add `tumblr` to whitelist URL schemes fixes #129 --- .../AppClientExample-Info.plist | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Examples/AppClientExample/AppClientExample/AppClientExample-Info.plist b/Examples/AppClientExample/AppClientExample/AppClientExample-Info.plist index 04d8fbfe..c2b79060 100644 --- a/Examples/AppClientExample/AppClientExample/AppClientExample-Info.plist +++ b/Examples/AppClientExample/AppClientExample/AppClientExample-Info.plist @@ -20,14 +20,6 @@ 1.0 CFBundleSignature ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - CFBundleURLTypes @@ -37,6 +29,18 @@ + CFBundleVersion + 1.0 + LSApplicationQueriesSchemes + + tumblr + + LSRequiresIPhoneOS + + UIRequiredDeviceCapabilities + + armv7 + UISupportedInterfaceOrientations UIInterfaceOrientationPortrait