From 33d4e24519afd7a2cc3250a9cb4e768b67a1a4a1 Mon Sep 17 00:00:00 2001 From: Phil Jirsa Date: Tue, 9 Feb 2021 14:41:33 -0700 Subject: [PATCH] Add location coords to initconversation --- public/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/index.js b/public/index.js index d44cb552..40575d3a 100644 --- a/public/index.js +++ b/public/index.js @@ -76,6 +76,16 @@ function initBotConversation() { if (tokenPayload.directLineURI) { domain = "https://" + tokenPayload.directLineURI + "/v3/directline"; } + let location = undefined; + if (tokenPayload.location) { + location = tokenPayload.location; + } else { + // set default location if desired + /*location = { + lat: 44.86448450671394, + long: -93.32597021107624 + }*/ + } var botConnection = window.WebChat.createDirectLine({ token: tokenPayload.connectorToken, domain: domain @@ -109,6 +119,7 @@ function initBotConversation() { triggeredScenario: { trigger: "{scenario_id}", args: { + location: location, myVar1: "{custom_arg_1}", myVar2: "{custom_arg_2}" }