I am new in react native and currently, I want to integrate chatbot Dialogflow in react-native but I do not get success with this then please give me some solutions to this step by step
CodePudding user response:
please try with this link chatbot with dialogflow and react-native
hope it will helpful for you.
CodePudding user response:
Here you will have a tutorial! And below will be work for both react native expo and without expo.
https://blog.jscrambler.com/build-a-chatbot-with-dialogflow-and-react-native/
here bellow some code:
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { GiftedChat } from 'react-native-gifted-chat';
import { Dialogflow_V2 } from 'react-native-dialogflow';
import { dialogflowConfig } from './env';
const BOT_USER = {
_id: 2,
name: 'FAQ Bot',
avatar: 'https://i.imgur.com/7k12EPD.png'
};
class App extends Component {
state = {
messages: [
{
_id: 1,
text: `Hi! I am the FAQ bot