{"_id":"57d12ec9be9d0b290027c023","project":"54861bb654b3ce0b00367292","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"},"__v":0,"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"},"parentDoc":null,"user":"54861b9f3681d914006992a4","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-08T09:26:33.843Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"ECSessionParams object has a \"settings\" property for defining the following pre defined settings:\n\n**On launch version** - version string for on launch moment\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"params.settings.onLaunchVersion = :::at:::\\\"1.0\\\";\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"params.settings.onLaunchVersion = \\\"1.0\\\"\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n**Connection timeout**\nThe maximum time the SDK awaits a response.\nDefault value: 20 seconds\n\nPlease see the fallback protocol here: [[Advanced] Response protocol](doc:advanced-response-protocol) \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[params.settings setConnectionTimeout:(20)];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"params.settings.setConnectionTimeout(20)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n**Image connection timeout**\nThe maximum time the SDK awaits image downloads.\nDefault value: 5 seconds per Image\n\nThe fallback protocol is displayed here: [[Advanced] Response protocol](doc:advanced-response-protocol) \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[params.settings setImageDownloadTimeout:(NSUInteger)];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"params.settings. setImageDownloadTimeout(timeout: UInt)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n**Offline mode**\nOffline mode allows you to build experiences and run them locally on your device without connecting to the Elasticode system. To get started, simply export the experiences to your device: [Export an Experience](doc:export-an-experience) )\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Please read before implementing:\",\n  \"body\": \"After using this function, you will not be able to update/change/AB test/personalize in production until the next version is resubmitted​ to production and released.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[params.settings offlineMode];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"params.settings. offlineMode()\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n**Disable onboarding**\nYou can disable On Launch moment all together via your code (you can also do it VIA the dashboard instead) \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[params.settings disableOnLaunch:(BOOL)];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"params.settings. disableOnLaunch(disable: Bool)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n**Disable on Launch on timeout**\nChoose the following to disable offline onboarding after timeout.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Relevant only in case of an offline \\\"app launch moment\\\" on the device\",\n  \"title\": \"When a local default experience is set\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[params.settings onTimeoutDisableOnLaunch:(BOOL)];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"params.settings. onTimeoutDisableOnLaunch(disable: Bool)\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]","excerpt":"IOS / APP TRIGGERS: Extra session settings","slug":"extra-session-settings","type":"basic","title":"Extra session settings"}

Extra session settings

IOS / APP TRIGGERS: Extra session settings

ECSessionParams object has a "settings" property for defining the following pre defined settings: **On launch version** - version string for on launch moment [block:code] { "codes": [ { "code": "params.settings.onLaunchVersion = @\"1.0\";", "language": "objectivec" }, { "code": "params.settings.onLaunchVersion = \"1.0\"", "language": "swift" } ] } [/block] **Connection timeout** The maximum time the SDK awaits a response. Default value: 20 seconds Please see the fallback protocol here: [[Advanced] Response protocol](doc:advanced-response-protocol) [block:code] { "codes": [ { "code": "[params.settings setConnectionTimeout:(20)];", "language": "objectivec" }, { "code": "params.settings.setConnectionTimeout(20)", "language": "swift" } ] } [/block] **Image connection timeout** The maximum time the SDK awaits image downloads. Default value: 5 seconds per Image The fallback protocol is displayed here: [[Advanced] Response protocol](doc:advanced-response-protocol) [block:code] { "codes": [ { "code": "[params.settings setImageDownloadTimeout:(NSUInteger)];", "language": "objectivec" }, { "code": "params.settings. setImageDownloadTimeout(timeout: UInt)", "language": "swift" } ] } [/block] **Offline mode** Offline mode allows you to build experiences and run them locally on your device without connecting to the Elasticode system. To get started, simply export the experiences to your device: [Export an Experience](doc:export-an-experience) ) [block:callout] { "type": "danger", "title": "Please read before implementing:", "body": "After using this function, you will not be able to update/change/AB test/personalize in production until the next version is resubmitted​ to production and released." } [/block] [block:code] { "codes": [ { "code": "[params.settings offlineMode];", "language": "objectivec" }, { "code": "params.settings. offlineMode()", "language": "swift" } ] } [/block] **Disable onboarding** You can disable On Launch moment all together via your code (you can also do it VIA the dashboard instead) [block:code] { "codes": [ { "code": "[params.settings disableOnLaunch:(BOOL)];", "language": "objectivec" }, { "code": "params.settings. disableOnLaunch(disable: Bool)", "language": "swift" } ] } [/block] **Disable on Launch on timeout** Choose the following to disable offline onboarding after timeout. [block:callout] { "type": "info", "body": "Relevant only in case of an offline \"app launch moment\" on the device", "title": "When a local default experience is set" } [/block] [block:code] { "codes": [ { "code": "[params.settings onTimeoutDisableOnLaunch:(BOOL)];", "language": "objectivec" }, { "code": "params.settings. onTimeoutDisableOnLaunch(disable: Bool)", "language": "swift" } ] } [/block]