Using watson developer cloud with react native - react-native

I'm trying to integrate my already created IBM Watson chatbot into my react native mobile application. Any time I import watson-developer-cloud I get an error saying that Node.js standard libraries such as stream are not compatible with Expo. I've seen other people using watson services to create speech to text apps. I don't understand how they are using the services without the watson-developer-cloud package. I've seen some community created packages such as react-native-watson that supposedly can make this happen, but I can't get any of it to work. Is there any way I can make this work or is it impossible? Any suggestions are welcome and appreciated.

Just to help you with some path, for sure you can use React Native to built the UI for your app. But also you need the back-end and communicate with Watson API. (If you want you can use just the fetch from react native, but I really recommend you don't do that if your app will grow with time.
I really recommend you take a look at Watson developer Cloud, and use the Assistant Simple to understand the backend with Node.js. Also try to check the Watson Assistant API documentation.
For summary, you'll create one server with Node.js and express, and create routers in your backend, with theses routes, you gonna use fetch from React native to send HTTP requests to your routes, your backend will call Watson Assistant API and answer. Your fetch will get this response and show that to the user in your U.
Obs.: You can use any language in the backend and Watson Developer Cloud has a lot of examples using Watson Assistant with Java, Python, etc.
See the Official Watson Assistant API documentation.
See the Official use of Fetch in React Native.

Related

How to implement PayPal in Expo ReactNative app using Webview without Nodejs

I am developing an Ecpo ReactNative app and i looking to integrate PayPal to allow users to purchase some products using Webview, but I don't know how to do it. I came across this article: https://medium.com/#adityasingh_32512/integrating-paypal-in-your-react-native-app-4dcf89e11dd which explains how to do it but he uses a nodejs server and i won't necessarily implement a Nodejs server...
I also came across this article: How to integrate Paypal using React Native expo? where they offer other solutions, but which didn't satisfy me.
If you don't use a server integration (nodejs or otherwise), then obviously only client-side JS will be available. Here is a demo pattern of what you can do: https://developer.paypal.com/demo/checkout/#/pattern/client
There's nothing React-specific about it.

React Native & Cosmos DB - How to get them working together?

There seem to be no direct support for React Native through Cosmos DB SDK or npm packages. The JS package #azure/cosmos while works on React Native for the Web, but does not build for the native apps. It fails to build due to Cryto incompatibility.
While Resource Tokens can serve as a solution for authentication, but App still needs to interact with the DB resources using an API.
So, how to go around this? Is utilizing Azure Functions as a mid-tier the only workaround?
Thanks
If you need basic functionality like querying, creating new items etc, you can get the react-native-azure-cosmos package.
However the functionality is a very limited subset of the full JS SDK.
There is no official SDK for now to target react native applications.
You will need to use an API App or Function app to interact with CosmosDB and call the HTTP endpoints from your device.

Flutter and DialogFlow Chatbot

I am trying to make a chatbot for my Flutter app using DialogFlow. At first I used the API V2, and I get this error :
I searched online, and the only answer I found is to switch to "flutter_dialogflow.dart" package instead of the "dialogflow_v2.dart" package everything seemed to work just fine at the first glance, but when I wrote "Hi how are you doing?" the flowing error appears:
P.S: Everything is activated on DialogFlow
Please help! Thank you
Flutter has many advantages so the Flutter apps implementation will be common. Integrating the Dialogflow on the flutter app will be more beneficial and helps to handle the end-user queries most effectively. There are two approaches to incorporating Dialogflow into your Flutter APP.
Create the middleware code and build your own chat UI
Using the REST API, the middleware code is responsible for transferring the message from the Flutter app to the Dialogflow agent and build UI components to send and receive the message. You will probably be really happy to only see text messages going back and forth when you get started. But finally, you may want to add rich answers, such as buttons, clickable hyperlinks, cards, and other rich answers like that. Dialogflow does not as it turns out, has any defaults on this front. Which is a tedious process
Integrate with the Third-party tools
Since Dialogflow does not support the UI to make the bot response, search the platform that will allow you to add the bot to your mobile application. And I recommend using Kommunicate
The Dialogflow bot can be directly integrated with kommunicate and positioned with Flutter by adding Kommunicate dependency pubspec.yaml and import as well as install the package, More detailed instruction can be found here. You can further customise the chat widget to match your APP colours and theme.
PS: I work for Kommunicate

How do I use the Watson Assistant API with React Native?

If I attempt to import and use code that invokes the Watson Assistant API for Node, I get a fatal error
The package at "node_modules/ibm-watson/lib/common.js" attempted to
import the Node standard library module "os". It failed because React
Native does not include the Node standard library.
I gather this means that it is not possible to use the Watson Node API with React Native.
What alternatives are available for using the Watson Assistant API with React Native? Should I just use fetch and follow the Watson Assistant cURL API, and if so, how do construct the arguments to fetch, specifically -u "apikey:{apikey}"?
There is partial example of how to do this with version 1 of the Assistant API, but that uses a different authentication method and is not applicable here.

google assistant with react native

I developed one react native application. now I want to integrate Google Assistant in the app, I will provide one mic button, if the user click on it, the google assistant need to be enabled, and I need response from the google.
I am working in smart home project, I want to integrate google assistant api in React native app, I seen the library support only python. Please suggest me the best way I can embed google assistant in my app.
Have you looked at the dialogflow integration with react native? that could help you do what you want. If you are building a smart home integration I would assume you are already in dialogflow to some extent.
https://github.com/innFactory/react-native-dialogflow