react-native/React
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
..
Base Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
Executors Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
Layout Fix width being ignored when has a value of 0 2015-09-25 15:42:21 -07:00
Modules Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
Profiler Added lightweight generic annotations 2015-11-03 14:49:30 -08:00
React.xcodeproj Fixed build for UIExplorer project. 2015-10-27 02:42:26 -07:00
Views Exporting a synchronous UIWebView to JS 2015-11-04 08:44:29 -08:00