Automate login, navigation and parse of web pages in React Native - react-native

I would like to get information from a specific website (https) from within a react native app.
For that, I need to:
Open and Login to the web page (https)
Make a simple navigation (known tag in html)
Parse the resulting page for data.
Present the data in a React native component (not webUI).
Any idea what would be the best way to do it?
10x,
EyalS

Here is what I would do:
Use the following tutorial to use Browserify to wrap Zombie.js within a react-native app.
Navigate with Zombie.js to the data that you are seeking.
Display the data.
Happy coding.

Related

How to add Facebook Comments Plugin in React Native using Expo?

I am developing a news app using React Native and Expo. At the end of each of the news page, I need a Facebook comments section, like the following:
I have only found answers for adding comments in web page but not in mobile apps. The closest thing I've found is this post which recommends using a Web View. Do we have to use Web View or is there any other alternative way? And if we use a web view, how do I know what url to provide in the source uri field?

How to get data from browser like url, its params etc back to expo app and vice versa?

So, I have been looking for a way as how to pass data between expo app and the web browser which opens as a modal within the app (not WebView). Like how to pass some data as params to the browser, or how to get data back from browser to the expo app
I have been looking through the Linking and Deep Linking documentation but they are not much helpful, please help

Share Url from browser to React Native app

I want to share URLs from the browser to my React Native app and open them in the app, how can I do that?
This is called deep-linking, that your app launches and even does some actions depending on the called URL of your app. Many apps use it that's how you probably know it.
You can read about this and implement it.
Here is some articles and documentation about it:
https://reactnavigation.org/docs/deep-linking/
https://medium.com/react-native-training/deep-linking-your-react-native-app-d87c39a1ad5e

Is it possible to integrate a TWA into a React Native project?

I am wondering if it is possible to integrate TWA (Trusted Web Activities) into an existing React Native project. This way I could have a section in my app where costumers can use my PWA inside my app. As fallback for iOS I would use something like their WebView. If it is possible, how would I go about implementing it?
In short, yes, it is possible to integrate Trusted Web Activity into a React Native App.
You'd need to create an Android Native Module that wraps Android Browser Helper into a React Native API. Since you want to use the Trusted Web Activity as part of your app, you will probably be looking into wrapping TwaLauncher.
Then, you will need to implement a module for iOS, which will have the same API in React, but will use the WebView as an implementation.
It seems someone has already created a wrapper for Android (but I haven't tested).

Possible to access Cookies in a WebView in React Native?

If you create a WebView within a react-native application, is it possible to access the cookie from the WebView to be passed in subsequent requests?
An example would be presenting the User with a login page with reCaptcha in a WebView. Then using the authentication cookies from a successful login to make subsequent API requests to the same site.
React Native is just a bridge on top of the native code. Anything you can write in objective-c/java can be used in React Native by creating native modules.
I am not sure if there is JavaScript code present for clearing the cache of a webview, but you can certainly write native code for it and then bridge it using native module.
Here is the link for the native code(iOS) : https://stackoverflow.com/a/5606703/2164029
Tutorial for creating native moduels : https://facebook.github.io/react-native/docs/native-modules-ios.html
I believe this https://github.com/joeferraro/react-native-cookies should provide you what you want.I have used this to clear cookies successfully.