Search code examples
dialogflow-esactions-on-googledialogflow-es-fulfillmentfulfillment

Account Linking Actions On Google


After Sign is done, my output for "Get Signin" intent is not displayed. Using Google-Sign in

app.intent("redeem", (conv) => {
  conv.ask(new SignIn("To redeem "));
})

app.intent("Get Signin", (conv, params, signin) => {
  if (signin.status === 'OK') {
    const payload = conv.user.profile.payload;
    conv.ask(`I got your account details ${payload.name} , how would you like to redeem? `)
    conv.ask(new Suggestions(['QR code'], ['code']));
  }
  else {
    conv.close("Please sign in to redeem");
  }
})

After a successful sign in I get this message: enter image description here

Dialogflow Get Signin (top part): top part

Dialogflow Get Signin (bottom part): bottom part


Solution

  • When the Sign-In completes, it triggers the actions_intent_SIGN_IN Dialogflow event. So your "Get Signin" Intent needs to have this set in the Event field, with no training phrases.

    It might look something like this Illustration of Event field

    Since you don't have an Event or Training phrases set, that Intent will never be triggered. Instead, when the Sign-in completes, Actions will send the Event, but since there is nothing setup to handle the event in Dialogflow, it will fail to do anything, so it will exit with the error about not responding.