Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No callback returned when Dialogflow_V2.startListening #63

Open
BenjaminPcrd opened this issue May 9, 2019 · 6 comments
Open

No callback returned when Dialogflow_V2.startListening #63

BenjaminPcrd opened this issue May 9, 2019 · 6 comments

Comments

@BenjaminPcrd
Copy link

BenjaminPcrd commented May 9, 2019

The callback is never returned when startListening

`
<Button onPress={() => {
Dialogflow_V2.onListeningStarted(()=>{
console.log("listening started");
});

      Dialogflow_V2.onListeningCanceled(()=>{
        console.log("listening canceled");
      });

      Dialogflow_V2.onListeningFinished(()=>{
        console.log("listening finished");
      });

      Dialogflow_V2.onAudioLevel(level=>{
        console.log(level);
      });

      Dialogflow_V2.startListening(result=>{
          console.log(result);
      }, error=>{
          console.log(error);
      });
    }} ><Text>start listening</Text></Button>

`

@etcheverryRafael
Copy link

etcheverryRafael commented May 16, 2019

I am experiencing the same in Android (on iOS it works). Did you find a solution?
I have noticed the Dialogflow_V2.onListeningStarted get's called twice.
Also i think that the request is not reaching Dialogflow backend, i haved checked the console on Firebase and there is no record of any request.
Thanks!

@BenjaminPcrd
Copy link
Author

No, I still using the V1 for now.
A solution would be to make a speech-to-text recognition with rn-voice and next, send a text query. I'll try to make it

@etcheverryRafael
Copy link

Yes i though of that too. But it very strange that this is not working, it's the core functionality of the package.

@BenjaminPcrd
Copy link
Author

import Voice from 'react-native-voice';
import { Dialogflow_V2 } from 'react-native-dialogflow';
...

Voice.onSpeechStart = () => console.log("Start")
Voice.onSpeechEnd = () => console.log("End")
Voice.onSpeechError = (err) => console.log("Error", err)

Voice.start('en-US')

Voice.onSpeechResults = (res) => {
  let speech = res.value[0]
  Dialogflow_V2.requestQuery(
    speech,
    result => {
      console.log(result.queryResult.fulfillmentText)
    },
    error => console.log(error)
  );
}

That's works very well

@matheusleite
Copy link

I am experiencing the same error on Android!
Any updates?

@OscarSaro
Copy link

Same issue here in Android, the events works fine but the startListening callback never gets called, and the agent is not receiving anything (I have been looking though the firebase and Dialogflow logs).

The @BenjaminPcrd solution works for me, but is there any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants