{"__v":0,"_id":"588861fb165af631008ee20c","category":{"version":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","_id":"588861fa165af631008ee1bd","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-11T10:01:00.892Z","from_sync":false,"order":4,"slug":"android-app-triggers","title":"Android / App triggers"},"parentDoc":null,"project":"54861bb654b3ce0b00367292","user":"548d74b716fc980b00e2a786","version":{"__v":1,"_id":"588861fa165af631008ee1b8","project":"54861bb654b3ce0b00367292","createdAt":"2017-01-25T08:29:46.061Z","releaseDate":"2017-01-25T08:29:46.061Z","categories":["588861fa165af631008ee1b9","588861fa165af631008ee1ba","588861fa165af631008ee1bb","588861fa165af631008ee1bc","588861fa165af631008ee1bd","588861fa165af631008ee1be","588861fa165af631008ee1bf","588861fa165af631008ee1c0","588861fa165af631008ee1c1","588861fa165af631008ee1c2","588861fa165af631008ee1c3","588861fa165af631008ee1c4","588861fa165af631008ee1c5","588861fa165af631008ee1c6","588861fa165af631008ee1c7","588861fa165af631008ee1c8","588861fa165af631008ee1c9"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"5.0.0","version":"5.0"},"updates":["58637e0e679d4b2300af1df3","58637e2811ec752300d5fe0d","58637e61dfe6cc3700a7be7c"],"next":{"pages":[],"description":""},"createdAt":"2016-09-11T11:39:57.410Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":41,"body":"The following code represents the moment and can be created separately and called later on\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"elasticode.showAppTrigger(\\\"TriggerName\\\");\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nReturn to the dashboard and create the right audiences and additional​ experiences for this moment\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Advance usage\"\n}\n[/block]\n** Programmatically close a moment**\nAlthough any dashboard action can achieve this, you can also programmatically close any moment, and learn if it was completed successfully\n\n\nCompletion with goal \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"elasticode.endAppTriggerWithCompletion(true);\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\nThe following completion block is available as well:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"elasticode.endAppTriggerWithCompletionAfterDismissBlock(true, \\n                                                        new DismissBlock() {\\n\\t:::at:::Override\\n  public void perform() {\\n                    \\n  }\\n});\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]","excerpt":"A walkthrough, support flow, tour and more","slug":"running-apptriggers","type":"basic","title":"Running appTriggers"}

Running appTriggers

A walkthrough, support flow, tour and more

The following code represents the moment and can be created separately and called later on [block:code] { "codes": [ { "code": "elasticode.showAppTrigger(\"TriggerName\");", "language": "java" } ] } [/block] Return to the dashboard and create the right audiences and additional​ experiences for this moment [block:api-header] { "type": "basic", "title": "Advance usage" } [/block] ** Programmatically close a moment** Although any dashboard action can achieve this, you can also programmatically close any moment, and learn if it was completed successfully Completion with goal [block:code] { "codes": [ { "code": "elasticode.endAppTriggerWithCompletion(true);", "language": "java" } ] } [/block] The following completion block is available as well: [block:code] { "codes": [ { "code": "elasticode.endAppTriggerWithCompletionAfterDismissBlock(true, \n new DismissBlock() {\n\t@Override\n public void perform() {\n \n }\n});", "language": "java" } ] } [/block]