Comments (5)
I vote for the "ideal" scenario.
from aao-react-native.
In #721, I said this:
Currently, we disable any hyperlinks in News articles.
I'd prefer to catch navigation events from the NewsDetail WebView, and call the appropriate embedded browser view (SFWebView or Chrome Custom Tabs, as appropriate) so that the user can actually view the links.
I'd like to at least link the libraries before we ship the next version, so that we can enable them later on via CodePush.
@drewvolz, @mattk410, @zimmer18: any of you feel up for doing a PR that's just, like,
npm i --save react-native-safari-view
react-native link react-native-safari-view
git add .
git commit -m "linked SFWebView library"
npm i --save react-native-custom-tabs
react-native link react-native-custom-tabs
git add .
git commit -m "linked Chrome Custom Tabs library"
or something?
from aao-react-native.
Links for embedded browsers:
SFViewController: https://www.npmjs.com/package/react-native-safari-view
Chrome Custom Tabs: https://www.npmjs.com/package/react-native-custom-tabs
from aao-react-native.
Looking at the WebView example,
onNavigationStateChange = (navState) => {
this.setState({
backButtonEnabled: navState.canGoBack,
forwardButtonEnabled: navState.canGoForward,
url: navState.url,
status: navState.title,
loading: navState.loading,
scalesPageToFit: true
});
};
The API for both of the native browser components looks something like
import SFWebView from 'react-native-safari-view'
SFWebView.show(url)
so my proposal for linking them together is pretty much call .show(navState.url)
.
I explicitly do not want to replace our current WebView system, only enhance it: we cannot provide custom HTML to either native webview, and I think that it would be an unacceptable loss of speed if we went and downloaded the HTML of the page again, when we already have the contents locally from the RSS/WP-JSON feed.
So this issue is solely, I think, about opening an SFWebView/Custom Tab when the user interacts with a link in a News article.
A PR for this will also need to remove the a {}
styles from news/news-item.js
, as that disables all user interaction with links.
from aao-react-native.
(We'll also want to use the .isAvailable()
method on the SFWebView component, as I don't think that SFWebView was around on iOS 8 and I know that we've got … 3 people? still back there.)
from aao-react-native.
Related Issues (20)
- Create standard view templates for Dictionary.Detail and Directory.Detail
- Fix Android builds HOT 5
- Try migrating from Detox to XCUITest + EarlGrey2 and Android Studio's UI testing framework HOT 1
- Add a github workflow to build any branch from a dropdown
- Remove distributionSha256Sum from gradle-wrapper.properties? HOT 3
- Dependency Dashboard
- Take screenshots of the app with Detox HOT 1
- Investigate replacing our markdown component with react-native-marked HOT 2
- Change the privacy policy to meet the play store's guidelines HOT 2
- Fix deploy data step
- react-native-paper is red screening on android
- android crashes due to PlatformColor
- Settings attempts to login without credentials HOT 2
- Move browse all button into nav header for course catalog
- Android building hours shows a red screen with `borderColor` HOT 5
- Performance: Investigate cocoapods 1.12 concurrency HOT 3
- Performance: use babel to remove console logs in production
- Handle google play tasks
- Filters in section-list rows have text and content cutoff, checkbox is unreachable
- Enable eslint-plugin-imports
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aao-react-native.