{"__v":12,"_id":"56f014b011415c2900969b8b","api":{"auth":"never","params":[],"results":{"codes":[]},"settings":"","url":""},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Implementing the Elasticode framework in 4 simple steps\"\n}\n[/block]\n**1. Drag the Elasticode.framework into your Xcode project**\n\n**2. Add the following libraries to your project:**\n  * *AVFoundation.framework*\n  * *Security.framework*\n  * *SystemConfiguration.framework*\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"2.1 For SWiFT Users\",\n  \"body\": \"Create a bridging header: (to support Objective-C in swift project)\\n\\n1.  Create a dummy Objective-C object file (e.g., dummyFile.m) in your project.\\n2. Xcode will ask you whether you want to create a bridging header, click \\\"Yes\\\".\\n(There have been settings changes in the project file, as well, to get Swift to look to this new header for information)\\n\\n( You can now delete dummyFile.m)\"\n}\n[/block]\n \n\n**3. Add the following import code**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"//in AppDelegate.h\\n#import <ElastiCode/ElastiCode.h>\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"// In the bridging header file\\n#import <ElastiCode/ElastiCode.h>\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"On iOS 9\",\n  \"body\": \"On iOS 9, add App Transport Security Settings exceptions to application's plist.\"\n}\n[/block]\nWhitelist our domains:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<key>NSAppTransportSecurity</key>\\n<dict>\\n\\t<key>NSExceptionDomains</key>\\n  <dict>\\n  \\t<key>appove-api.com</key>\\n    <dict>\\n    \\t<key>NSIncludesSubdomains</key>\\n      <true/>\\n      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>\\n      <true/>\\n    </dict>\\n  </dict>\\n</dict>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/S4DSvbHBQv6DmVT2v0yj_addHTTP2_4_2.gif\",\n        \"addHTTP2_4_2.gif\",\n        \"877\",\n        \"751\",\n        \"#3a7dc7\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n**4. Finally, add the following code to your appDelegate** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\\n   // Override point for customization after application launch.\\n        [ElastiCode startSessionWithParams:\\n         [ECSessionParams createWithAPIKey::::at:::\\\"your-api-key\\\" inProduction:NO]];    \\n  return YES;\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"class AppDelegate: UIResponder, UIApplicationDelegate {\\nvar window: UIWindow?\\n\\nfunc application(application: UIApplication, didFinishLaunchingWithOptions\\n       launchOptions: [NSObject: AnyObject]?) -> Bool {\\n   // Override point for customization after application launch.\\n   ElastiCode .startSessionWithParams(\\n   ECSessionParams .createWithAPIKey(\\\"your-api-key\\\", inProduction: false))\\n\\n        return true\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Process completed.\"\n}\n[/block]\nRefresh the dashboard to begin adding your experiences.","category":"56f162743eb62a34003e9f42","createdAt":"2014-12-09T11:59:00.145Z","excerpt":"","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"parentDoc":null,"project":"54861bb654b3ce0b00367292","slug":"sdk-intro","sync_unique":"","title":"Elasticode Setup","type":"basic","updates":[],"user":"54861b9f3681d914006992a4","version":"56f014b011415c2900969b80","childrenPages":[]}
[block:api-header] { "type": "basic", "title": "Implementing the Elasticode framework in 4 simple steps" } [/block] **1. Drag the Elasticode.framework into your Xcode project** **2. Add the following libraries to your project:** * *AVFoundation.framework* * *Security.framework* * *SystemConfiguration.framework* [block:callout] { "type": "info", "title": "2.1 For SWiFT Users", "body": "Create a bridging header: (to support Objective-C in swift project)\n\n1. Create a dummy Objective-C object file (e.g., dummyFile.m) in your project.\n2. Xcode will ask you whether you want to create a bridging header, click \"Yes\".\n(There have been settings changes in the project file, as well, to get Swift to look to this new header for information)\n\n( You can now delete dummyFile.m)" } [/block] **3. Add the following import code** [block:code] { "codes": [ { "code": "//in AppDelegate.h\n#import <ElastiCode/ElastiCode.h>", "language": "objectivec" }, { "code": "// In the bridging header file\n#import <ElastiCode/ElastiCode.h>", "language": "swift" } ] } [/block] [block:callout] { "type": "warning", "title": "On iOS 9", "body": "On iOS 9, add App Transport Security Settings exceptions to application's plist." } [/block] Whitelist our domains: [block:code] { "codes": [ { "code": "<key>NSAppTransportSecurity</key>\n<dict>\n\t<key>NSExceptionDomains</key>\n <dict>\n \t<key>appove-api.com</key>\n <dict>\n \t<key>NSIncludesSubdomains</key>\n <true/>\n <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>\n <true/>\n </dict>\n </dict>\n</dict>", "language": "xml" } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/S4DSvbHBQv6DmVT2v0yj_addHTTP2_4_2.gif", "addHTTP2_4_2.gif", "877", "751", "#3a7dc7", "" ] } ] } [/block] **4. Finally, add the following code to your appDelegate** [block:code] { "codes": [ { "code": "- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {\n // Override point for customization after application launch.\n [ElastiCode startSessionWithParams:\n [ECSessionParams createWithAPIKey:@\"your-api-key\" inProduction:NO]]; \n return YES;\n}", "language": "objectivec" }, { "code": "class AppDelegate: UIResponder, UIApplicationDelegate {\nvar window: UIWindow?\n\nfunc application(application: UIApplication, didFinishLaunchingWithOptions\n launchOptions: [NSObject: AnyObject]?) -> Bool {\n // Override point for customization after application launch.\n ElastiCode .startSessionWithParams(\n ECSessionParams .createWithAPIKey(\"your-api-key\", inProduction: false))\n\n return true\n}", "language": "swift" } ] } [/block] [block:api-header] { "type": "basic", "title": "Process completed." } [/block] Refresh the dashboard to begin adding your experiences.