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

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?

Related

How to login to Facebook using react native for web platform

I'm trying to figure out how to implement a facebook login via a react-native for a web app. I can find lots of info on how to do this for IOS and Android, but nothing for a web app. I created my project using expo and also installed firebase, but I can't find enough info to tie all this together for a web app. I don't think it will matter, but I'm also using typescript. I would provide some code, but I can't even find a solution that compiles at this point.

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).

Automate login, navigation and parse of web pages in 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.

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.