Reputation: 41
I'm trying to make account linking with Google sign-in Linking type. For conversation using Dialogflow. To get user information, fulfillment in node.js was written, using this guide https://developers.google.com/actions/identity/google-sign-in. But when authorization occurs and every time I call any intent on backend, it throw next error: screenshot
Below is my fulfillment code.
`const app = dialogflow({debug: false, clientId: CLIENT_ID});
app.intent('Default Welcome Intent', (conv) => {
conv.ask('Welcome to number echo! Say a number.');
});
app.intent('Default Fallback Intent', conv => {
conv.ask(`I didn't understand. Can you tell me something else?`)
});
app.intent("Start Signin", conv => {
conv.ask(new SignIn("Sure"));
});
app.intent("Finish login", async (conv, params, signin) => {
if (signin.status === "OK") {
const {payload} = conv.user.profile;
conv.ask(`${payload.given_name}, now you are signed in.`);
} else {
conv.ask("You need to sign in to personalize.");
}
});
app.intent("Show User Profile", async conv => {
const {payload} = conv.user.profile;
if (payload) {
conv.ask("Below is your profile information:");
conv.ask(`Your first name is ${payload.given_name};\nYour last name is ${payload.family_name};\nYour email address is ${payload.email}`);
} else {
conv.ask("Not signed in yet.");
conv.ask(new SignIn("To personalize"));
}
});`
I expect executing without error but there is an error below: Error: Wrong recipient, payload audience != requiredAudience
Please, help me if you familiar with this error.
Upvotes: 1
Views: 3089
Reputation: 41
The problem has been resolved. This was caused by a wrong client_id parameter in dialogflow({debug: false, clientId: CLIENT_ID});
Upvotes: 3