How do I connect a solidity smart contract with a mobile app? - node.js

I am new to smart contract development. I would like to create a mobile app that can connect to solidity, but I am not sure how.
There is a lot of documentation on how to connect to web applications but not on the mobile app. So I am guessing there must be some server-side application in the middle? Because it needs to connect to Metamask and the browser.
How do I properly connect smart contracts, a client-mobile app, and a server-side app that is able to connect to Metamask?

You most of the time want to directly interact with the smart contract from the mobile device after s/he has connected the app with metamask(or other wallet application) especially to create a new transaction on the blockchain. Most of the time there is only a server-side middleware for processing a lot of blockchain data for performance gain.
So from the device app you would - get blockchain data + create new tx + call a smart contract that changes the state of the smart contract
From backend you would generally only get data that requires intensive processing and/or required to cache the data on db for performance gain.
So depending on which platform you are developing your mobile app, you would look for a web3 library to connect to the wallet and interact with deployed smart contract. Easiest would be if you use a JS-based platform (like React Native) cause web3 js is one of the matured ones among all the web3 libraries.

Related

How does a front-end application user gets identified in hyperledger fabric

How should I allow external application users(that do not run nodes on the network) to allow using an hyperledger fabric app ? How are the identified in the network ?
You could provide a REST API as the gateway to the blockchain network. Depending on how much you want to lock down functionality, you could refine the REST URLs to divert to different users in the wallet so that perhaps some might have read only access and others might have higher levels. You can set up the contract code to recognise which user is currently trying to perform an action and take steps to restrict them more. It all depends on your requirements. The external users could be given access to URLs specific to their organisations which would seek to access blockchain through a wallet dedicated to such an organisation. Therefore, there is no possibiity of crossover with other orgnisations.
If you are developing using Node.js, it is very easy and quick to set up an example REST API using Express.

Chat between 2 different applications using firebase

I am building a marketplace and want to provide the chat feature to customers and vendors. There are 2 separate apps for customer (App1) and vendors (App2). The idea is when a customer on App1 sends message to a vendor on App2 the message is received on App2 and the vendor can reply back. Can we do this in FIREBASE?
Front-end -> React-native
Back-end -> ASP.NET
The question is little bit wide but technicaly you can share any kind of data between two apps using the Firebase REST API or even the Firebase Admin SDK. We use in your compay both solution depending on what task the need to accomplishe.
In your case because both Apps would need to send data to each other both of them would need to have an REST API to send and receive data.
If you plan to use a single Firebase Project for both apps you can just use the Firebase Client SDKs to communicate to the same Firebase Projekt trough different apps. A single Firebase project can have multiple Apps on multiple and same platforms and languages.

Does Google Actions Support Websockets?

I am trying to build a Rocket Chat Google Action and one of the major advantage of RC is it's Realtime API's however they require Websocket to get access. I know that Dialogflow can be used for Websocket's but does Google Actions support it?
I am using Dialogflow along with Firebase as backend for my Action.
Actions on Google is a platform for stateless applications running through a REST API call. In this model, the user sends one request to your server and they get back one response.
Actions on Google itself doesn't support web sockets, but you are able to define a cloud function like Firebase to do advanced fulfillment. While you may be able to get web sockets to work in your function, you'd still need to adjust the Action's conversational flow to work in a request/response fashion instead of listening to web sockets continually.

Stripe integration with expo react native app

I'm building an app using expo and react native, and I am planning to use Stripe for processing payments.
I do not want to use Expo payments since it requires me to detach the project to accept payments on iOS as described here.
According to this comment, the input fields where a user enters credit card information need to be hosted by the payment provider (in my case, Stripe) for PCI compliance. Am I correct in assuming that this means I cannot use tipsi-stripe library?
Stripe does not provide react native components as far I can see. In that case, all I can think of is to embed Stripe elements or checkout component as a WebView in my react native app so that the input fields are hosted by Stripe. Is there an easier or "more native" way that I am missing?
Your understanding on integrating Stripe API is correct. To avoid most of the PCI compliance complexity, you will need to use Stripe Element/Checkout or Mobile SDK[0].
So you can either
Hosting the Elements/Checkout and use in the WebView
Using Mobile SDK
And for number 2, since you are using react-native, you can use Tipsi-Stripe because tipsi-stripe is built on top of the Stripe Mobile SDK.
[0] https://stripe.com/docs/security#validating-pci-compliance

What type of middleware is used for the Square credit card reader and its website

I am trying to understand how the https://squareup.com/ square Credit Card reader works.
What would be the underlying middleware that is being used to
send the data to the squareup server,
process the payment
send verification to a user of a successfull payment
This is implmented on the iPhone, could there be a generic middleware that could be used for other devices to access this service created, so we could have all type of smartphones access a similar service language independent?
Also what security protocols would be used to ensure the data is sent encrypted over the network?
Their own website contains details about their security technology. They appear to use common and trusted technologies like SSL, which isn't a surprise.
If you want to build an application that integrates with their service, you should contact them. It's possible that they will require you to purchase a license in order to do so. They would also be the authority on the protocols and middleware required to integrate with it.

Resources