Closed teminnov closed 6 years ago
Any one know the solution other than calling java script function from java file?
Make sendVoice function as global like
window.sendVoice = function(){
try {
ApiAIPlugin.requestVoice(
{}, // empty for simple requests, some optional parameters can be here
function (response) {
alert(JSON.stringify(response));
},
function (error) {
alert(error);
});
} catch (e) {
alert(e);
}
}
and from java file call the java script function like this
cordova.getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
webView.loadUrl("javascript:sendVoice()");
}
});
Hi, I've integrated dialog flow in my custom plugin. Now i want to initiate the dialog flow methods from my plugin's java file. How can i do this?