{"__v":23,"_id":"565f1bb623fd5f0d00a12a51","category":{"__v":18,"_id":"562014108a05d7230006ffad","pages":["562014118a05d7230006ffb6","562014118a05d7230006ffb7","562014118a05d7230006ffb8","562014118a05d7230006ffb9","562014118a05d7230006ffba","562014118a05d7230006ffbb","562014118a05d7230006ffbc","562014118a05d7230006ffbd","562014118a05d7230006ffbe","562014118a05d7230006ffbf","562014118a05d7230006ffc0","5620146f8a05d72300070013","565ed96ff76b8d0d0055422b","565f1bb623fd5f0d00a12a51","565f2996413e06170093de98","565f29db0dc99e1900f24ba8","565f2b23649b951900c89724","565f2b5d413e06170093de9e","5666d8b46819320d000c2e10","5666dd1866debc1700503e38","5666e3da5d00370d00ede577","5666ef36f672550d000851aa","5666f1116819320d000c2e3e","5666f7bf6819320d000c2e53","5672d7fe3cab740d00d15a48","56e961cef3c3031900041af4","56ebc03943304e2900e2116f","56f116a0ab5e790e00fb3950"],"project":"54861bb654b3ce0b00367292","version":"5620140f8a05d7230006ffac","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-12-08T21:55:25.679Z","from_sync":false,"order":0,"slug":"1-setup","title":"Onboarding/Moment integration"},"parentDoc":null,"project":"54861bb654b3ce0b00367292","user":"54861b9f3681d914006992a4","version":{"__v":3,"_id":"5620140f8a05d7230006ffac","project":"54861bb654b3ce0b00367292","createdAt":"2015-10-15T21:01:03.908Z","releaseDate":"2015-10-15T21:01:03.908Z","categories":["562014108a05d7230006ffad","562014108a05d7230006ffae","562014108a05d7230006ffaf","562014108a05d7230006ffb0","562014108a05d7230006ffb1","562014108a05d7230006ffb2","562014108a05d7230006ffb3","562014108a05d7230006ffb4","562014108a05d7230006ffb5","5666f7f5d784a70d00397bff","56967935b6d61f0d00acfb0b"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"Moments","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-12-02T16:26:30.297Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Moments are just like onboarding\nSame tools, only you can launch them anywhere you want inside your app!\n\n\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Dashboard setup\"\n}\n[/block]\nIn our dashboard simply add a moment.\n1. Sidebar -> Moments -> \"Add a moment\"\n2. Name your moment ( you can choose a relevant category ) \n3. Choose from our inspiration gallery ( or start with a blank canvas​ ) \n4. Create and edit your experience​\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Client side / Code\"\n}\n[/block]\nOnce done you can \n1. Export an experience to the device as the \"default\" experience [Export an Experience](doc:export-an-experience) [Optional].\n2. \"Define\" the moments you would like to run:\n\n\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Before \\\"starting a session\\\"\",\n  \"body\": \"This method should​ be initiated before starting a new session\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[ElastiCode defineMoment::::at:::\\\"Moment name\\\"];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"ElastiCode .defineMoment(\\\"Moment name\\\")\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n3. Trigger them when you decide to ( click of a button, page load, etc ... )\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Post server feedback\",\n  \"body\": \"You can launch ( \\\"show\\\" ) moments upon receiving an \\\"OK\\\" notification feedback from elasticode servers, More about notifications and feedback could be found under [Handlers & Notifications](doc:handlers-notifications)\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\n[[NSNotificationCenter defaultCenter] addObserver:self \\n selector:@selector(_elasticodeMomentDefined:) name:ELASTICODE_MOMENT_DEFINED object:nil];\\n\\n-(void) _elasticodeMomentDefined:(NSNotification*) note\\n{\\n    NSDictionary* response = [note userInfo];\\n    if(response){\\n        NSString* momentN = [response objectForKey:@\\\"momentName\\\"];\\n        NSNumber* momentS = [response objectForKey:@\\\"dontShow\\\"];\\n        if(![momentS boolValue] && [momentN isEqualToString:@\\\"New feature tour\\\"]){\\n          // Will show the moment as soon as possible\\n          [ElastiCode showMoment:momentN];\\n        }\\n        NSLog(@\\\"Moment defined:%@\\\", momentN);\\n    }\\n}\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \" NSNotificationCenter.defaultCenter()\\n          .addObserver(self, selector: \\\"_elasticodeMomentDefined:\\\", \\n            name: ELASTICODE_MOMENT_DEFINED, object: nil\\n          )\\n          \\nfunc _elasticodeMomentDefined(notif: NSNotification){\\n        if let userInfo:Dictionary<String,AnyObject> = \\n          notif.userInfo as? Dictionary<String,AnyObject>{\\n            let momentN = userInfo[\\\"momentName\\\"] as! String;\\n            let momentS = userInfo[\\\"dontShow\\\"] as! NSNumber;\\n            if(!momentS .boolValue && momentN == \\\"New feature tour\\\"){\\n                // Will show the moment as soon as possible\\n                ElastiCode .showMoment(momentN)\\n            }\\n        }\\n    }          \",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\nThe actual code to show the moment could be separated and called further​ along\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[ElastiCode showMoment:@\\\"Moment name\\\"];\",\n      \"language\": \"objectivec\"\n    },\n    {\n      \"code\": \"ElastiCode .showMoment(\\\"Moment name\\\")\",\n      \"language\": \"swift\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Personalize\"\n}\n[/block]\nNow go back to the dashboard and create the right audiences and additional​ experiences for this moment \n\n\n**And that is it!**","excerpt":"A walkthrough, support flow, tour and more","slug":"moments","type":"basic","title":"Moments"}

Moments

A walkthrough, support flow, tour and more

Moments are just like onboarding Same tools, only you can launch them anywhere you want inside your app! [block:api-header] { "type": "basic", "title": "Dashboard setup" } [/block] In our dashboard simply add a moment. 1. Sidebar -> Moments -> "Add a moment" 2. Name your moment ( you can choose a relevant category ) 3. Choose from our inspiration gallery ( or start with a blank canvas​ ) 4. Create and edit your experience​ [block:api-header] { "type": "basic", "title": "Client side / Code" } [/block] Once done you can 1. Export an experience to the device as the "default" experience [Export an Experience](doc:export-an-experience) [Optional]. 2. "Define" the moments you would like to run: [block:callout] { "type": "warning", "title": "Before \"starting a session\"", "body": "This method should​ be initiated before starting a new session" } [/block] [block:code] { "codes": [ { "code": "[ElastiCode defineMoment:@\"Moment name\"];", "language": "objectivec" }, { "code": "ElastiCode .defineMoment(\"Moment name\")", "language": "swift" } ] } [/block] 3. Trigger them when you decide to ( click of a button, page load, etc ... ) [block:callout] { "type": "warning", "title": "Post server feedback", "body": "You can launch ( \"show\" ) moments upon receiving an \"OK\" notification feedback from elasticode servers, More about notifications and feedback could be found under [Handlers & Notifications](doc:handlers-notifications)" } [/block] [block:code] { "codes": [ { "code": "\n[[NSNotificationCenter defaultCenter] addObserver:self \n selector:@selector(_elasticodeMomentDefined:) name:ELASTICODE_MOMENT_DEFINED object:nil];\n\n-(void) _elasticodeMomentDefined:(NSNotification*) note\n{\n NSDictionary* response = [note userInfo];\n if(response){\n NSString* momentN = [response objectForKey:@\"momentName\"];\n NSNumber* momentS = [response objectForKey:@\"dontShow\"];\n if(![momentS boolValue] && [momentN isEqualToString:@\"New feature tour\"]){\n // Will show the moment as soon as possible\n [ElastiCode showMoment:momentN];\n }\n NSLog(@\"Moment defined:%@\", momentN);\n }\n}", "language": "objectivec" }, { "code": " NSNotificationCenter.defaultCenter()\n .addObserver(self, selector: \"_elasticodeMomentDefined:\", \n name: ELASTICODE_MOMENT_DEFINED, object: nil\n )\n \nfunc _elasticodeMomentDefined(notif: NSNotification){\n if let userInfo:Dictionary<String,AnyObject> = \n notif.userInfo as? Dictionary<String,AnyObject>{\n let momentN = userInfo[\"momentName\"] as! String;\n let momentS = userInfo[\"dontShow\"] as! NSNumber;\n if(!momentS .boolValue && momentN == \"New feature tour\"){\n // Will show the moment as soon as possible\n ElastiCode .showMoment(momentN)\n }\n }\n } ", "language": "swift" } ] } [/block] The actual code to show the moment could be separated and called further​ along [block:code] { "codes": [ { "code": "[ElastiCode showMoment:@\"Moment name\"];", "language": "objectivec" }, { "code": "ElastiCode .showMoment(\"Moment name\")", "language": "swift" } ] } [/block] [block:api-header] { "type": "basic", "title": "Personalize" } [/block] Now go back to the dashboard and create the right audiences and additional​ experiences for this moment **And that is it!**