{"_id":"57d12b975284c90e00cc05d2","project":"54861bb654b3ce0b00367292","user":"54861b9f3681d914006992a4","parentDoc":null,"__v":1,"category":{"_id":"57b96d6b1d08500e00bf81d3","project":"54861bb654b3ce0b00367292","version":"57b96d6b1d08500e00bf81d1","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-08T21:55:25.679Z","from_sync":false,"order":1,"slug":"1-setup","title":"iOS / App Triggers"},"version":{"_id":"57b96d6b1d08500e00bf81d1","__v":7,"project":"54861bb654b3ce0b00367292","createdAt":"2016-08-21T08:59:23.326Z","releaseDate":"2016-08-21T08:59:23.326Z","categories":["57b96d6b1d08500e00bf81d2","57b96d6b1d08500e00bf81d3","57b96d6b1d08500e00bf81d4","57b96d6b1d08500e00bf81d5","57b96d6b1d08500e00bf81d6","57b96d6b1d08500e00bf81d7","57b96d6b1d08500e00bf81d8","57b96d6b1d08500e00bf81d9","57b96d6b1d08500e00bf81da","57b96d6b1d08500e00bf81db","57b96d6b1d08500e00bf81dc","57b97748306b9b0e001dd53f","57d12c6c1227b40e0044908a","57d51ad68191880e008bb51b","57d52b5cf350090e00fe073e","57d5468a17b492170053a3f0","57df9df05927cb0e002bce1e"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"4.0.0","version":"4.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-08T09:12:55.285Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Add backview section\"\n}\n[/block]\nYou are able to provide different backview for different section along your app.\nFor this to happen, we first need you to define what \"backview sections\" you would like to run in your app, Here is how it's done:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[params.data defineBackViewSection::::at:::\\\"section1\\\"];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"params.data .defineBackViewSection(\\\"section1\\\")\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nThis code (as well) should be inserted before initiating a session, here is an example of defining one app trigger and one section : \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions\\n  (NSDictionary *)launchOptions {\\n \\n  // basic setup\\n  [ElastiCode setAPIKey:@\\\"<APIKey>\\\"];\\n  \\n  // app triggers basic setup\\n  ECSessionParams* params = [ECSessionParams createInProduction:NO];\\n  \\n  // Defining a backview section\\n  [params.data defineBackViewSection:@\\\"section1\\\"];\\n \\n  [ElastiCode setSessionParams:params];\\n  [ElastiCode ready];\\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  \\n  // basic setup\\n\\tElastiCode.setAPIKey(\\\"<APIKey>\\\")\\n  \\n  // app triggers basic setup\\n  let params:ECSessionParams = ECSessionParams .createInProduction(false)\\n\\n\\t// Defining a backView section\\n\\tparams.data .defineBackViewSection(\\\"section1\\\")\\n\\n\\tElastiCode.setSessionParams(params)\\n  ElastiCode.ready()\\n  return true\\n}\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]","excerpt":"IOS / APP TRIGGERS: Backview section setup","slug":"backview-section-setup","type":"basic","title":"BackView section setup"}

BackView section setup

IOS / APP TRIGGERS: Backview section setup

[block:api-header] { "type": "basic", "title": "Add backview section" } [/block] You are able to provide different backview for different section along your app. For this to happen, we first need you to define what "backview sections" you would like to run in your app, Here is how it's done: [block:code] { "codes": [ { "code": "[params.data defineBackViewSection:@\"section1\"];", "language": "objectivec" }, { "code": "params.data .defineBackViewSection(\"section1\")", "language": "swift" } ] } [/block] This code (as well) should be inserted before initiating a session, here is an example of defining one app trigger and one section : [block:code] { "codes": [ { "code": "- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions\n (NSDictionary *)launchOptions {\n \n // basic setup\n [ElastiCode setAPIKey:@\"<APIKey>\"];\n \n // app triggers basic setup\n ECSessionParams* params = [ECSessionParams createInProduction:NO];\n \n // Defining a backview section\n [params.data defineBackViewSection:@\"section1\"];\n \n [ElastiCode setSessionParams:params];\n [ElastiCode ready];\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 \n // basic setup\n\tElastiCode.setAPIKey(\"<APIKey>\")\n \n // app triggers basic setup\n let params:ECSessionParams = ECSessionParams .createInProduction(false)\n\n\t// Defining a backView section\n\tparams.data .defineBackViewSection(\"section1\")\n\n\tElastiCode.setSessionParams(params)\n ElastiCode.ready()\n return true\n}", "language": "swift" } ] } [/block]