react-native/Libraries/Components
Pieter De Baets 0a290e22da Exporting a synchronous UIWebView to JS
Summary: public

Original github title:  Exported a callback for native webview delegate method shouldStartLoadWithRequest

We have a requirement in our app, to open in mobile Safari, any http:// and https:// links displayed in a web view. Our web view is not full screen and is loaded with an HTML string from the backend. Displaying external content in that web view is outside of the scope of our app, so we open them in mobile Safari.

I've forked the WebView component and added a callback property, shouldStartLoadWithRequest, and modified the RCTWebView implementation of `webView:shouldStartLoadWithRequest:navigationType:`
to check if the shouldStartLoadWithRequest property is set.

If the property is set, `webView:shouldStartLoadWithRequest:navigationType:` passes the URL & navigationType to the callback. The callback is then able to ignore the request, redirect it, open a full screen web view to display the URL content, or even deep link to another app with LinkingIOS.openURL().

Original author: PJ Cabrera <pj.cabrera@gmail.com>
Closes https://github.com/facebook/react-native/pull/3643

Reviewed By: nicklockwood

Differential Revision: D2600371

fb-gh-sync-id: 14dfdb3df442d899d9f2af831bbc8d695faefa33
2015-11-04 08:44:29 -08:00
..
ActivityIndicatorIOS Fixed ActivityIndicatorIOS layout 2015-10-23 09:13:24 -07:00
DatePicker Release React Native for Android 2015-09-14 18:13:39 +01:00
DrawerAndroid Fix broken code block and make the example nicer 2015-10-08 14:01:52 -07:00
MapView Added support for toggling POI visibility on iOS map view. 2015-10-29 11:02:25 -07:00
Navigation Add packager-managed assets support to NavigatorIOS 2015-10-02 12:02:29 -07:00
ProgressBarAndroid Release React Native for Android 2015-09-14 18:13:39 +01:00
ProgressViewIOS [ReactNative] cleanup native components 2015-07-24 18:54:35 -08:00
ScrollView Use RecyclerViewBackedScrollView in groups feed on Android. 2015-10-16 07:45:22 -07:00
SegmentedControlIOS [ReactNative] cleanup native components 2015-07-24 18:54:35 -08:00
SliderIOS Improved SliderIOS 2015-10-30 09:13:26 -07:00
StatusBar Release React Native for Android 2015-09-14 18:13:39 +01:00
Switch introduce universal switch 2015-10-06 10:29:22 -07:00
SwitchAndroid Fix crash on RC while toggling object status. 2015-09-17 17:20:51 -07:00
SwitchIOS Fix crash on RC while toggling object status. 2015-09-16 15:35:35 -07:00
TabBarIOS Managed assets support for RCTConvert 2015-09-29 09:21:39 -07:00
TextInput Fix Groups text input 2015-11-04 04:09:27 -08:00
ToastAndroid Release React Native for Android 2015-09-14 18:13:39 +01:00
ToolbarAndroid Allow for styling of ToolbarAndroid's overflow icon 2015-10-22 04:43:25 -07:00
Touchable Fix React warnings 2015-10-16 03:41:14 -07:00
UnimplementedViews [ReactNative] introduce requireNativeComponent 2015-04-16 17:12:12 -08:00
View Add 'onMoveShouldSetResponderCapture' to 'propTypes' 2015-10-30 16:38:27 -07:00
ViewPager Open source ViewPagerAndroid 2015-10-06 20:01:21 -07:00
WebView Exporting a synchronous UIWebView to JS 2015-11-04 08:44:29 -08:00
ScrollResponder.js Fix keyboardShouldPersistTaps default value 2015-10-05 10:25:21 -07:00
StaticContainer.js Move stuff out of vendor/react_contrib/ 2015-10-12 11:18:30 -07:00
StaticRenderer.js [Haste] @provides -> @providesModule StaticRenderer 2015-05-14 08:42:13 -08:00
Subscribable.js [ReactNative] clean lint for Libraries/Components 2015-05-18 15:54:07 -08:00