Commit Graph

20 Commits

Author SHA1 Message Date
Jamie Birch 9cb2f6e2f3
feat(iOS): WKUserScripts (e.g. injectedJavaScript) can now update upon props change; and can be configured to inject into all frames. (#1119)
BREAKING CHANGE: 
• Props updates to `injectedJavaScript` are no longer immutable.

• `injectedJavaScript` no longer attaches a `jsEvaluationValue` property to the `onLoadingFinish` event. Check out: https://github.com/react-native-community/react-native-webview/pull/1119#issuecomment-574919464 to migrate with the same behavior.
2020-03-17 14:01:20 -07:00
Luciano Lima 86c44588f8
chore(docs): Update React Native links to reactnative.dev (#1233) 2020-02-25 22:54:06 -08:00
Daniel Vicory 4093682e08
fix(Android): Don't show camera options for a file upload when they can not be used (#1210)
* Don't show camera options for a file upload that would result in nothing happening for the user.

On Android, if the application declares the camera permission, then even intents
that use the camera require permission to be granted. This is a problem for apps
that combine an in-app camera with a WebView that has file uploading and the user
has not given permission for the camera.

Note, this will not request permission for camera. This will simply prevent
showing the camera options that would be a no-op action for users. It does this
by checking if the camera permission is declared, and if so, checks that the
user has granted permission.

More information: https://blog.egorand.me/taking-photos-not-so-simply-how-i-got-bitten-by-action_image_capture/

* Add example and documentation about camera option availability in file uploads for Android.
2020-02-18 18:40:30 -08:00
António Goulão 6c8b8fc4b1
chore(docs): Update Android assets path (#1173) 2020-02-14 11:12:19 -08:00
Jason Safaiyeh 327bc6b7de
chore(docs): Update cookie links (#1149) 2020-02-13 05:50:22 -08:00
Jason Safaiyeh 361529630f feat(ios): Generate history API events on iOS (#1082)
BREAKING CHANGE: if you use onNavigationStateChange on iOS it will now trigger on # changes to the url.

* Hook the `window.history` API on iOS to generate events

The underlying WKWebView doesn't seem to generate any events in response to the `window.history` API - none of the `WKNavigationDelegate` methods fire.

Given this limitation, the only way to know when the location changes via this API is to inject Javascript into the page and have it notify the native code directly when any of these functions are called.

The `setTimeout` call gives up the current tick, allowing the location to change before firing the event.

* Remove the outdated section about hash changes

Now that this bug is fixed, the workaround is no longer required.
2019-12-16 17:52:54 +01:00
Salvatore Randazzo 604495e399 feat(iOS): new prop injectedJavaScriptBeforeContentLoaded (#1038)
* Run the injectedJavaScript on DocumentStart for iOS

* Add new prop injectedJavaScriptBeforeContentLoaded
Update types
Update docs

* Self review
2019-12-06 11:15:02 +01:00
Dani Akash 6088dd9f06 chore(docs): Steps to load local HTML files into the webview (#1008)
Fixes #746 

These steps are based on my other project React native draftjs which requires loading a local HTML file. The code can be found in the following line - bc51410117/index.js (L113)
2019-11-12 10:06:35 +01:00
Jamon Holmgren 82af9559ef
chore(docs): Add in-page link to new guide
[skip ci]
2019-11-04 08:34:54 -08:00
Jamon Holmgren 8c9f986df0 chore(docs): Added guide for working with custom headers and cookies (#994)
* Added guide for working with custom headers and cookies

* Remove extraneous files
2019-11-04 17:30:51 +01:00
Jean Augusto de Caastro Costa c1b3696e01 chore(docs): Added missing word (#948) 2019-10-22 09:59:36 +02:00
Thibault Malbranche 8549be5fd0
fix(iOS): UIWebView Removal (#828)
Apple required us to remove this (see #819)

BREAKING CHANGE: UIWebView has been removed
BREAKING CHANGE: useWebkit prop removal
BREAKING CHANGE: scalesPageToFit prop removal on iOS (since it's not compatible with WKWebview)
BREAKING CHANGE: Renamed RNCWKWebView to RNCWebView on iOS
2019-08-30 12:04:32 +02:00
Jamon Holmgren c0332ec607 chore(docs): Adds guide for intercepting hash URL changes (#555) 2019-05-13 09:42:25 +02:00
Andrei Pfeiffer ff32e34eb5 chore(docs): Add multiple file upload selection in the docs (#382) 2019-03-07 10:13:22 +01:00
Jamon Holmgren 2260690810 chore(docs): Added guides for communication between React Native and web pages (#377)
* Added guides for communication between React Native and web pages

* Updated Guide a bit
2019-03-03 01:32:42 +01:00
Jamon Holmgren 4ad7036733 chore(docs): Adds guide for handling navigation state changes (#144)
* Adds guide for handling navigation state changes

* Update Guide.md
2019-03-01 01:21:01 +01:00
Scott Mathson 2114a9b327 feat(Android Webview): Add file download support for Android (#203)
Addresses #80.

Caveat: I am not an Android developer. This code comes from a fork of the original RN WebView that we have been using in production for some time, so all credit goes to @Oblongmana: https://github.com/Oblongmana/react-native-webview-file-upload-android.

Setting up a DownloadManager for the WebView is pretty straightforward, as is adding any known cookies to the request. Most of the complication comes from the requirement after SDK 23 to ask the user for the WRITE_EXTERNAL_STORAGE permission. Unfortunately there is no mechanism to suspend the download request until permission is resolved so this code stores off the request and sets up a listener that enqueues the download once permissions are resolved so the user experience is really nice.

I didn't see anything in the way of tests or documentation that needs to be added for this change, so let me know if I missed anything. Thanks!
2019-01-07 15:02:47 +01:00
Andrei Pfeiffer 752a5b295a feat(Android): Support Android file upload (#60)
Fixes #33 

I could really use some help from an Android developer on this one, because I just "made it work", don't know how to "make it work good".

Some things that should be reviewed:

- [ ] validate Android 5.0 devices (my emulator work, but outputs some weird sounds; a Galaxy 4 I tested on crashes)
- [ ] validate Android 5.1 devices (emulator works, couldn't find a real device)
- [ ] how to handle File Extensions? (https://www.w3schools.com/tags/att_input_accept.asp)

I'm sure that there's more refactoring to be done, so any help and advice would be appreciated.
2018-11-21 11:46:43 +01:00
Jamon Holmgren 935e9518ee Docs updates 2018-09-19 21:20:56 -07:00
Jamon Holmgren 0ce93a963a Added first draft of docs folder and documentation 2018-09-19 19:27:09 -07:00