├── .gitignore ├── Classes ├── Embedly.h └── Embedly.m ├── Example ├── EmbedlyDemo.xcworkspace │ └── contents.xcworkspacedata ├── EmbedlyDemo │ ├── EmbedlyDemo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── anrope.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── EmbedlyDemo.xcscheme │ │ │ └── xcschememanagement.plist │ ├── EmbedlyDemo │ │ ├── EmbedlyDemo-Info.plist │ │ ├── EmbedlyDemo-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── Storyboard.storyboard │ │ ├── edemAppDelegate.h │ │ ├── edemAppDelegate.m │ │ ├── edemViewController.h │ │ ├── edemViewController.m │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── EmbedlyDemoTests │ │ ├── EmbedlyDemoTests-Info.plist │ │ ├── EmbedlyDemoTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings └── Podfile ├── LICENSE ├── README.md ├── embedly-ios.podspec ├── icon114x114.png └── icon57x57.png /.gitignore: -------------------------------------------------------------------------------- 1 | EmbedlyTest.xcodeproj/project.xcworkspace/ 2 | EmbedlyTest.xcodeproj/xcuserdata/ 3 | 4 | -------------------------------------------------------------------------------- /Classes/Embedly.h: -------------------------------------------------------------------------------- 1 | // 2 | // Embedly.h 3 | // Embedly 4 | // 5 | // Created by Andrew Pellett on 4/25/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AFNetworking.h" 11 | 12 | /** 13 | The EmbedlyDelegate protocol delivers responses of the async HTTP calls. 14 | */ 15 | @protocol EmbedlyDelegate 16 | 17 | /** 18 | embedlySuccess is called when the Embedly API successfully returns a response 19 | 20 | @param callUrl The full Embedly API call. Useful for caching and debugging. 21 | @param withResponse The Embedly API response. Can be accessed as an NSDictionary, or NSArray of NSDictionarys in the case of a batch call. 22 | @param endpoint The Embedly API endpoint used by the API call. 23 | @param operation Additional information about the HTTP call. 24 | */ 25 | - (void)embedlySuccess:(NSString *)callUrl withResponse:(id)response endpoint:(NSString *)endpoint operation:(AFHTTPRequestOperation *)operation; 26 | /** 27 | embedlyFailure is called if there is some issue with the Embedly HTTP call 28 | 29 | @param callUrl The full Embedly API call. For debugging, try this URL in your browser. 30 | @param withError The error returned by the HTTP call. 31 | @param endpoint The Embedly API endpoint used by the API call. 32 | @param operation Additional information about the HTTP call. 33 | */ 34 | - (void)embedlyFailure:(NSString *)callUrl withError:(NSError *)error endpoint:(NSString *)endpoint operation:(AFHTTPRequestOperation *)operation; 35 | 36 | @end 37 | 38 | @interface Embedly : NSObject 39 | 40 | /** 41 | Holds the object which implements the EmbedlyDelegate protocol, which receives the responses to API calls. 42 | */ 43 | @property id delegate; 44 | 45 | /** 46 | Your Embedly API key. Get it for free at: 47 | 48 | https://app.embed.ly/signup 49 | */ 50 | @property NSString *key; 51 | 52 | /** 53 | Embedly initializer 54 | 55 | @param initWithKey Pass in your Embedly API key 56 | @param delegate An object implementing the EmbedlyDelegate protocol 57 | */ 58 | - (id)initWithKey:(NSString *)key delegate:(id)delegate; 59 | 60 | /** 61 | Call the Embedly Embed API 62 | 63 | @param callEmbed the URL to be passed to the Embedly Embed API 64 | @param params Embedly Embed API parameters. See http://embed.ly/docs/embed/api/arguments 65 | @param optimizeImages Pass a width in pixels, and all image URLs in the API response will be replaced with Embedly Display URLs to images resized to the given width. Pass 0 to disable this. 66 | */ 67 | - (NSString *)callEmbed:(NSString *)url params:(NSDictionary *)params optimizeImages:(NSInteger)width; 68 | 69 | /** 70 | Call the Embedly Extract API 71 | 72 | @param callExtract the URL to be passed to the Embedly Extract API 73 | @param params Embedly Embed API parameters. See http://embed.ly/docs/extract/api/arguments 74 | @param optimizeImages Pass a width in pixels, and all image URLs in the API response will be replaced with Embedly Display URLs to images resized to the given width. Pass 0 to disable this. 75 | */ 76 | - (NSString *)callExtract:(NSString *)url params:(NSDictionary *)params optimizeImages:(NSInteger)width; 77 | 78 | /** 79 | A generic function to call any of the Embedly Embed, Extract, or legacy APIs 80 | 81 | @param callEmbedlyApi The Embedly API endpoint to use (e.g. /1/oembed, /1/extract) 82 | @param withUrl The URL to be passed to the Embedly API endpoint 83 | @param params Arguments to the Embedly API. See http://embed.ly/docs 84 | */ 85 | - (NSString *)callEmbedlyApi:(NSString *)endpoint withUrl:(NSString *)url params:(NSDictionary *)params; 86 | 87 | /** 88 | A generic function to call any of the Embedly Embed, Extract, or legacy APIs with a multiple URLs in one call (batch) 89 | 90 | @param callEmbedlyApi The Embedly API endpoint to use (e.g. /1/oembed, /1/extract) 91 | @param withUrls The URLs to be passed to the Embedly API endpoint. Should be an NSArray of NSStrings. 92 | @param params Arguments to the Embedly API. See http://embed.ly/docs 93 | */ 94 | - (NSString *)callEmbedlyApi:(NSString *)endpoint withUrls:(NSArray *)urls params:(NSDictionary *)params; 95 | 96 | 97 | /** 98 | Builds a URL to a resized version of an image. See: 99 | 100 | http://embed.ly/docs/display/api/endpoints/1/display/resize 101 | 102 | @param buildResizedImageUrl URL to the original image to be resized 103 | @param width Width to resize to. Height is scaled to maintain aspect ratio. 104 | */ 105 | - (NSString *)buildResizedImageUrl:(NSString *)url width:(NSInteger)width; 106 | 107 | /** 108 | Builds a URL to a cropped version of an image. See: 109 | 110 | http://embed.ly/docs/display/api/endpoints/1/display/crop 111 | 112 | @param buildCroppedImageURL URL to the original image to be cropped 113 | @param width Width of croppped image 114 | @param height Height of cropped image 115 | */ 116 | - (NSString *)buildCroppedImageUrl:(NSString *)url width:(NSInteger)width height:(NSInteger)height; 117 | 118 | /** 119 | Builds a URL to a manipulated version of an image via any of the Embedly Display endpoints. See: 120 | 121 | http://embed.ly/docs/display 122 | 123 | @param buildDisplayUrl Embedly Display endpoint to use (e.g. /1/display, /1/display/resize, /1/display/crop) 124 | @param withUrl URL to the original image to be manipulated 125 | @param params Embedly Display API parameters. See: http://embed.ly/docs/display 126 | */ 127 | - (NSString *)buildDisplayUrl:(NSString *)endpoint withUrl:(NSString *)url params:(NSDictionary *)params; 128 | 129 | @end -------------------------------------------------------------------------------- /Classes/Embedly.m: -------------------------------------------------------------------------------- 1 | // 2 | // Embedly.m 3 | // Embedly 4 | // 5 | // Created by Andrew Pellett on 4/25/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import "Embedly.h" 10 | 11 | @implementation Embedly 12 | 13 | - (id)initWithKey:(NSString *)key delegate:(id)delegate { 14 | self.key = key; 15 | self.delegate = delegate; 16 | 17 | return self; 18 | } 19 | 20 | /* API stuff */ 21 | 22 | - (NSString *)callEmbed:(NSString *)url params:(NSDictionary *)params optimizeImages:(NSInteger)width { 23 | NSMutableDictionary *completeParams = [NSMutableDictionary dictionaryWithDictionary:params]; 24 | [completeParams setObject:self.key forKey:@"key"]; 25 | [completeParams setObject:url forKey:@"url"]; 26 | if (width > 0) { 27 | [completeParams setObject:[NSString stringWithFormat:@"%ld", (long)width] forKey:@"image_width"]; 28 | } 29 | 30 | return [self fetchEmbedlyApi:@"/1/oembed" withParams:completeParams]; 31 | } 32 | 33 | - (NSString *)callExtract:(NSString *)url params:(NSDictionary *)params optimizeImages:(NSInteger)width { 34 | NSMutableDictionary *completeParams = [NSMutableDictionary dictionaryWithDictionary:params]; 35 | [completeParams setObject:self.key forKey:@"key"]; 36 | [completeParams setObject:url forKey:@"url"]; 37 | if (width > 0) { 38 | [completeParams setObject:[NSString stringWithFormat:@"%ld", (long)width] forKey:@"image_width"]; 39 | } 40 | 41 | return [self fetchEmbedlyApi:@"/1/extract" withParams:completeParams]; 42 | } 43 | 44 | - (NSString *)callEmbedlyApi:(NSString *)endpoint withUrl:(NSString *)url params:(NSDictionary *)params { 45 | NSMutableDictionary *completeParams = [NSMutableDictionary dictionaryWithDictionary:params]; 46 | [completeParams setObject:self.key forKey:@"key"]; 47 | [completeParams setObject:url forKey:@"url"]; 48 | 49 | return [self fetchEmbedlyApi:endpoint withParams:completeParams]; 50 | } 51 | 52 | - (NSString *)callEmbedlyApi:(NSString *)endpoint withUrls:(NSArray *)urls params:(NSDictionary *)params { 53 | NSMutableDictionary *completeParams = [NSMutableDictionary dictionaryWithDictionary:params]; 54 | [completeParams setObject:self.key forKey:@"key"]; 55 | // Using NSArray causes [] to be appended to param name. NSSet avoids this. 56 | [completeParams setObject:[NSSet setWithArray:urls] forKey:@"urls"]; 57 | 58 | return [self fetchEmbedlyApi:endpoint withParams:completeParams]; 59 | } 60 | 61 | /* Display stuff */ 62 | 63 | - (NSString *)buildCroppedImageUrl:(NSString *)url width:(NSInteger)width height:(NSInteger)height 64 | { 65 | NSMutableDictionary *completeParams = [[NSMutableDictionary alloc] init]; 66 | [completeParams setObject:self.key forKey:@"key"]; 67 | [completeParams setObject:url forKey:@"url"]; 68 | [completeParams setObject:[NSString stringWithFormat:@"%ld", (long)width] forKey:@"width"]; 69 | [completeParams setObject:[NSString stringWithFormat:@"%ld", (long)height] forKey:@"height"]; 70 | 71 | return [self buildEmbedlyUrl:@"/1/display/crop" withParams:completeParams]; 72 | } 73 | 74 | - (NSString *)buildResizedImageUrl:(NSString *)url width:(NSInteger)width { 75 | NSMutableDictionary *completeParams = [[NSMutableDictionary alloc] init]; 76 | [completeParams setObject:self.key forKey:@"key"]; 77 | [completeParams setObject:url forKey:@"url"]; 78 | [completeParams setObject:[NSString stringWithFormat:@"%ld", (long)width] forKey:@"width"]; 79 | 80 | return [self buildEmbedlyUrl:@"/1/display/resize" withParams:completeParams]; 81 | } 82 | 83 | - (NSString *)buildDisplayUrl:(NSString *)endpoint withUrl:(NSString *)url params:(NSDictionary *)params { 84 | NSMutableDictionary *completeParams = [NSMutableDictionary dictionaryWithDictionary:params]; 85 | [completeParams setObject:self.key forKey:@"key"]; 86 | [completeParams setObject:url forKey:@"url"]; 87 | 88 | return [self buildEmbedlyUrl:endpoint withParams:completeParams]; 89 | } 90 | 91 | /* Other stuff */ 92 | 93 | - (NSString *)buildEmbedlyUrl:(NSString *)endpoint withParams:(NSDictionary *)params { 94 | NSString *embedlyUrl; 95 | if ([endpoint hasPrefix:@"/1/display"]) { 96 | embedlyUrl = [NSString stringWithFormat:@"http://i.embed.ly%@", endpoint]; 97 | } else { 98 | embedlyUrl = [NSString stringWithFormat:@"http://api.embed.ly%@", endpoint]; 99 | } 100 | 101 | 102 | NSString *displayQuery = @"?"; 103 | NSString *param; 104 | for (id key in params) { 105 | NSString *paramValue = [params[key] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; 106 | if ([displayQuery length] == 1) { 107 | displayQuery = [NSString stringWithFormat:@"?%@=%@", key, paramValue]; 108 | } else { 109 | param = [NSString stringWithFormat:@"&%@=%@", key, paramValue]; 110 | displayQuery = [displayQuery stringByAppendingString:param]; 111 | } 112 | } 113 | 114 | return [NSString stringWithFormat:@"%@%@", embedlyUrl, displayQuery]; 115 | } 116 | 117 | - (NSString *)fetchEmbedlyApi:(NSString *)endpoint withParams:(NSDictionary *)params { 118 | NSString *embedlyUrl = [self buildEmbedlyUrl:endpoint withParams:params]; 119 | 120 | AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; 121 | AFHTTPRequestSerializer *requestSerializer = [AFHTTPRequestSerializer serializer]; 122 | manager.requestSerializer = requestSerializer; 123 | [requestSerializer setValue:@"embedly-ios/1.0" forHTTPHeaderField:@"User-Agent"]; 124 | manager.responseSerializer = [AFJSONResponseSerializer serializer]; 125 | 126 | [manager GET:embedlyUrl parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { 127 | [[self delegate] embedlySuccess:embedlyUrl withResponse:responseObject endpoint:endpoint operation:operation]; 128 | } failure:^(AFHTTPRequestOperation *operation, NSError *error) { 129 | [[self delegate] embedlyFailure:embedlyUrl withError:error endpoint:endpoint operation:operation]; 130 | }]; 131 | 132 | return embedlyUrl; 133 | } 134 | 135 | @end 136 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1A0360B4192A7FCC00E44B68 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0360B3192A7FCC00E44B68 /* Foundation.framework */; }; 11 | 1A0360B6192A7FCC00E44B68 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0360B5192A7FCC00E44B68 /* CoreGraphics.framework */; }; 12 | 1A0360B8192A7FCC00E44B68 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0360B7192A7FCC00E44B68 /* UIKit.framework */; }; 13 | 1A0360BE192A7FCC00E44B68 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A0360BC192A7FCC00E44B68 /* InfoPlist.strings */; }; 14 | 1A0360C0192A7FCC00E44B68 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A0360BF192A7FCC00E44B68 /* main.m */; }; 15 | 1A0360C4192A7FCC00E44B68 /* edemAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A0360C3192A7FCC00E44B68 /* edemAppDelegate.m */; }; 16 | 1A0360C6192A7FCC00E44B68 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1A0360C5192A7FCC00E44B68 /* Images.xcassets */; }; 17 | 1A0360CD192A7FCC00E44B68 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0360CC192A7FCC00E44B68 /* XCTest.framework */; }; 18 | 1A0360CE192A7FCC00E44B68 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0360B3192A7FCC00E44B68 /* Foundation.framework */; }; 19 | 1A0360CF192A7FCC00E44B68 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0360B7192A7FCC00E44B68 /* UIKit.framework */; }; 20 | 1A0360D7192A7FCC00E44B68 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1A0360D5192A7FCC00E44B68 /* InfoPlist.strings */; }; 21 | 1A0360D9192A7FCC00E44B68 /* EmbedlyDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A0360D8192A7FCC00E44B68 /* EmbedlyDemoTests.m */; }; 22 | 1A036118192A956500E44B68 /* Storyboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1A036117192A956500E44B68 /* Storyboard.storyboard */; }; 23 | 1A03611B192A9EA500E44B68 /* edemViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A03611A192A9EA500E44B68 /* edemViewController.m */; }; 24 | 86A3628AA7EE4EAAA6AC7A6B /* libPods-EmbedlyDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 44A504FC5D2E44DFB98B6E11 /* libPods-EmbedlyDemoTests.a */; }; 25 | 9F9394B24D0A40F4B26E43DE /* libPods-EmbedlyDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 23682E92C6DF4A6989136BD8 /* libPods-EmbedlyDemo.a */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 1A0360D0192A7FCC00E44B68 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 1A0360A8192A7FCC00E44B68 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 1A0360AF192A7FCC00E44B68; 34 | remoteInfo = EmbedlyDemo; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1A0360B0192A7FCC00E44B68 /* EmbedlyDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EmbedlyDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 1A0360B3192A7FCC00E44B68 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 41 | 1A0360B5192A7FCC00E44B68 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 42 | 1A0360B7192A7FCC00E44B68 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 43 | 1A0360BB192A7FCC00E44B68 /* EmbedlyDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EmbedlyDemo-Info.plist"; sourceTree = ""; }; 44 | 1A0360BD192A7FCC00E44B68 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 45 | 1A0360BF192A7FCC00E44B68 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 46 | 1A0360C1192A7FCC00E44B68 /* EmbedlyDemo-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "EmbedlyDemo-Prefix.pch"; sourceTree = ""; }; 47 | 1A0360C2192A7FCC00E44B68 /* edemAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = edemAppDelegate.h; sourceTree = ""; }; 48 | 1A0360C3192A7FCC00E44B68 /* edemAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = edemAppDelegate.m; sourceTree = ""; }; 49 | 1A0360C5192A7FCC00E44B68 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 50 | 1A0360CB192A7FCC00E44B68 /* EmbedlyDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = EmbedlyDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 1A0360CC192A7FCC00E44B68 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 52 | 1A0360D4192A7FCC00E44B68 /* EmbedlyDemoTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "EmbedlyDemoTests-Info.plist"; sourceTree = ""; }; 53 | 1A0360D6192A7FCC00E44B68 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 54 | 1A0360D8192A7FCC00E44B68 /* EmbedlyDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EmbedlyDemoTests.m; sourceTree = ""; }; 55 | 1A036117192A956500E44B68 /* Storyboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Storyboard.storyboard; sourceTree = ""; }; 56 | 1A036119192A9EA500E44B68 /* edemViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = edemViewController.h; sourceTree = ""; }; 57 | 1A03611A192A9EA500E44B68 /* edemViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = edemViewController.m; sourceTree = ""; }; 58 | 23682E92C6DF4A6989136BD8 /* libPods-EmbedlyDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EmbedlyDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 44A504FC5D2E44DFB98B6E11 /* libPods-EmbedlyDemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-EmbedlyDemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | C976355D8EE3413B86C7AEAC /* Pods-EmbedlyDemo.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EmbedlyDemo.xcconfig"; path = "../Pods/Pods-EmbedlyDemo.xcconfig"; sourceTree = ""; }; 61 | F19D7BC6D4CE4328B89EFB43 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 62 | /* End PBXFileReference section */ 63 | 64 | /* Begin PBXFrameworksBuildPhase section */ 65 | 1A0360AD192A7FCC00E44B68 /* Frameworks */ = { 66 | isa = PBXFrameworksBuildPhase; 67 | buildActionMask = 2147483647; 68 | files = ( 69 | 1A0360B6192A7FCC00E44B68 /* CoreGraphics.framework in Frameworks */, 70 | 1A0360B8192A7FCC00E44B68 /* UIKit.framework in Frameworks */, 71 | 1A0360B4192A7FCC00E44B68 /* Foundation.framework in Frameworks */, 72 | 9F9394B24D0A40F4B26E43DE /* libPods-EmbedlyDemo.a in Frameworks */, 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 1A0360C8192A7FCC00E44B68 /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | 1A0360CD192A7FCC00E44B68 /* XCTest.framework in Frameworks */, 81 | 1A0360CF192A7FCC00E44B68 /* UIKit.framework in Frameworks */, 82 | 1A0360CE192A7FCC00E44B68 /* Foundation.framework in Frameworks */, 83 | 86A3628AA7EE4EAAA6AC7A6B /* libPods-EmbedlyDemoTests.a in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | 1A0360A7192A7FCC00E44B68 = { 91 | isa = PBXGroup; 92 | children = ( 93 | 1A0360B9192A7FCC00E44B68 /* EmbedlyDemo */, 94 | 1A0360D2192A7FCC00E44B68 /* EmbedlyDemoTests */, 95 | 1A0360B2192A7FCC00E44B68 /* Frameworks */, 96 | 1A0360B1192A7FCC00E44B68 /* Products */, 97 | C976355D8EE3413B86C7AEAC /* Pods-EmbedlyDemo.xcconfig */, 98 | ); 99 | sourceTree = ""; 100 | }; 101 | 1A0360B1192A7FCC00E44B68 /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 1A0360B0192A7FCC00E44B68 /* EmbedlyDemo.app */, 105 | 1A0360CB192A7FCC00E44B68 /* EmbedlyDemoTests.xctest */, 106 | ); 107 | name = Products; 108 | sourceTree = ""; 109 | }; 110 | 1A0360B2192A7FCC00E44B68 /* Frameworks */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 1A0360B3192A7FCC00E44B68 /* Foundation.framework */, 114 | 1A0360B5192A7FCC00E44B68 /* CoreGraphics.framework */, 115 | 1A0360B7192A7FCC00E44B68 /* UIKit.framework */, 116 | 1A0360CC192A7FCC00E44B68 /* XCTest.framework */, 117 | F19D7BC6D4CE4328B89EFB43 /* libPods.a */, 118 | 23682E92C6DF4A6989136BD8 /* libPods-EmbedlyDemo.a */, 119 | 44A504FC5D2E44DFB98B6E11 /* libPods-EmbedlyDemoTests.a */, 120 | ); 121 | name = Frameworks; 122 | sourceTree = ""; 123 | }; 124 | 1A0360B9192A7FCC00E44B68 /* EmbedlyDemo */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 1A0360C2192A7FCC00E44B68 /* edemAppDelegate.h */, 128 | 1A0360C3192A7FCC00E44B68 /* edemAppDelegate.m */, 129 | 1A036117192A956500E44B68 /* Storyboard.storyboard */, 130 | 1A036119192A9EA500E44B68 /* edemViewController.h */, 131 | 1A03611A192A9EA500E44B68 /* edemViewController.m */, 132 | 1A0360C5192A7FCC00E44B68 /* Images.xcassets */, 133 | 1A0360BA192A7FCC00E44B68 /* Supporting Files */, 134 | ); 135 | path = EmbedlyDemo; 136 | sourceTree = ""; 137 | }; 138 | 1A0360BA192A7FCC00E44B68 /* Supporting Files */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 1A0360BB192A7FCC00E44B68 /* EmbedlyDemo-Info.plist */, 142 | 1A0360BC192A7FCC00E44B68 /* InfoPlist.strings */, 143 | 1A0360BF192A7FCC00E44B68 /* main.m */, 144 | 1A0360C1192A7FCC00E44B68 /* EmbedlyDemo-Prefix.pch */, 145 | ); 146 | name = "Supporting Files"; 147 | sourceTree = ""; 148 | }; 149 | 1A0360D2192A7FCC00E44B68 /* EmbedlyDemoTests */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 1A0360D8192A7FCC00E44B68 /* EmbedlyDemoTests.m */, 153 | 1A0360D3192A7FCC00E44B68 /* Supporting Files */, 154 | ); 155 | path = EmbedlyDemoTests; 156 | sourceTree = ""; 157 | }; 158 | 1A0360D3192A7FCC00E44B68 /* Supporting Files */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 1A0360D4192A7FCC00E44B68 /* EmbedlyDemoTests-Info.plist */, 162 | 1A0360D5192A7FCC00E44B68 /* InfoPlist.strings */, 163 | ); 164 | name = "Supporting Files"; 165 | sourceTree = ""; 166 | }; 167 | /* End PBXGroup section */ 168 | 169 | /* Begin PBXNativeTarget section */ 170 | 1A0360AF192A7FCC00E44B68 /* EmbedlyDemo */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = 1A0360DC192A7FCC00E44B68 /* Build configuration list for PBXNativeTarget "EmbedlyDemo" */; 173 | buildPhases = ( 174 | D296C255F12C412C9E82C12E /* Check Pods Manifest.lock */, 175 | 1A0360AC192A7FCC00E44B68 /* Sources */, 176 | 1A0360AD192A7FCC00E44B68 /* Frameworks */, 177 | 1A0360AE192A7FCC00E44B68 /* Resources */, 178 | 5232DB6E82E24C679100F66F /* Copy Pods Resources */, 179 | ); 180 | buildRules = ( 181 | ); 182 | dependencies = ( 183 | ); 184 | name = EmbedlyDemo; 185 | productName = EmbedlyDemo; 186 | productReference = 1A0360B0192A7FCC00E44B68 /* EmbedlyDemo.app */; 187 | productType = "com.apple.product-type.application"; 188 | }; 189 | 1A0360CA192A7FCC00E44B68 /* EmbedlyDemoTests */ = { 190 | isa = PBXNativeTarget; 191 | buildConfigurationList = 1A0360DF192A7FCC00E44B68 /* Build configuration list for PBXNativeTarget "EmbedlyDemoTests" */; 192 | buildPhases = ( 193 | D26200C3BFA343DEB4EA0D41 /* Check Pods Manifest.lock */, 194 | 1A0360C7192A7FCC00E44B68 /* Sources */, 195 | 1A0360C8192A7FCC00E44B68 /* Frameworks */, 196 | 1A0360C9192A7FCC00E44B68 /* Resources */, 197 | AC623EC852C846808C1AFA3F /* Copy Pods Resources */, 198 | ); 199 | buildRules = ( 200 | ); 201 | dependencies = ( 202 | 1A0360D1192A7FCC00E44B68 /* PBXTargetDependency */, 203 | ); 204 | name = EmbedlyDemoTests; 205 | productName = EmbedlyDemoTests; 206 | productReference = 1A0360CB192A7FCC00E44B68 /* EmbedlyDemoTests.xctest */; 207 | productType = "com.apple.product-type.bundle.unit-test"; 208 | }; 209 | /* End PBXNativeTarget section */ 210 | 211 | /* Begin PBXProject section */ 212 | 1A0360A8192A7FCC00E44B68 /* Project object */ = { 213 | isa = PBXProject; 214 | attributes = { 215 | CLASSPREFIX = edem; 216 | LastUpgradeCheck = 0510; 217 | ORGANIZATIONNAME = Embedly; 218 | TargetAttributes = { 219 | 1A0360CA192A7FCC00E44B68 = { 220 | TestTargetID = 1A0360AF192A7FCC00E44B68; 221 | }; 222 | }; 223 | }; 224 | buildConfigurationList = 1A0360AB192A7FCC00E44B68 /* Build configuration list for PBXProject "EmbedlyDemo" */; 225 | compatibilityVersion = "Xcode 3.2"; 226 | developmentRegion = English; 227 | hasScannedForEncodings = 0; 228 | knownRegions = ( 229 | en, 230 | ); 231 | mainGroup = 1A0360A7192A7FCC00E44B68; 232 | productRefGroup = 1A0360B1192A7FCC00E44B68 /* Products */; 233 | projectDirPath = ""; 234 | projectRoot = ""; 235 | targets = ( 236 | 1A0360AF192A7FCC00E44B68 /* EmbedlyDemo */, 237 | 1A0360CA192A7FCC00E44B68 /* EmbedlyDemoTests */, 238 | ); 239 | }; 240 | /* End PBXProject section */ 241 | 242 | /* Begin PBXResourcesBuildPhase section */ 243 | 1A0360AE192A7FCC00E44B68 /* Resources */ = { 244 | isa = PBXResourcesBuildPhase; 245 | buildActionMask = 2147483647; 246 | files = ( 247 | 1A0360BE192A7FCC00E44B68 /* InfoPlist.strings in Resources */, 248 | 1A0360C6192A7FCC00E44B68 /* Images.xcassets in Resources */, 249 | 1A036118192A956500E44B68 /* Storyboard.storyboard in Resources */, 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | 1A0360C9192A7FCC00E44B68 /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 1A0360D7192A7FCC00E44B68 /* InfoPlist.strings in Resources */, 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | }; 261 | /* End PBXResourcesBuildPhase section */ 262 | 263 | /* Begin PBXShellScriptBuildPhase section */ 264 | 5232DB6E82E24C679100F66F /* Copy Pods Resources */ = { 265 | isa = PBXShellScriptBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | ); 269 | inputPaths = ( 270 | ); 271 | name = "Copy Pods Resources"; 272 | outputPaths = ( 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | shellPath = /bin/sh; 276 | shellScript = "\"${SRCROOT}/../Pods/Pods-EmbedlyDemo-resources.sh\"\n"; 277 | showEnvVarsInLog = 0; 278 | }; 279 | AC623EC852C846808C1AFA3F /* Copy Pods Resources */ = { 280 | isa = PBXShellScriptBuildPhase; 281 | buildActionMask = 2147483647; 282 | files = ( 283 | ); 284 | inputPaths = ( 285 | ); 286 | name = "Copy Pods Resources"; 287 | outputPaths = ( 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | shellPath = /bin/sh; 291 | shellScript = "\"${SRCROOT}/../Pods/Pods-EmbedlyDemoTests-resources.sh\"\n"; 292 | showEnvVarsInLog = 0; 293 | }; 294 | D26200C3BFA343DEB4EA0D41 /* Check Pods Manifest.lock */ = { 295 | isa = PBXShellScriptBuildPhase; 296 | buildActionMask = 2147483647; 297 | files = ( 298 | ); 299 | inputPaths = ( 300 | ); 301 | name = "Check Pods Manifest.lock"; 302 | outputPaths = ( 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | shellPath = /bin/sh; 306 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 307 | showEnvVarsInLog = 0; 308 | }; 309 | D296C255F12C412C9E82C12E /* Check Pods Manifest.lock */ = { 310 | isa = PBXShellScriptBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | ); 314 | inputPaths = ( 315 | ); 316 | name = "Check Pods Manifest.lock"; 317 | outputPaths = ( 318 | ); 319 | runOnlyForDeploymentPostprocessing = 0; 320 | shellPath = /bin/sh; 321 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 322 | showEnvVarsInLog = 0; 323 | }; 324 | /* End PBXShellScriptBuildPhase section */ 325 | 326 | /* Begin PBXSourcesBuildPhase section */ 327 | 1A0360AC192A7FCC00E44B68 /* Sources */ = { 328 | isa = PBXSourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | 1A0360C0192A7FCC00E44B68 /* main.m in Sources */, 332 | 1A0360C4192A7FCC00E44B68 /* edemAppDelegate.m in Sources */, 333 | 1A03611B192A9EA500E44B68 /* edemViewController.m in Sources */, 334 | ); 335 | runOnlyForDeploymentPostprocessing = 0; 336 | }; 337 | 1A0360C7192A7FCC00E44B68 /* Sources */ = { 338 | isa = PBXSourcesBuildPhase; 339 | buildActionMask = 2147483647; 340 | files = ( 341 | 1A0360D9192A7FCC00E44B68 /* EmbedlyDemoTests.m in Sources */, 342 | ); 343 | runOnlyForDeploymentPostprocessing = 0; 344 | }; 345 | /* End PBXSourcesBuildPhase section */ 346 | 347 | /* Begin PBXTargetDependency section */ 348 | 1A0360D1192A7FCC00E44B68 /* PBXTargetDependency */ = { 349 | isa = PBXTargetDependency; 350 | target = 1A0360AF192A7FCC00E44B68 /* EmbedlyDemo */; 351 | targetProxy = 1A0360D0192A7FCC00E44B68 /* PBXContainerItemProxy */; 352 | }; 353 | /* End PBXTargetDependency section */ 354 | 355 | /* Begin PBXVariantGroup section */ 356 | 1A0360BC192A7FCC00E44B68 /* InfoPlist.strings */ = { 357 | isa = PBXVariantGroup; 358 | children = ( 359 | 1A0360BD192A7FCC00E44B68 /* en */, 360 | ); 361 | name = InfoPlist.strings; 362 | sourceTree = ""; 363 | }; 364 | 1A0360D5192A7FCC00E44B68 /* InfoPlist.strings */ = { 365 | isa = PBXVariantGroup; 366 | children = ( 367 | 1A0360D6192A7FCC00E44B68 /* en */, 368 | ); 369 | name = InfoPlist.strings; 370 | sourceTree = ""; 371 | }; 372 | /* End PBXVariantGroup section */ 373 | 374 | /* Begin XCBuildConfiguration section */ 375 | 1A0360DA192A7FCC00E44B68 /* Debug */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | ALWAYS_SEARCH_USER_PATHS = NO; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BOOL_CONVERSION = YES; 384 | CLANG_WARN_CONSTANT_CONVERSION = YES; 385 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 386 | CLANG_WARN_EMPTY_BODY = YES; 387 | CLANG_WARN_ENUM_CONVERSION = YES; 388 | CLANG_WARN_INT_CONVERSION = YES; 389 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 390 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 391 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 392 | COPY_PHASE_STRIP = NO; 393 | GCC_C_LANGUAGE_STANDARD = gnu99; 394 | GCC_DYNAMIC_NO_PIC = NO; 395 | GCC_OPTIMIZATION_LEVEL = 0; 396 | GCC_PREPROCESSOR_DEFINITIONS = ( 397 | "DEBUG=1", 398 | "$(inherited)", 399 | ); 400 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 401 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 402 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 403 | GCC_WARN_UNDECLARED_SELECTOR = YES; 404 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 405 | GCC_WARN_UNUSED_FUNCTION = YES; 406 | GCC_WARN_UNUSED_VARIABLE = YES; 407 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 408 | ONLY_ACTIVE_ARCH = YES; 409 | SDKROOT = iphoneos; 410 | TARGETED_DEVICE_FAMILY = "1,2"; 411 | }; 412 | name = Debug; 413 | }; 414 | 1A0360DB192A7FCC00E44B68 /* Release */ = { 415 | isa = XCBuildConfiguration; 416 | buildSettings = { 417 | ALWAYS_SEARCH_USER_PATHS = NO; 418 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 419 | CLANG_CXX_LIBRARY = "libc++"; 420 | CLANG_ENABLE_MODULES = YES; 421 | CLANG_ENABLE_OBJC_ARC = YES; 422 | CLANG_WARN_BOOL_CONVERSION = YES; 423 | CLANG_WARN_CONSTANT_CONVERSION = YES; 424 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 425 | CLANG_WARN_EMPTY_BODY = YES; 426 | CLANG_WARN_ENUM_CONVERSION = YES; 427 | CLANG_WARN_INT_CONVERSION = YES; 428 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 429 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 430 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 431 | COPY_PHASE_STRIP = YES; 432 | ENABLE_NS_ASSERTIONS = NO; 433 | GCC_C_LANGUAGE_STANDARD = gnu99; 434 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 435 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 436 | GCC_WARN_UNDECLARED_SELECTOR = YES; 437 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 438 | GCC_WARN_UNUSED_FUNCTION = YES; 439 | GCC_WARN_UNUSED_VARIABLE = YES; 440 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 441 | SDKROOT = iphoneos; 442 | TARGETED_DEVICE_FAMILY = "1,2"; 443 | VALIDATE_PRODUCT = YES; 444 | }; 445 | name = Release; 446 | }; 447 | 1A0360DD192A7FCC00E44B68 /* Debug */ = { 448 | isa = XCBuildConfiguration; 449 | baseConfigurationReference = C976355D8EE3413B86C7AEAC /* Pods-EmbedlyDemo.xcconfig */; 450 | buildSettings = { 451 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 452 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 453 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 454 | GCC_PREFIX_HEADER = "EmbedlyDemo/EmbedlyDemo-Prefix.pch"; 455 | INFOPLIST_FILE = "EmbedlyDemo/EmbedlyDemo-Info.plist"; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | WRAPPER_EXTENSION = app; 458 | }; 459 | name = Debug; 460 | }; 461 | 1A0360DE192A7FCC00E44B68 /* Release */ = { 462 | isa = XCBuildConfiguration; 463 | baseConfigurationReference = C976355D8EE3413B86C7AEAC /* Pods-EmbedlyDemo.xcconfig */; 464 | buildSettings = { 465 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 466 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 467 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 468 | GCC_PREFIX_HEADER = "EmbedlyDemo/EmbedlyDemo-Prefix.pch"; 469 | INFOPLIST_FILE = "EmbedlyDemo/EmbedlyDemo-Info.plist"; 470 | PRODUCT_NAME = "$(TARGET_NAME)"; 471 | WRAPPER_EXTENSION = app; 472 | }; 473 | name = Release; 474 | }; 475 | 1A0360E0192A7FCC00E44B68 /* Debug */ = { 476 | isa = XCBuildConfiguration; 477 | baseConfigurationReference = C976355D8EE3413B86C7AEAC /* Pods-EmbedlyDemo.xcconfig */; 478 | buildSettings = { 479 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/EmbedlyDemo.app/EmbedlyDemo"; 480 | FRAMEWORK_SEARCH_PATHS = ( 481 | "$(SDKROOT)/Developer/Library/Frameworks", 482 | "$(inherited)", 483 | "$(DEVELOPER_FRAMEWORKS_DIR)", 484 | ); 485 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 486 | GCC_PREFIX_HEADER = "EmbedlyDemo/EmbedlyDemo-Prefix.pch"; 487 | GCC_PREPROCESSOR_DEFINITIONS = ( 488 | "DEBUG=1", 489 | "$(inherited)", 490 | ); 491 | INFOPLIST_FILE = "EmbedlyDemoTests/EmbedlyDemoTests-Info.plist"; 492 | PRODUCT_NAME = "$(TARGET_NAME)"; 493 | TEST_HOST = "$(BUNDLE_LOADER)"; 494 | WRAPPER_EXTENSION = xctest; 495 | }; 496 | name = Debug; 497 | }; 498 | 1A0360E1192A7FCC00E44B68 /* Release */ = { 499 | isa = XCBuildConfiguration; 500 | baseConfigurationReference = C976355D8EE3413B86C7AEAC /* Pods-EmbedlyDemo.xcconfig */; 501 | buildSettings = { 502 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/EmbedlyDemo.app/EmbedlyDemo"; 503 | FRAMEWORK_SEARCH_PATHS = ( 504 | "$(SDKROOT)/Developer/Library/Frameworks", 505 | "$(inherited)", 506 | "$(DEVELOPER_FRAMEWORKS_DIR)", 507 | ); 508 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 509 | GCC_PREFIX_HEADER = "EmbedlyDemo/EmbedlyDemo-Prefix.pch"; 510 | INFOPLIST_FILE = "EmbedlyDemoTests/EmbedlyDemoTests-Info.plist"; 511 | PRODUCT_NAME = "$(TARGET_NAME)"; 512 | TEST_HOST = "$(BUNDLE_LOADER)"; 513 | WRAPPER_EXTENSION = xctest; 514 | }; 515 | name = Release; 516 | }; 517 | /* End XCBuildConfiguration section */ 518 | 519 | /* Begin XCConfigurationList section */ 520 | 1A0360AB192A7FCC00E44B68 /* Build configuration list for PBXProject "EmbedlyDemo" */ = { 521 | isa = XCConfigurationList; 522 | buildConfigurations = ( 523 | 1A0360DA192A7FCC00E44B68 /* Debug */, 524 | 1A0360DB192A7FCC00E44B68 /* Release */, 525 | ); 526 | defaultConfigurationIsVisible = 0; 527 | defaultConfigurationName = Release; 528 | }; 529 | 1A0360DC192A7FCC00E44B68 /* Build configuration list for PBXNativeTarget "EmbedlyDemo" */ = { 530 | isa = XCConfigurationList; 531 | buildConfigurations = ( 532 | 1A0360DD192A7FCC00E44B68 /* Debug */, 533 | 1A0360DE192A7FCC00E44B68 /* Release */, 534 | ); 535 | defaultConfigurationIsVisible = 0; 536 | defaultConfigurationName = Release; 537 | }; 538 | 1A0360DF192A7FCC00E44B68 /* Build configuration list for PBXNativeTarget "EmbedlyDemoTests" */ = { 539 | isa = XCConfigurationList; 540 | buildConfigurations = ( 541 | 1A0360E0192A7FCC00E44B68 /* Debug */, 542 | 1A0360E1192A7FCC00E44B68 /* Release */, 543 | ); 544 | defaultConfigurationIsVisible = 0; 545 | defaultConfigurationName = Release; 546 | }; 547 | /* End XCConfigurationList section */ 548 | }; 549 | rootObject = 1A0360A8192A7FCC00E44B68 /* Project object */; 550 | } 551 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo.xcodeproj/xcuserdata/anrope.xcuserdatad/xcschemes/EmbedlyDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo.xcodeproj/xcuserdata/anrope.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | EmbedlyDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1A0360AF192A7FCC00E44B68 16 | 17 | primary 18 | 19 | 20 | 1A0360CA192A7FCC00E44B68 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/EmbedlyDemo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.embedly.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Storyboard 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/EmbedlyDemo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/Storyboard.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 90 | 97 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/edemAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // edemAppDelegate.h 3 | // EmbedlyDemo 4 | // 5 | // Created by Andrew Pellett on 5/19/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface edemAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/edemAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // edemAppDelegate.m 3 | // EmbedlyDemo 4 | // 5 | // Created by Andrew Pellett on 5/19/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import "edemAppDelegate.h" 10 | #import 11 | 12 | @implementation edemAppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | //self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | // Override point for customization after application launch. 18 | //self.window.backgroundColor = [UIColor whiteColor]; 19 | //[self.window makeKeyAndVisible]; 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application 24 | { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 27 | } 28 | 29 | - (void)applicationDidEnterBackground:(UIApplication *)application 30 | { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | - (void)applicationWillEnterForeground:(UIApplication *)application 36 | { 37 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | - (void)applicationDidBecomeActive:(UIApplication *)application 41 | { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | - (void)applicationWillTerminate:(UIApplication *)application 46 | { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/edemViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // edemViewController.h 3 | // EmbedlyDemo 4 | // 5 | // Created by Andrew Pellett on 5/19/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface edemViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UITextView *urlResponse; 14 | @property (weak, nonatomic) IBOutlet UITextField *urlField; 15 | @property (weak, nonatomic) IBOutlet UITextField *optimizeImagesField; 16 | @property (weak, nonatomic) IBOutlet UISegmentedControl *endpointChooser; 17 | @property (weak, nonatomic) IBOutlet UILabel *urlProvider; 18 | @property (weak, nonatomic) IBOutlet UILabel *urlTitle; 19 | 20 | - (IBAction)urlChanged:(id)sender; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/edemViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // edemViewController.m 3 | // EmbedlyDemo 4 | // 5 | // Created by Andrew Pellett on 5/19/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import "edemViewController.h" 10 | #import 11 | 12 | @interface edemViewController () 13 | 14 | @end 15 | 16 | @implementation edemViewController 17 | 18 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 19 | { 20 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 21 | if (self) { 22 | // Custom initialization 23 | } 24 | return self; 25 | } 26 | 27 | - (void)viewDidLoad 28 | { 29 | [super viewDidLoad]; 30 | // Do any additional setup after loading the view. 31 | 32 | self.urlField.text = @"embed.ly"; 33 | [self urlChanged:nil]; 34 | } 35 | 36 | - (void)didReceiveMemoryWarning 37 | { 38 | [super didReceiveMemoryWarning]; 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | /* 43 | #pragma mark - Navigation 44 | 45 | // In a storyboard-based application, you will often want to do a little preparation before navigation 46 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 47 | { 48 | // Get the new view controller using [segue destinationViewController]. 49 | // Pass the selected object to the new view controller. 50 | } 51 | */ 52 | 53 | - (IBAction)urlChanged:(id)sender { 54 | NSLog(@"url changed %@", self.urlField.text); 55 | self.urlResponse.text = self.urlField.text; 56 | [self.urlField endEditing:true]; 57 | [self.optimizeImagesField endEditing:true]; 58 | 59 | NSInteger endpointIndex = self.endpointChooser.selectedSegmentIndex; 60 | NSString *endpoint; 61 | if (endpointIndex == 0) { 62 | endpoint = @"/1/oembed"; 63 | } else { 64 | endpoint = @"/1/extract"; 65 | } 66 | 67 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self]; 68 | 69 | if ([self.optimizeImagesField.text isEqual:@"0"]) { 70 | [e callEmbedlyApi:endpoint withUrl:self.urlField.text params:nil]; 71 | } else { 72 | [e callEmbedlyApi:endpoint withUrl:self.urlField.text params:@{@"image_width": self.optimizeImagesField.text}]; 73 | } 74 | } 75 | 76 | - (void)embedlyFailure:(NSString *)callUrl withError:(NSError *)error endpoint:(NSString *)endpoint operation:(AFHTTPRequestOperation *)operation { 77 | NSLog(@"embedly failure %@", callUrl); 78 | } 79 | 80 | - (void)embedlySuccess:(NSString *)callUrl withResponse:(id)response endpoint:(NSString *)endpoint operation:(AFHTTPRequestOperation *)operation { 81 | NSLog(@"embedly success %@, %@", callUrl, [response description]); 82 | self.urlResponse.text = [response description]; 83 | self.urlTitle.text = [response objectForKey:@"title"]; 84 | self.urlProvider.text = [response objectForKey:@"provider_name"]; 85 | } 86 | @end 87 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // EmbedlyDemo 4 | // 5 | // Created by Andrew Pellett on 5/19/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "edemAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([edemAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemoTests/EmbedlyDemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.embedly.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemoTests/EmbedlyDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // EmbedlyDemoTests.m 3 | // EmbedlyDemoTests 4 | // 5 | // Created by Andrew Pellett on 5/19/14. 6 | // Copyright (c) 2014 Embedly. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface EmbedlyDispatch : NSObject 13 | 14 | @property (copy) void (^handleResponse)(NSInteger responseCode, id response); 15 | 16 | - (void)initWithResponder:(void(^)(NSInteger responseCode, id response))responderBlock; 17 | 18 | @end 19 | 20 | @implementation EmbedlyDispatch 21 | 22 | - (void)initWithResponder:(void(^)(NSInteger responseCode, id response))responderBlock 23 | { 24 | self.handleResponse = responderBlock; 25 | } 26 | 27 | - (void)embedlyFailure:(NSString *)callUrl withError:(NSError *)error endpoint:(NSString *)endpoint operation:(id)operation 28 | { 29 | //XCTFail(@"This shouldn't happen \"%s\"", __PRETTY_FUNCTION__); 30 | } 31 | 32 | - (void)embedlySuccess:(NSString *)callUrl withResponse:(id)response endpoint:(NSString *)endpoint operation:(id)operation 33 | { 34 | self.handleResponse(200, response); 35 | } 36 | 37 | @end 38 | 39 | @interface EmbedlyDemoTests : XCTestCase 40 | 41 | @property EmbedlyDispatch *dis; 42 | 43 | @end 44 | 45 | @implementation EmbedlyDemoTests 46 | 47 | - (void)setUp 48 | { 49 | [super setUp]; 50 | // Put setup code here. This method is called before the invocation of each test method in the class. 51 | 52 | self.dis = [EmbedlyDispatch alloc]; 53 | } 54 | 55 | - (void)tearDown 56 | { 57 | // Put teardown code here. This method is called after the invocation of each test method in the class. 58 | [super tearDown]; 59 | } 60 | 61 | /* 62 | - (void)testExample 63 | { 64 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 65 | } 66 | */ 67 | 68 | - (void)testSingleUrl 69 | { 70 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self.dis]; 71 | 72 | NSString *callUrl = [e callEmbedlyApi:@"/1/oembed" withUrl:@"embed.ly" params:nil]; 73 | 74 | XCTAssertEqualObjects(callUrl, 75 | @"http://api.embed.ly/1/oembed?key=mykey&url=embed.ly", 76 | "test single url"); 77 | 78 | /* 79 | [self.dis initWithResponder:^(NSInteger responseCode, id response) { 80 | NSLog(@"test got responseCode response %ld, %@", (long)responseCode, response); 81 | }]; 82 | */ 83 | } 84 | 85 | - (void)testEmbed 86 | { 87 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self.dis]; 88 | 89 | NSString *callUrl = [e callEmbed:@"embed.ly" params:nil optimizeImages:200]; 90 | 91 | XCTAssertEqualObjects(callUrl, 92 | @"http://api.embed.ly/1/oembed?key=mykey&url=embed.ly&image_width=200", 93 | "test embed"); 94 | } 95 | 96 | - (void)testExtract 97 | { 98 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self.dis]; 99 | 100 | NSString *callUrl = [e callExtract:@"embed.ly" params:nil optimizeImages:200]; 101 | 102 | XCTAssertEqualObjects(callUrl, 103 | @"http://api.embed.ly/1/extract?key=mykey&url=embed.ly&image_width=200", 104 | "test embed"); 105 | } 106 | 107 | - (void)testDisplay 108 | { 109 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self.dis]; 110 | 111 | NSString *call = [e buildDisplayUrl:@"/1/display/resize" withUrl:@"http://embed.ly/static/images/office/DSC_0157.JPG" params:@{@"width": @"200"}]; 112 | 113 | XCTAssertEqualObjects(call, 114 | @"http://i.embed.ly/1/display/resize?width=200&key=mykey&url=http://embed.ly/static/images/office/DSC_0157.JPG", 115 | "test display call"); 116 | } 117 | 118 | - (void)testResize 119 | { 120 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self.dis]; 121 | 122 | NSString *resize = [e buildResizedImageUrl:@"http://embed.ly/static/images/office/DSC_0157.JPG" width:200]; 123 | 124 | XCTAssertEqualObjects(resize, 125 | @"http://i.embed.ly/1/display/resize?key=mykey&url=http://embed.ly/static/images/office/DSC_0157.JPG&width=200", 126 | "test resize call"); 127 | } 128 | 129 | - (void)testParams 130 | { 131 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self.dis]; 132 | 133 | NSString *call = [e buildDisplayUrl:@"/1/display/resize" withUrl:@"http://embed.ly/static/images/office/DSC_0157.JPG" params:@{@"width": @"200", @"height": @"200", @"grow": @"false"}]; 134 | 135 | XCTAssertEqualObjects(call, 136 | @"http://i.embed.ly/1/display/resize?width=200&grow=false&key=mykey&url=http://embed.ly/static/images/office/DSC_0157.JPG&height=200", 137 | "test params"); 138 | } 139 | 140 | @end 141 | -------------------------------------------------------------------------------- /Example/EmbedlyDemo/EmbedlyDemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | xcodeproj 'EmbedlyDemo/EmbedlyDemo.xcodeproj' 2 | 3 | target "EmbedlyDemo" do 4 | pod "embedly-ios", :path => "../" 5 | end 6 | 7 | target "EmbedlyDemoTests" do 8 | pod "embedly-ios", :path => "../" 9 | end 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # embedly-ios 2 | 3 | [![Version](http://cocoapod-badges.herokuapp.com/v/embedly-ios/badge.png)](http://cocoadocs.org/docsets/embedly-ios) 4 | [![Platform](http://cocoapod-badges.herokuapp.com/p/embedly-ios/badge.png)](http://cocoadocs.org/docsets/embedly-ios) 5 | 6 | ## Usage 7 | 8 | The Embedly iOS library gives you access to all of Embedly's APIs, but there are two different ways to interact with the APIs: 9 | 10 | - Embed, Extract, and legacy APIs are available through the call{EmbedlyApi,Embed,Extract,...} methods, which initiate an HTTP call which invokes the corresponding delegate method (embedly{Success,Failure}) upon completion. 11 | 12 | - The Display API is different. The build{DisplayUrl,CroppedImageUrl,...} methods simply return an NSString containing the URL for the manipulated image via the Embedly Display API. You can use this URL wherever you would use any other image address (e.g. AFNetworking+UIImage). 13 | 14 | The call{EmbedlyApi,Embed,...} methods use delegation to return the result of the API call, so your code will need to implement the EmbedlyDelegate protocol. The API response is returned in 'response', which can be accessed as an NSDictionary. 15 | 16 | To make it simpler to cache API calls within your app, the call{EmbedlyApi,Embed,...} functions return a string containing the full Embedly API call. You can use this as a key to store API responses (e.g. in an NSDictionary). This return value is also useful in debugging an API call. 17 | 18 | To make batch API calls (multiple URLs at the same time), you can use the callEmbedlyApi:withUrls:params: method, which takes an NSArray of NSStrings. In this case, the API response returned in 'response' can be accessed as an NSArray of NSDictionarys. 19 | 20 | ## Example 21 | 22 | A complete example app is available in the Example directory of this repo. Here are some quick examples: 23 | 24 | ```objc 25 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self]; 26 | NSString *callUrl = [e callEmbed:@"techcrunch.com/embedly" params:@{@"chars": @"120"} optimizeImages:640]; 27 | 28 | // within embedlySuccess:withResponse:endpoint:operation: 29 | self.urlTitle.text = [response objectForKey:@"title"]; 30 | self.urlProvider.text = [response objectForKey:@"provider_name"]; 31 | self.urlDescription.text = [response objectForKey:@"description"]; 32 | ``` 33 | 34 | ```objc 35 | Embedly *e = [[Embedly alloc] initWithKey:@"mykey" delegate:self]; 36 | NSString *resizedImageUrl = [e buildResizedImageUrl:@"http://embed.ly/static/images/office/DSC_0157.JPG" width:250]; 37 | NSString *croppedImageUrl = [e buildCroppedImageUrl:@"http://embed.ly/static/images/office/DSC_0123.JPG" width:100 height:100]; 38 | NSString *filledImageUrl = [e buildDisplayUrl:@"/1/display/fill" withUrl:@"http://embed.ly/static/images/office/DSC_0161.JPG" params:@{@"width": @"500", @"height": @"500", @"color": @"1bd9f5"}]; 39 | ``` 40 | 41 | ## Requirements 42 | 43 | All of Embedly's products are free to use up to a limit, you just need to sign up for an API key at: 44 | 45 | https://app.embed.ly/signup 46 | 47 | Make sure to include your API key when you initialize the Embedly object. 48 | 49 | If your app is doing well and you need more usage, you can learn more about our plans at: 50 | 51 | http://embed.ly/api 52 | 53 | ## Installation 54 | 55 | embedly-ios is available through [CocoaPods](http://cocoapods.org), to install 56 | it simply add the following line to your Podfile: 57 | 58 | pod "embedly-ios" 59 | 60 | To run the example project; clone the repo, and run `pod install` from the Example directory first. You will need to add your Embedly API key to the initWithKey:delegate: method (replace "mykey" with your API key). 61 | 62 | ## Author 63 | 64 | @embedly 65 | 66 | ## License 67 | 68 | embedly-ios is available under the MIT license. See the LICENSE file for more info. 69 | 70 | -------------------------------------------------------------------------------- /embedly-ios.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "embedly-ios" 3 | s.version = "1.0.0" 4 | s.summary = "An iOS library for interacting with Embedly's suite of APIs." 5 | s.description = <<-DESC 6 | An iOS library for interacting with Embedly's suite of APIs. 7 | 8 | More info at github.com/embedly/embedly-ios and embed.ly/docs 9 | DESC 10 | s.homepage = "http://embed.ly/docs" 11 | s.license = 'MIT' 12 | s.author = { "Andy Pellett" => "andy@embed.ly" } 13 | s.source = { :git => "https://github.com/embedly/embedly-ios.git", :tag => s.version.to_s } 14 | s.social_media_url = 'https://twitter.com/embedly' 15 | 16 | s.platform = :ios, '6.0' 17 | s.ios.deployment_target = '6.0' 18 | s.requires_arc = true 19 | 20 | s.source_files = 'Classes/Embedly.{h,m}' 21 | 22 | s.public_header_files = 'Classes/Embedly.h' 23 | s.dependency 'AFNetworking', '~> 2.0' 24 | end 25 | -------------------------------------------------------------------------------- /icon114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embedly/embedly-ios/88c529350b7aaf98aa49dba800581ce40864f074/icon114x114.png -------------------------------------------------------------------------------- /icon57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/embedly/embedly-ios/88c529350b7aaf98aa49dba800581ce40864f074/icon57x57.png --------------------------------------------------------------------------------