|
@@ -35,6 +35,7 @@ This document lays out the current public properties and methods for the React N
|
35
|
35
|
- [`javaScriptEnabled`](Reference.md#javascriptenabled)
|
36
|
36
|
- [`javaScriptCanOpenWindowsAutomatically`](Reference.md#javascriptcanopenwindowsautomatically)
|
37
|
37
|
- [`androidHardwareAccelerationDisabled`](Reference.md#androidHardwareAccelerationDisabled)
|
|
38
|
+- [`androidLayerType`](Reference.md#androidLayerType)
|
38
|
39
|
- [`mixedContentMode`](Reference.md#mixedcontentmode)
|
39
|
40
|
- [`thirdPartyCookiesEnabled`](Reference.md#thirdpartycookiesenabled)
|
40
|
41
|
- [`userAgent`](Reference.md#useragent)
|
|
@@ -45,6 +46,7 @@ This document lays out the current public properties and methods for the React N
|
45
|
46
|
- [`overScrollMode`](Reference.md#overscrollmode)
|
46
|
47
|
- [`contentInset`](Reference.md#contentinset)
|
47
|
48
|
- [`contentInsetAdjustmentBehavior`](Reference.md#contentInsetAdjustmentBehavior)
|
|
49
|
+- [`contentMode`](Reference.md#contentMode)
|
48
|
50
|
- [`dataDetectorTypes`](Reference.md#datadetectortypes)
|
49
|
51
|
- [`scrollEnabled`](Reference.md#scrollenabled)
|
50
|
52
|
- [`directionalLockEnabled`](Reference.md#directionalLockEnabled)
|
|
@@ -66,8 +68,10 @@ This document lays out the current public properties and methods for the React N
|
66
|
68
|
- [`allowsLinkPreview`](Reference.md#allowsLinkPreview)
|
67
|
69
|
- [`sharedCookiesEnabled`](Reference.md#sharedCookiesEnabled)
|
68
|
70
|
- [`textZoom`](Reference.md#textZoom)
|
|
71
|
+- [`pullToRefreshEnabled`](Reference.md#pullToRefreshEnabled)
|
69
|
72
|
- [`ignoreSilentHardwareSwitch`](Reference.md#ignoreSilentHardwareSwitch)
|
70
|
73
|
- [`onFileDownload`](Reference.md#onFileDownload)
|
|
74
|
+- [`autoManageStatusBarEnabled`](Reference.md#autoManageStatusBarEnabled)
|
71
|
75
|
|
72
|
76
|
## Methods Index
|
73
|
77
|
|
|
@@ -133,9 +137,9 @@ Make sure the string evaluates to a valid type (`true` works) and doesn't otherw
|
133
|
137
|
|
134
|
138
|
On iOS, see [`WKUserScriptInjectionTimeAtDocumentEnd`](https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentend?language=objc)
|
135
|
139
|
|
136
|
|
-| Type | Required | Platform |
|
137
|
|
-| ------ | -------- | -------- |
|
138
|
|
-| string | No | iOS, Android, macOS
|
|
140
|
+| Type | Required | Platform |
|
|
141
|
+| ------ | -------- | ------------------- |
|
|
142
|
+| string | No | iOS, Android, macOS |
|
139
|
143
|
|
140
|
144
|
To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
|
141
|
145
|
|
|
@@ -165,15 +169,15 @@ Make sure the string evaluates to a valid type (`true` works) and doesn't otherw
|
165
|
169
|
|
166
|
170
|
On iOS, see [`WKUserScriptInjectionTimeAtDocumentStart`](https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentstart?language=objc)
|
167
|
171
|
|
168
|
|
-| Type | Required | Platform |
|
169
|
|
-| ------ | -------- | -------- |
|
|
172
|
+| Type | Required | Platform |
|
|
173
|
+| ------ | -------- | ---------- |
|
170
|
174
|
| string | No | iOS, macOS |
|
171
|
175
|
|
172
|
176
|
To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
|
173
|
177
|
|
174
|
178
|
Example:
|
175
|
179
|
|
176
|
|
-Post message a JSON object of `window.location` to be handled by [`onMessage`](Reference.md#onmessage). `window.ReactNativeWebView.postMessage` *will* be available at this time.
|
|
180
|
+Post message a JSON object of `window.location` to be handled by [`onMessage`](Reference.md#onmessage). `window.ReactNativeWebView.postMessage` _will_ be available at this time.
|
177
|
181
|
|
178
|
182
|
```jsx
|
179
|
183
|
const INJECTED_JAVASCRIPT = `(function() {
|
|
@@ -195,8 +199,8 @@ If `true` (default; mandatory for Android), loads the `injectedJavaScript` only
|
195
|
199
|
|
196
|
200
|
If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
|
197
|
201
|
|
198
|
|
-| Type | Required | Platform |
|
199
|
|
-| ------ | -------- | -------- |
|
|
202
|
+| Type | Required | Platform |
|
|
203
|
+| ---- | -------- | ------------------------------------------------- |
|
200
|
204
|
| bool | No | iOS and macOS (only `true` supported for Android) |
|
201
|
205
|
|
202
|
206
|
---
|
|
@@ -207,8 +211,8 @@ If `true` (default; mandatory for Android), loads the `injectedJavaScriptBeforeC
|
207
|
211
|
|
208
|
212
|
If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
|
209
|
213
|
|
210
|
|
-| Type | Required | Platform |
|
211
|
|
-| ------ | -------- | -------- |
|
|
214
|
+| Type | Required | Platform |
|
|
215
|
+| ---- | -------- | ------------------------------------------------- |
|
212
|
216
|
| bool | No | iOS and macOS (only `true` supported for Android) |
|
213
|
217
|
|
214
|
218
|
---
|
|
@@ -219,8 +223,8 @@ Boolean that determines whether HTML5 audio and video requires the user to tap t
|
219
|
223
|
|
220
|
224
|
NOTE: the default `true` value might cause some videos to hang loading on iOS. Setting it to `false` could fix this issue.
|
221
|
225
|
|
222
|
|
-| Type | Required | Platform |
|
223
|
|
-| ---- | -------- | -------- |
|
|
226
|
+| Type | Required | Platform |
|
|
227
|
+| ---- | -------- | ------------------- |
|
224
|
228
|
| bool | No | iOS, Android, macOS |
|
225
|
229
|
|
226
|
230
|
---
|
|
@@ -235,8 +239,8 @@ The `nativeConfig` prop expects an object with the following keys:
|
235
|
239
|
- `props` (object)
|
236
|
240
|
- `viewManager` (object)
|
237
|
241
|
|
238
|
|
-| Type | Required | Platform |
|
239
|
|
-| ------ | -------- | -------- |
|
|
242
|
+| Type | Required | Platform |
|
|
243
|
+| ------ | -------- | ------------------- |
|
240
|
244
|
| object | No | iOS, Android, macOS |
|
241
|
245
|
|
242
|
246
|
---
|
|
@@ -254,7 +258,7 @@ Example:
|
254
|
258
|
```jsx
|
255
|
259
|
<WebView
|
256
|
260
|
source={{ uri: 'https://reactnative.dev' }}
|
257
|
|
- onError={syntheticEvent => {
|
|
261
|
+ onError={(syntheticEvent) => {
|
258
|
262
|
const { nativeEvent } = syntheticEvent;
|
259
|
263
|
console.warn('WebView error: ', nativeEvent);
|
260
|
264
|
}}
|
|
@@ -294,7 +298,7 @@ Example:
|
294
|
298
|
```jsx
|
295
|
299
|
<WebView
|
296
|
300
|
source={{ uri: 'https://reactnative.dev' }}
|
297
|
|
- onLoad={syntheticEvent => {
|
|
301
|
+ onLoad={(syntheticEvent) => {
|
298
|
302
|
const { nativeEvent } = syntheticEvent;
|
299
|
303
|
this.url = nativeEvent.url;
|
300
|
304
|
}}
|
|
@@ -327,7 +331,7 @@ Example:
|
327
|
331
|
```jsx
|
328
|
332
|
<WebView
|
329
|
333
|
source={{ uri: 'https://reactnative.dev' }}
|
330
|
|
- onLoadEnd={syntheticEvent => {
|
|
334
|
+ onLoadEnd={(syntheticEvent) => {
|
331
|
335
|
// update component to be aware of loading status
|
332
|
336
|
const { nativeEvent } = syntheticEvent;
|
333
|
337
|
this.isLoading = nativeEvent.loading;
|
|
@@ -361,7 +365,7 @@ Example:
|
361
|
365
|
```jsx
|
362
|
366
|
<WebView
|
363
|
367
|
source={{ uri: 'https://reactnative.dev/=' }}
|
364
|
|
- onLoadStart={syntheticEvent => {
|
|
368
|
+ onLoadStart={(syntheticEvent) => {
|
365
|
369
|
// update component to be aware of loading status
|
366
|
370
|
const { nativeEvent } = syntheticEvent;
|
367
|
371
|
this.isLoading = nativeEvent.loading;
|
|
@@ -386,8 +390,8 @@ url
|
386
|
390
|
|
387
|
391
|
Function that is invoked when the `WebView` is loading.
|
388
|
392
|
|
389
|
|
-| Type | Required | Platform |
|
390
|
|
-| -------- | -------- | --------- |
|
|
393
|
+| Type | Required | Platform |
|
|
394
|
+| -------- | -------- | ------------------- |
|
391
|
395
|
| function | No | iOS, Android, macOS |
|
392
|
396
|
|
393
|
397
|
Example:
|
|
@@ -431,7 +435,7 @@ Example:
|
431
|
435
|
```jsx
|
432
|
436
|
<WebView
|
433
|
437
|
source={{ uri: 'https://reactnative.dev' }}
|
434
|
|
- onHttpError={syntheticEvent => {
|
|
438
|
+ onHttpError={(syntheticEvent) => {
|
435
|
439
|
const { nativeEvent } = syntheticEvent;
|
436
|
440
|
console.warn(
|
437
|
441
|
'WebView received error status code: ',
|
|
@@ -519,7 +523,7 @@ Example:
|
519
|
523
|
```jsx
|
520
|
524
|
<WebView
|
521
|
525
|
source={{ uri: 'https://reactnative.dev' }}
|
522
|
|
- onNavigationStateChange={navState => {
|
|
526
|
+ onNavigationStateChange={(navState) => {
|
523
|
527
|
// Keep track of going back navigation within component
|
524
|
528
|
this.canGoBack = navState.canGoBack;
|
525
|
529
|
}}
|
|
@@ -538,8 +542,6 @@ title
|
538
|
542
|
url
|
539
|
543
|
```
|
540
|
544
|
|
541
|
|
-Note that this method will not be invoked on hash URL changes (e.g. from `https://example.com/users#list` to `https://example.com/users#help`). There is a workaround for this that is described [in the Guide](Guide.md#intercepting-hash-url-changes).
|
542
|
|
-
|
543
|
545
|
---
|
544
|
546
|
|
545
|
547
|
### `onContentProcessDidTerminate`[⬆](#props-index)<!-- Link generated with jump2header -->
|
|
@@ -555,7 +557,7 @@ Example:
|
555
|
557
|
```jsx
|
556
|
558
|
<WebView
|
557
|
559
|
source={{ uri: 'https://reactnative.dev' }}
|
558
|
|
- onContentProcessDidTerminate={syntheticEvent => {
|
|
560
|
+ onContentProcessDidTerminate={(syntheticEvent) => {
|
559
|
561
|
const { nativeEvent } = syntheticEvent;
|
560
|
562
|
console.warn('Content process terminated, reloading', nativeEvent);
|
561
|
563
|
this.refs.webview.reload();
|
|
@@ -580,8 +582,8 @@ url
|
580
|
582
|
|
581
|
583
|
List of origin strings to allow being navigated to. The strings allow wildcards and get matched against _just_ the origin (not the full URL). If the user taps to navigate to a new page but the new page is not in this whitelist, the URL will be handled by the OS. The default whitelisted origins are "http://*" and "https://*".
|
582
|
584
|
|
583
|
|
-| Type | Required | Platform |
|
584
|
|
-| ---------------- | -------- | -------- |
|
|
585
|
+| Type | Required | Platform |
|
|
586
|
+| ---------------- | -------- | ------------------- |
|
585
|
587
|
| array of strings | No | iOS, Android, macOS |
|
586
|
588
|
|
587
|
589
|
Example:
|
|
@@ -600,8 +602,8 @@ Example:
|
600
|
602
|
|
601
|
603
|
Function that returns a view to show if there's an error.
|
602
|
604
|
|
603
|
|
-| Type | Required | Platform |
|
604
|
|
-| -------- | -------- | -------- |
|
|
605
|
+| Type | Required | Platform |
|
|
606
|
+| -------- | -------- | ------------------- |
|
605
|
607
|
| function | No | iOS, Android, macOS |
|
606
|
608
|
|
607
|
609
|
Example:
|
|
@@ -609,7 +611,7 @@ Example:
|
609
|
611
|
```jsx
|
610
|
612
|
<WebView
|
611
|
613
|
source={{ uri: 'https://reactnative.dev' }}
|
612
|
|
- renderError={errorName => <Error name={errorName} />}
|
|
614
|
+ renderError={(errorName) => <Error name={errorName} />}
|
613
|
615
|
/>
|
614
|
616
|
```
|
615
|
617
|
|
|
@@ -621,8 +623,8 @@ The function passed to `renderError` will be called with the name of the error
|
621
|
623
|
|
622
|
624
|
Function that returns a loading indicator. The startInLoadingState prop must be set to true in order to use this prop.
|
623
|
625
|
|
624
|
|
-| Type | Required | Platform |
|
625
|
|
-| -------- | -------- | -------- |
|
|
626
|
+| Type | Required | Platform |
|
|
627
|
+| -------- | -------- | ------------------- |
|
626
|
628
|
| function | No | iOS, Android, macOS |
|
627
|
629
|
|
628
|
630
|
Example:
|
|
@@ -653,8 +655,8 @@ Function that allows custom handling of any web view requests. Return `true` fro
|
653
|
655
|
|
654
|
656
|
On Android, is not called on the first load.
|
655
|
657
|
|
656
|
|
-| Type | Required | Platform |
|
657
|
|
-| -------- | -------- | -------- |
|
|
658
|
+| Type | Required | Platform |
|
|
659
|
+| -------- | -------- | ------------------- |
|
658
|
660
|
| function | No | iOS, Android, macOS |
|
659
|
661
|
|
660
|
662
|
Example:
|
|
@@ -662,7 +664,7 @@ Example:
|
662
|
664
|
```jsx
|
663
|
665
|
<WebView
|
664
|
666
|
source={{ uri: 'https://reactnative.dev' }}
|
665
|
|
- onShouldStartLoadWithRequest={request => {
|
|
667
|
+ onShouldStartLoadWithRequest={(request) => {
|
666
|
668
|
// Only allow navigating within this website
|
667
|
669
|
return request.url.startsWith('https://reactnative.dev');
|
668
|
670
|
}}
|
|
@@ -681,6 +683,7 @@ canGoForward
|
681
|
683
|
lockIdentifier
|
682
|
684
|
mainDocumentURL (iOS only)
|
683
|
685
|
navigationType
|
|
686
|
+isTopFrame
|
684
|
687
|
```
|
685
|
688
|
|
686
|
689
|
---
|
|
@@ -689,8 +692,8 @@ navigationType
|
689
|
692
|
|
690
|
693
|
Boolean value that forces the `WebView` to show the loading view on the first load. This prop must be set to `true` in order for the `renderLoading` prop to work.
|
691
|
694
|
|
692
|
|
-| Type | Required | Platform |
|
693
|
|
-| ---- | -------- | -------- |
|
|
695
|
+| Type | Required | Platform |
|
|
696
|
+| ---- | -------- | ------------------- |
|
694
|
697
|
| bool | No | iOS, Android, macOS |
|
695
|
698
|
|
696
|
699
|
---
|
|
@@ -778,7 +781,7 @@ A Boolean value indicating whether JavaScript can open windows without user inte
|
778
|
781
|
|
779
|
782
|
### `androidHardwareAccelerationDisabled`[⬆](#props-index)<!-- Link generated with jump2header -->
|
780
|
783
|
|
781
|
|
-Boolean value to disable Hardware Acceleration in the `WebView`. Used on Android only as Hardware Acceleration is a feature only for Android. The default value is `false`.
|
|
784
|
+**Deprecated.** Use the `androidLayerType` prop instead.
|
782
|
785
|
|
783
|
786
|
| Type | Required | Platform |
|
784
|
787
|
| ---- | -------- | -------- |
|
|
@@ -786,6 +789,24 @@ Boolean value to disable Hardware Acceleration in the `WebView`. Used on Android
|
786
|
789
|
|
787
|
790
|
---
|
788
|
791
|
|
|
792
|
+### `androidLayerType`[⬆](#props-index)<!-- Link generated with jump2header -->
|
|
793
|
+
|
|
794
|
+Specifies the layer type.
|
|
795
|
+
|
|
796
|
+Possible values for `androidLayerType` are:
|
|
797
|
+
|
|
798
|
+- `none` (default) - The view does not have a layer.
|
|
799
|
+- `software` - The view has a software layer. A software layer is backed by a bitmap and causes the view to be rendered using Android's software rendering pipeline, even if hardware acceleration is enabled.
|
|
800
|
+- `hardware` - The view has a hardware layer. A hardware layer is backed by a hardware specific texture and causes the view to be rendered using Android's hardware rendering pipeline, but only if hardware acceleration is turned on for the view hierarchy.
|
|
801
|
+
|
|
802
|
+Avoid setting both `androidLayerType` and `androidHardwareAccelerationDisabled` props at the same time, as this may cause undefined behaviour.
|
|
803
|
+
|
|
804
|
+| Type | Required | Platform |
|
|
805
|
+| ------ | -------- | -------- |
|
|
806
|
+| string | No | Android |
|
|
807
|
+
|
|
808
|
+---
|
|
809
|
+
|
789
|
810
|
### `mixedContentMode`[⬆](#props-index)<!-- Link generated with jump2header -->
|
790
|
811
|
|
791
|
812
|
Specifies the mixed content mode. i.e WebView will allow a secure origin to load content from any other origin.
|
|
@@ -816,8 +837,8 @@ Boolean value to enable third party cookies in the `WebView`. Used on Android Lo
|
816
|
837
|
|
817
|
838
|
Sets the user-agent for the `WebView`.
|
818
|
839
|
|
819
|
|
-| Type | Required | Platform |
|
820
|
|
-| ------ | -------- | -------- |
|
|
840
|
+| Type | Required | Platform |
|
|
841
|
+| ------ | -------- | ------------------- |
|
821
|
842
|
| string | No | iOS, Android, macOS |
|
822
|
843
|
|
823
|
844
|
---
|
|
@@ -826,8 +847,8 @@ Sets the user-agent for the `WebView`.
|
826
|
847
|
|
827
|
848
|
Append to the existing user-agent. Setting `userAgent` will override this.
|
828
|
849
|
|
829
|
|
-| Type | Required | Platform |
|
830
|
|
-| ------ | -------- | -------- |
|
|
850
|
+| Type | Required | Platform |
|
|
851
|
+| ------ | -------- | ------------------- |
|
831
|
852
|
| string | No | iOS, Android, macOS |
|
832
|
853
|
|
833
|
854
|
```jsx
|
|
@@ -917,6 +938,24 @@ Possible values:
|
917
|
938
|
|
918
|
939
|
---
|
919
|
940
|
|
|
941
|
+### `contentMode`[⬆](#props-index)<!-- Link generated with jump2header -->
|
|
942
|
+
|
|
943
|
+Controls the type of content to load. Available on iOS 13 and later. Defaults to `recommended`, which loads mobile content on iPhone & iPad Mini but desktop content on larger iPads.
|
|
944
|
+
|
|
945
|
+See [Introducing Desktop-class Browsing on iPad](https://developer.apple.com/videos/play/wwdc2019/203/) for more.
|
|
946
|
+
|
|
947
|
+Possible values:
|
|
948
|
+
|
|
949
|
+- `recommended`
|
|
950
|
+- `mobile`
|
|
951
|
+- `desktop`
|
|
952
|
+
|
|
953
|
+| Type | Required | Platform |
|
|
954
|
+| ------ | -------- | -------- |
|
|
955
|
+| string | No | iOS |
|
|
956
|
+
|
|
957
|
+---
|
|
958
|
+
|
920
|
959
|
### `dataDetectorTypes`[⬆](#props-index)<!-- Link generated with jump2header -->
|
921
|
960
|
|
922
|
961
|
Determines the types of data converted to clickable URLs in the web view's content. By default only phone numbers are detected.
|
|
@@ -966,8 +1005,8 @@ The default value is `true`.
|
966
|
1005
|
|
967
|
1006
|
Boolean value that determines whether a horizontal scroll indicator is shown in the `WebView`. The default value is `true`.
|
968
|
1007
|
|
969
|
|
-| Type | Required | Platform |
|
970
|
|
-| ---- | -------- | -------- |
|
|
1008
|
+| Type | Required | Platform |
|
|
1009
|
+| ---- | -------- | ------------------- |
|
971
|
1010
|
| bool | No | iOS, Android, macOS |
|
972
|
1011
|
|
973
|
1012
|
---
|
|
@@ -976,8 +1015,8 @@ Boolean value that determines whether a horizontal scroll indicator is shown in
|
976
|
1015
|
|
977
|
1016
|
Boolean value that determines whether a vertical scroll indicator is shown in the `WebView`. The default value is `true`.
|
978
|
1017
|
|
979
|
|
-| Type | Required | Platform |
|
980
|
|
-| ---- | -------- | -------- |
|
|
1018
|
+| Type | Required | Platform |
|
|
1019
|
+| ---- | -------- | ------------------- |
|
981
|
1020
|
| bool | No | iOS, Android, macOS |
|
982
|
1021
|
|
983
|
1022
|
---
|
|
@@ -996,8 +1035,8 @@ Set whether Geolocation is enabled in the `WebView`. The default value is `false
|
996
|
1035
|
|
997
|
1036
|
Boolean that sets whether JavaScript running in the context of a file scheme URL should be allowed to access content from other file scheme URLs. The default value is `false`.
|
998
|
1037
|
|
999
|
|
-| Type | Required | Platform |
|
1000
|
|
-| ---- | -------- | -------- |
|
|
1038
|
+| Type | Required | Platform |
|
|
1039
|
+| ---- | -------- | ------------------- |
|
1001
|
1040
|
| bool | No | iOS, Android, macOS |
|
1002
|
1041
|
|
1003
|
1042
|
---
|
|
@@ -1076,8 +1115,8 @@ If true, this will be able horizontal swipe gestures. The default value is `fals
|
1076
|
1115
|
|
1077
|
1116
|
Does not store any data within the lifetime of the WebView.
|
1078
|
1117
|
|
1079
|
|
-| Type | Required | Platform |
|
1080
|
|
-| ------- | -------- | -------- |
|
|
1118
|
+| Type | Required | Platform |
|
|
1119
|
+| ------- | -------- | ------------------- |
|
1081
|
1120
|
| boolean | No | iOS, Android, macOS |
|
1082
|
1121
|
|
1083
|
1122
|
---
|
|
@@ -1106,8 +1145,8 @@ Sets whether the WebView should disable saving form data. The default value is `
|
1106
|
1145
|
|
1107
|
1146
|
Sets whether WebView should use browser caching.
|
1108
|
1147
|
|
1109
|
|
-| Type | Required | Default | Platform |
|
1110
|
|
-| ------- | -------- | ------- | -------- |
|
|
1148
|
+| Type | Required | Default | Platform |
|
|
1149
|
+| ------- | -------- | ------- | ------------------- |
|
1111
|
1150
|
| boolean | No | true | iOS, Android, macOS |
|
1112
|
1151
|
|
1113
|
1152
|
---
|
|
@@ -1173,6 +1212,16 @@ Example:
|
1173
|
1212
|
|
1174
|
1213
|
`<WebView textZoom={100} />`
|
1175
|
1214
|
|
|
1215
|
+---
|
|
1216
|
+
|
|
1217
|
+### `pullToRefreshEnabled`[⬆](#props-index)<!-- Link generated with jump2header -->
|
|
1218
|
+
|
|
1219
|
+Boolean value that determines whether a pull to refresh gesture is available in the `WebView`. The default value is `false`. If `true`, sets `bounces` automatically to `true`.
|
|
1220
|
+
|
|
1221
|
+| Type | Required | Platform |
|
|
1222
|
+| ------- | -------- | -------- |
|
|
1223
|
+| boolean | No | iOS |
|
|
1224
|
+
|
1176
|
1225
|
### `ignoreSilentHardwareSwitch`[⬆](#props-index)<!-- Link generated with jump2header -->
|
1177
|
1226
|
|
1178
|
1227
|
(ios only)
|
|
@@ -1202,18 +1251,35 @@ the file.
|
1202
|
1251
|
If not provided, the default is to let the webview try to render the file.
|
1203
|
1252
|
|
1204
|
1253
|
Example:
|
|
1254
|
+
|
1205
|
1255
|
```jsx
|
1206
|
1256
|
<WebView
|
1207
|
1257
|
source={{ uri: 'https://reactnative.dev' }}
|
1208
|
|
- onFileDownload={ ( { nativeEvent: { downloadUrl } } ) => {
|
|
1258
|
+ onFileDownload={({ nativeEvent: { downloadUrl } }) => {
|
1209
|
1259
|
// You use downloadUrl which is a string to download files however you want.
|
1210
|
1260
|
}}
|
1211
|
|
- />
|
|
1261
|
+/>
|
1212
|
1262
|
```
|
1213
|
1263
|
|
|
1264
|
+| Type | Required | Platform |
|
|
1265
|
+| -------- | -------- | -------- |
|
|
1266
|
+| function | No | iOS |
|
|
1267
|
+
|
|
1268
|
+---
|
|
1269
|
+
|
|
1270
|
+### `autoManageStatusBarEnabled`
|
|
1271
|
+
|
|
1272
|
+If set to `true`, the status bar will be automatically hidden/shown by WebView, specifically when full screen video is being watched. If `false`, WebView will not manage the status bar at all. The default value is `true`.
|
|
1273
|
+
|
1214
|
1274
|
| Type | Required | Platform |
|
1215
|
1275
|
| ------- | -------- | -------- |
|
1216
|
|
-| function | No | iOS |
|
|
1276
|
+| boolean | No | iOS |
|
|
1277
|
+
|
|
1278
|
+Example:
|
|
1279
|
+
|
|
1280
|
+```javascript
|
|
1281
|
+<WebView autoManageStatusBarEnabled={false} />
|
|
1282
|
+```
|
1217
|
1283
|
|
1218
|
1284
|
## Methods
|
1219
|
1285
|
|
|
@@ -1278,6 +1344,7 @@ Request the webView to ask for focus. (People working on TV apps might want havi
|
1278
|
1344
|
```javascript
|
1279
|
1345
|
postMessage('message');
|
1280
|
1346
|
```
|
|
1347
|
+
|
1281
|
1348
|
Post a message to WebView, handled by [`onMessage`](Reference.md#onmessage).
|
1282
|
1349
|
|
1283
|
1350
|
### `clearFormData()`[⬆](#methods-index)<!-- Link generated with jump2header -->
|