react-native/Libraries
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
..
ART Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
ActionSheetIOS Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
AdSupport Text highlighting on iOS 2015-07-24 08:41:58 -08:00
Animated Deploy Flow 0.18.1 to fbobjc 2015-10-26 15:36:14 -07:00
AppRegistry [React Native] Provide a way to get a list of registered apps in AppRegistry 2015-08-07 11:05:25 -08:00
AppStateIOS revert D2372548 to fix initial app state issue 2015-09-25 13:25:26 -07:00
BatchedBridge Adding jest tests to groups rn 2015-08-31 17:35:47 -08:00
CameraRoll Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
Components Exporting a synchronous UIWebView to JS 2015-11-04 08:44:29 -08:00
CustomComponents update NavigationContext API. 2015-11-03 19:08:31 -08:00
DebugComponentHierarchy [ReactNative] Send debug component ownership info in createView 2015-06-25 05:47:24 -08:00
Device flowify some Libraries 2015-03-25 11:09:54 -08:00
Devtools Use pre-bundled elements inspector 2015-10-29 11:21:32 -07:00
Fetch Add fetch's clone function to Request and Response prototypes 2015-10-30 10:57:33 -07:00
Geolocation Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
Image Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
Inspector [react-native] enable react devtools from JavascriptCore 2015-07-23 17:14:09 -08:00
Interaction InteractionManager: remove dev timeout warnings 2015-07-01 04:51:28 -08:00
JavaScriptAppEngine Revert moving out setupDevtools call 2015-11-02 18:34:25 -08:00
LayoutAnimation [ReactNative] Remove POPAnimation 2015-08-20 22:24:28 -07:00
LinkingIOS Add note for iOS9 url scheme changes 2015-10-12 08:04:24 -07:00
Modal Make <Modal> visible by default 2015-10-30 17:09:27 -07:00
NativeApp [ReactNative] Add "RCTNativeAppEventEmitter" 2015-05-15 16:57:18 -08:00
Network Fix retain cyles in RCTNetworkTask when used with RCTFileRequestHandler and RCTDataRequestHandler 2015-11-04 07:16:26 -08:00
Picker Fixed PickerIOS onChange event 2015-09-08 03:34:33 -08:00
Portal [RN] add clarifying Android-only comment to Portal 2015-08-31 11:10:45 -08:00
PushNotificationIOS Add support for cancelAllLocalNotifications 2015-10-16 10:57:25 -07:00
QuickPerformanceLogger added QPL for main interactions 2015-09-29 22:25:23 -07:00
RCTTest Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
RKBackendNode [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -08:00
ReactIOS Revert moving out setupDevtools call 2015-11-02 18:34:25 -08:00
ReactNative Better error message for RawText outside <Text> 2015-11-02 10:51:44 -08:00
Sample Remove invariant of Sample.ios.js that is not used 2015-05-26 18:25:00 -07:00
Settings Text highlighting on iOS 2015-07-24 08:41:58 -08:00
Storage Fix AsyncStorage error multiplexing 2015-10-28 12:03:26 -07:00
StyleSheet Add deprecated transform props to View prop type definition. 2015-10-16 07:30:26 -07:00
Text Fix Groups text input 2015-11-04 04:09:27 -08:00
Utilities Reenable JS calls to systrace on reload 2015-11-02 05:35:35 -08:00
Vibration Text highlighting on iOS 2015-07-24 08:41:58 -08:00
WebSocket Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
react-native Move SnapshotView to SnapshotViewIOS and create an unimplemented android version 2015-10-13 11:48:38 -07:00
vendor Move stuff out of vendor/react_contrib/ 2015-10-12 11:18:30 -07:00
Promise.js Replace ES6Promise with Promise 2015-04-15 06:06:29 -08:00