Is Web3js library fully functional in React Native? - javascript

I am not able to use web3js library in react native application. Calling the balance for account :
web3.eth.getBalance("0x407d73d8a49eeb85d32cf465507dd71d507100c1").then(console.log);
returns the result, but immediatelly cause the errors in logs, which I cant catch.
Another problem is to encrypt the wallet, where it seems like some cryptolibs are missing in react native:
web3.eth.accounts.wallet.encrypt(password);
Web3js error [Error: Secure random number generation is not supported by this browser.Use Chrome, Firefox or Internet Explorer 11]
Does anybody succesfully use Web3js lib directly in React Native? Or the only way is to use Webview and javascript?
Many thanks

Related

React Native - CardinalComm SDK 60 Warning Template

We recently received warning from google regarding the data collection issue(See the screenshot).
screenshot
Based on some posts from braintree, upgrading the android SDK to the latest version(6.5.0) should resolve this issue. But we are using react native and implemented braintree dropin with a dependence whose owner is no longer maintain this library.
Does anyone implemented braintree dropin on react native have successfully solve this google warning?

React Native: How to get upload speed and network signal strength?

I am currently tasked with developing an application that gives the user various information and details about his network connection using React Native. The main issue is that I am unable to find a library or method to get the user's upload speed or signal strength.
I am using these libraries to get the download speed and network information:
react-native-network-bandwith-speed
#react-native-community/netinfo
These are working just fine.
I found many APIs that allow the integration of fast.com or speedtest.net, but these are not compatible with React Native.
The only thing(s) missing is the upload speed, and signal strength. Any help would be greatly appreciated.

How to handle all files access and MANAGE_EXTERNAL_STORAGE permission by React Native?

I have created an app using React native. In my Application i have implemented a feature that use write or download pdf and xlsx file in the externalStorage of the device.this feature is working properly until the Android 10. But on Android 11, app is crashing so i read the documentation of android and where i found that in android 11 has introduced the new concept of all files access and it will managed by the new permission which is MANAGE_EXTERNAL_STORAGE. So i am unable to implement this by the react native. so please suggest the solutions or tips to resolve it.

How to connect Redux Devtools to someone else's app

I know that the typical way to enable redux devtools on a web app is to configure it when creating your store. There are many examples of how to do this online.
What I'm wondering is, is there any method / hack I can employ to try to connect Redux DevTools to a web app that I didn't develop? Say I happen to know that some web app uses Redux, is there anything I can do / code I can run in the developer console to connect it to Redux DevTools after the fact, so that I can inspect some of the actions that are fired on the page?
React DevTools, for example, seems to work on websites that use React without having to configure it in the code.
No, it's not possible.
The Redux DevTools extension must be configured as part of the store setup process, as it actually wraps the original store.
The React DevTools work because React exposes some internal functions that the React DevTools can call to read React's data structures.
Unfortunately, this is impossible, but I imagine how cool it would be to go to Facebook or Instagram and see what's going on there in the store.
Although of course I can be wrong and this is possible if you solve the following issues from the browser console:
Install the npm package on the server where the site is stored
npm install --save #redux-devtools/extension
You need to write code in the browser console that will be executed on their server, namely, you need to tell the server that now it needs to transfer information from the store to your browser extension.
Find the lines of code where they create a store and add:
That's all, if you have any problems, write, we will help))

React Native Could not open URL No Activity found to handle Intent

I'm working with React Native and Square Point of Sale. I'm using Web API for Android.
Also I have installed Square Point of Sale.
This is my code:
componentDidMount() {
let url ="intent:#Intent;action=com.squareup.pos.action.CHARGE;package=com.squareup;S.browser_fallback_url=https://my.website.com/index.html;S.com.squareup.pos.WEB_CALLBACK_URI=https://my.website.com/index.html;S.com.squareup.pos.CLIENT_ID=sq0ids-yOurCLieNtId;S.com.squareup.pos.API_VERSION=v2.0;i.com.squareup.pos.TOTAL_AMOUNT=100;S.com.squareup.pos.CURRENCY_CODE=USD;S.com.squareup.pos.TENDER_TYPES=com.squareup.pos.TENDER_CARD,com.squareup.pos.TENDER_CARD_ON_FILE,com.squareup.pos.TENDER_CASH,com.squareup.pos.TENDER_OTHER;end";
Linking.openURL(url).catch(err => console.error("An error occurred", err));
}
This is my error message:
Could not open URL 'intent:#Intent; ... end': No Activity found to handle Intent { act=android.intent.action.VIEW dat=intent: flg=0x10000000 }
What I'm doing wrong?
I tried building using the web API but found that the flow wasn't great. The user doesn't always make it back to the app; sometimes they get stuck on the website.
I built react-native-square-pos to make things easier for the next developer. It uses Native Modules to communicate with the Android / iOS Square PoS APIs.. so you don't have to write Java or Objective-C.
The intent:#Intent that you're using there isn't really going to work from within React Native, since that is used for going from a web browser on an Android device into the Square POS app.
The Android Web API intent is intended to do a hand-off from your browser to the Square POS application, not from application to application.
It sounds like what you'd be wanting to do is use the Square Point of Sale SDK for Android with your React Native application. You'll want to take a look at https://facebook.github.io/react-native/docs/native-modules-android.html about how to link a native module with your React Native application.

Categories

Resources