{"__v":1,"_id":"57e2324b1e7b7220000d7e9a","category":{"project":"54861bb654b3ce0b00367292","version":"57b96d6b1d08500e00bf81d1","_id":"57df9df05927cb0e002bce1e","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-19T08:12:32.921Z","from_sync":false,"order":7,"slug":"cordova-app-triggers","title":"Cordova / App triggers"},"parentDoc":null,"project":"54861bb654b3ce0b00367292","user":"548d74b716fc980b00e2a786","version":{"__v":7,"_id":"57b96d6b1d08500e00bf81d1","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":false,"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-21T07:10:03.454Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Add backview section\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Currently available only in iOS app\",\n  \"title\": \"iOS only\"\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(\\\"section1\\\");\",\n      \"language\": \"javascript\"\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\": \"onDeviceReady: function() {\\n  app.receivedEvent('deviceready');\\n  \\n  // basic setup - iOS/android key\\n  window.elasticode.setAndroidApiKey(\\\"<AndroidAPIKey>\\\");\\n  window.elasticode.setIOSApiKey(\\\"<iOSAPIKey>\\\");\\n  \\n  // app triggers basic setup\\n  var params = window.elasticode.createSessionParamsObject();\\n  \\n  // Define backView section \\n  params.data.defineBackViewSection(\\\"section1\\\");\\n  \\n  window.elasticode.setSessionParams(false, params);\\n  \\n  window.elasticode.ready();\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"Cordova / App triggers: Backview section setup","slug":"backview-section-setup-1","type":"basic","title":"Backview section setup"}

Backview section setup

Cordova / App triggers: Backview section setup

[block:api-header] { "type": "basic", "title": "Add backview section" } [/block] [block:callout] { "type": "info", "body": "Currently available only in iOS app", "title": "iOS only" } [/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": "javascript" } ] } [/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": "onDeviceReady: function() {\n app.receivedEvent('deviceready');\n \n // basic setup - iOS/android key\n window.elasticode.setAndroidApiKey(\"<AndroidAPIKey>\");\n window.elasticode.setIOSApiKey(\"<iOSAPIKey>\");\n \n // app triggers basic setup\n var params = window.elasticode.createSessionParamsObject();\n \n // Define backView section \n params.data.defineBackViewSection(\"section1\");\n \n window.elasticode.setSessionParams(false, params);\n \n window.elasticode.ready();\n}", "language": "javascript" } ] } [/block]