Browse Source

feat(iOS): Add prop autoManageStatusBarEnabled (#914)

Co-authored-by: Jamon Holmgren <jamon@infinite.red>
Co-authored-by: Jamon Holmgren <jamonholmgren@gmail.com>
Co-authored-by: Thibault Malbranche <thibault.malbranche@epitech.eu>
Kesha Antonov 4 years ago
parent
commit
22a60fd23a
No account linked to committer's email address
5 changed files with 91 additions and 54 deletions
  1. 1
    0
      apple/RNCWebView.h
  2. 10
    2
      apple/RNCWebView.m
  3. 1
    0
      apple/RNCWebViewManager.m
  4. 71
    52
      docs/Reference.md
  5. 8
    0
      src/WebViewTypes.ts

+ 1
- 0
apple/RNCWebView.h View File

35
 @property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
35
 @property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
36
 @property (nonatomic, assign) BOOL scrollEnabled;
36
 @property (nonatomic, assign) BOOL scrollEnabled;
37
 @property (nonatomic, assign) BOOL sharedCookiesEnabled;
37
 @property (nonatomic, assign) BOOL sharedCookiesEnabled;
38
+@property (nonatomic, assign) BOOL autoManageStatusBarEnabled;
38
 @property (nonatomic, assign) BOOL pagingEnabled;
39
 @property (nonatomic, assign) BOOL pagingEnabled;
39
 @property (nonatomic, assign) CGFloat decelerationRate;
40
 @property (nonatomic, assign) CGFloat decelerationRate;
40
 @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
41
 @property (nonatomic, assign) BOOL allowsInlineMediaPlayback;

+ 10
- 2
apple/RNCWebView.m View File

125
     _showsVerticalScrollIndicator = YES;
125
     _showsVerticalScrollIndicator = YES;
126
     _directionalLockEnabled = YES;
126
     _directionalLockEnabled = YES;
127
     _automaticallyAdjustContentInsets = YES;
127
     _automaticallyAdjustContentInsets = YES;
128
+    _autoManageStatusBarEnabled = YES;
128
     _contentInset = UIEdgeInsetsZero;
129
     _contentInset = UIEdgeInsetsZero;
129
     _savedKeyboardDisplayRequiresUserAction = YES;
130
     _savedKeyboardDisplayRequiresUserAction = YES;
130
     #if !TARGET_OS_OSX
131
     #if !TARGET_OS_OSX
335
 -(void)showFullScreenVideoStatusBars
336
 -(void)showFullScreenVideoStatusBars
336
 {
337
 {
337
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
338
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
339
+    if (!_autoManageStatusBarEnabled) {
340
+      return;
341
+    }
342
+
338
     _isFullScreenVideoOpen = YES;
343
     _isFullScreenVideoOpen = YES;
339
     RCTUnsafeExecuteOnMainQueueSync(^{
344
     RCTUnsafeExecuteOnMainQueueSync(^{
340
-      [RCTSharedApplication() setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
345
+      [RCTSharedApplication() setStatusBarStyle:self->_savedStatusBarStyle animated:YES];
341
     });
346
     });
342
 #pragma clang diagnostic pop
347
 #pragma clang diagnostic pop
343
 }
348
 }
345
 -(void)hideFullScreenVideoStatusBars
350
 -(void)hideFullScreenVideoStatusBars
346
 {
351
 {
347
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
352
 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
353
+    if (!_autoManageStatusBarEnabled) {
354
+      return;
355
+    }
356
+
348
     _isFullScreenVideoOpen = NO;
357
     _isFullScreenVideoOpen = NO;
349
     RCTUnsafeExecuteOnMainQueueSync(^{
358
     RCTUnsafeExecuteOnMainQueueSync(^{
350
       [RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES];
359
       [RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES];
1375
 }
1384
 }
1376
 
1385
 
1377
 @end
1386
 @end
1378
-

+ 1
- 0
apple/RNCWebViewManager.m View File

66
 #endif
66
 #endif
67
 RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)
67
 RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)
68
 RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)
68
 RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)
69
+RCT_EXPORT_VIEW_PROPERTY(autoManageStatusBarEnabled, BOOL)
69
 RCT_EXPORT_VIEW_PROPERTY(hideKeyboardAccessoryView, BOOL)
70
 RCT_EXPORT_VIEW_PROPERTY(hideKeyboardAccessoryView, BOOL)
70
 RCT_EXPORT_VIEW_PROPERTY(allowsBackForwardNavigationGestures, BOOL)
71
 RCT_EXPORT_VIEW_PROPERTY(allowsBackForwardNavigationGestures, BOOL)
71
 RCT_EXPORT_VIEW_PROPERTY(incognito, BOOL)
72
 RCT_EXPORT_VIEW_PROPERTY(incognito, BOOL)

+ 71
- 52
docs/Reference.md View File

71
 - [`pullToRefreshEnabled`](Reference.md#pullToRefreshEnabled)
71
 - [`pullToRefreshEnabled`](Reference.md#pullToRefreshEnabled)
72
 - [`ignoreSilentHardwareSwitch`](Reference.md#ignoreSilentHardwareSwitch)
72
 - [`ignoreSilentHardwareSwitch`](Reference.md#ignoreSilentHardwareSwitch)
73
 - [`onFileDownload`](Reference.md#onFileDownload)
73
 - [`onFileDownload`](Reference.md#onFileDownload)
74
+- [`autoManageStatusBarEnabled`](Reference.md#autoManageStatusBarEnabled)
74
 
75
 
75
 ## Methods Index
76
 ## Methods Index
76
 
77
 
136
 
137
 
137
 On iOS, see [`WKUserScriptInjectionTimeAtDocumentEnd`](https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentend?language=objc)
138
 On iOS, see [`WKUserScriptInjectionTimeAtDocumentEnd`](https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentend?language=objc)
138
 
139
 
139
-| Type   | Required | Platform |
140
-| ------ | -------- | -------- |
141
-| string | No       | iOS, Android, macOS
140
+| Type   | Required | Platform            |
141
+| ------ | -------- | ------------------- |
142
+| string | No       | iOS, Android, macOS |
142
 
143
 
143
 To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
144
 To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
144
 
145
 
168
 
169
 
169
 On iOS, see [`WKUserScriptInjectionTimeAtDocumentStart`](https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentstart?language=objc)
170
 On iOS, see [`WKUserScriptInjectionTimeAtDocumentStart`](https://developer.apple.com/documentation/webkit/wkuserscriptinjectiontime/wkuserscriptinjectiontimeatdocumentstart?language=objc)
170
 
171
 
171
-| Type   | Required | Platform |
172
-| ------ | -------- | -------- |
172
+| Type   | Required | Platform   |
173
+| ------ | -------- | ---------- |
173
 | string | No       | iOS, macOS |
174
 | string | No       | iOS, macOS |
174
 
175
 
175
 To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
176
 To learn more, read the [Communicating between JS and Native](Guide.md#communicating-between-js-and-native) guide.
176
 
177
 
177
 Example:
178
 Example:
178
 
179
 
179
-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.
180
 
181
 
181
 ```jsx
182
 ```jsx
182
 const INJECTED_JAVASCRIPT = `(function() {
183
 const INJECTED_JAVASCRIPT = `(function() {
198
 
199
 
199
 If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
200
 If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
200
 
201
 
201
-| Type   | Required | Platform |
202
-| ------ | -------- | -------- |
202
+| Type | Required | Platform                                          |
203
+| ---- | -------- | ------------------------------------------------- |
203
 | bool | No       | iOS and macOS (only `true` supported for Android) |
204
 | bool | No       | iOS and macOS (only `true` supported for Android) |
204
 
205
 
205
 ---
206
 ---
210
 
211
 
211
 If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
212
 If `false`, (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
212
 
213
 
213
-| Type   | Required | Platform |
214
-| ------ | -------- | -------- |
214
+| Type | Required | Platform                                          |
215
+| ---- | -------- | ------------------------------------------------- |
215
 | bool | No       | iOS and macOS (only `true` supported for Android) |
216
 | bool | No       | iOS and macOS (only `true` supported for Android) |
216
 
217
 
217
 ---
218
 ---
222
 
223
 
223
 NOTE: the default `true` value might cause some videos to hang loading on iOS. Setting it to `false` could fix this issue.
224
 NOTE: the default `true` value might cause some videos to hang loading on iOS. Setting it to `false` could fix this issue.
224
 
225
 
225
-| Type | Required | Platform |
226
-| ---- | -------- | -------- |
226
+| Type | Required | Platform            |
227
+| ---- | -------- | ------------------- |
227
 | bool | No       | iOS, Android, macOS |
228
 | bool | No       | iOS, Android, macOS |
228
 
229
 
229
 ---
230
 ---
238
 - `props` (object)
239
 - `props` (object)
239
 - `viewManager` (object)
240
 - `viewManager` (object)
240
 
241
 
241
-| Type   | Required | Platform |
242
-| ------ | -------- | -------- |
242
+| Type   | Required | Platform            |
243
+| ------ | -------- | ------------------- |
243
 | object | No       | iOS, Android, macOS |
244
 | object | No       | iOS, Android, macOS |
244
 
245
 
245
 ---
246
 ---
257
 ```jsx
258
 ```jsx
258
 <WebView
259
 <WebView
259
   source={{ uri: 'https://reactnative.dev' }}
260
   source={{ uri: 'https://reactnative.dev' }}
260
-  onError={syntheticEvent => {
261
+  onError={(syntheticEvent) => {
261
     const { nativeEvent } = syntheticEvent;
262
     const { nativeEvent } = syntheticEvent;
262
     console.warn('WebView error: ', nativeEvent);
263
     console.warn('WebView error: ', nativeEvent);
263
   }}
264
   }}
297
 ```jsx
298
 ```jsx
298
 <WebView
299
 <WebView
299
   source={{ uri: 'https://reactnative.dev' }}
300
   source={{ uri: 'https://reactnative.dev' }}
300
-  onLoad={syntheticEvent => {
301
+  onLoad={(syntheticEvent) => {
301
     const { nativeEvent } = syntheticEvent;
302
     const { nativeEvent } = syntheticEvent;
302
     this.url = nativeEvent.url;
303
     this.url = nativeEvent.url;
303
   }}
304
   }}
330
 ```jsx
331
 ```jsx
331
 <WebView
332
 <WebView
332
   source={{ uri: 'https://reactnative.dev' }}
333
   source={{ uri: 'https://reactnative.dev' }}
333
-  onLoadEnd={syntheticEvent => {
334
+  onLoadEnd={(syntheticEvent) => {
334
     // update component to be aware of loading status
335
     // update component to be aware of loading status
335
     const { nativeEvent } = syntheticEvent;
336
     const { nativeEvent } = syntheticEvent;
336
     this.isLoading = nativeEvent.loading;
337
     this.isLoading = nativeEvent.loading;
364
 ```jsx
365
 ```jsx
365
 <WebView
366
 <WebView
366
   source={{ uri: 'https://reactnative.dev/=' }}
367
   source={{ uri: 'https://reactnative.dev/=' }}
367
-  onLoadStart={syntheticEvent => {
368
+  onLoadStart={(syntheticEvent) => {
368
     // update component to be aware of loading status
369
     // update component to be aware of loading status
369
     const { nativeEvent } = syntheticEvent;
370
     const { nativeEvent } = syntheticEvent;
370
     this.isLoading = nativeEvent.loading;
371
     this.isLoading = nativeEvent.loading;
389
 
390
 
390
 Function that is invoked when the `WebView` is loading.
391
 Function that is invoked when the `WebView` is loading.
391
 
392
 
392
-| Type     | Required | Platform |
393
-| -------- | -------- | --------- |
393
+| Type     | Required | Platform            |
394
+| -------- | -------- | ------------------- |
394
 | function | No       | iOS, Android, macOS |
395
 | function | No       | iOS, Android, macOS |
395
 
396
 
396
 Example:
397
 Example:
434
 ```jsx
435
 ```jsx
435
 <WebView
436
 <WebView
436
   source={{ uri: 'https://reactnative.dev' }}
437
   source={{ uri: 'https://reactnative.dev' }}
437
-  onHttpError={syntheticEvent => {
438
+  onHttpError={(syntheticEvent) => {
438
     const { nativeEvent } = syntheticEvent;
439
     const { nativeEvent } = syntheticEvent;
439
     console.warn(
440
     console.warn(
440
       'WebView received error status code: ',
441
       'WebView received error status code: ',
522
 ```jsx
523
 ```jsx
523
 <WebView
524
 <WebView
524
   source={{ uri: 'https://reactnative.dev' }}
525
   source={{ uri: 'https://reactnative.dev' }}
525
-  onNavigationStateChange={navState => {
526
+  onNavigationStateChange={(navState) => {
526
     // Keep track of going back navigation within component
527
     // Keep track of going back navigation within component
527
     this.canGoBack = navState.canGoBack;
528
     this.canGoBack = navState.canGoBack;
528
   }}
529
   }}
556
 ```jsx
557
 ```jsx
557
 <WebView
558
 <WebView
558
   source={{ uri: 'https://reactnative.dev' }}
559
   source={{ uri: 'https://reactnative.dev' }}
559
-  onContentProcessDidTerminate={syntheticEvent => {
560
+  onContentProcessDidTerminate={(syntheticEvent) => {
560
     const { nativeEvent } = syntheticEvent;
561
     const { nativeEvent } = syntheticEvent;
561
     console.warn('Content process terminated, reloading', nativeEvent);
562
     console.warn('Content process terminated, reloading', nativeEvent);
562
     this.refs.webview.reload();
563
     this.refs.webview.reload();
581
 
582
 
582
 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://*".
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://*".
583
 
584
 
584
-| Type             | Required | Platform |
585
-| ---------------- | -------- | -------- |
585
+| Type             | Required | Platform            |
586
+| ---------------- | -------- | ------------------- |
586
 | array of strings | No       | iOS, Android, macOS |
587
 | array of strings | No       | iOS, Android, macOS |
587
 
588
 
588
 Example:
589
 Example:
601
 
602
 
602
 Function that returns a view to show if there's an error.
603
 Function that returns a view to show if there's an error.
603
 
604
 
604
-| Type     | Required | Platform |
605
-| -------- | -------- | -------- |
605
+| Type     | Required | Platform            |
606
+| -------- | -------- | ------------------- |
606
 | function | No       | iOS, Android, macOS |
607
 | function | No       | iOS, Android, macOS |
607
 
608
 
608
 Example:
609
 Example:
610
 ```jsx
611
 ```jsx
611
 <WebView
612
 <WebView
612
   source={{ uri: 'https://reactnative.dev' }}
613
   source={{ uri: 'https://reactnative.dev' }}
613
-  renderError={errorName => <Error name={errorName} />}
614
+  renderError={(errorName) => <Error name={errorName} />}
614
 />
615
 />
615
 ```
616
 ```
616
 
617
 
622
 
623
 
623
 Function that returns a loading indicator. The startInLoadingState prop must be set to true in order to use this prop.
624
 Function that returns a loading indicator. The startInLoadingState prop must be set to true in order to use this prop.
624
 
625
 
625
-| Type     | Required | Platform |
626
-| -------- | -------- | -------- |
626
+| Type     | Required | Platform            |
627
+| -------- | -------- | ------------------- |
627
 | function | No       | iOS, Android, macOS |
628
 | function | No       | iOS, Android, macOS |
628
 
629
 
629
 Example:
630
 Example:
654
 
655
 
655
 On Android, is not called on the first load.
656
 On Android, is not called on the first load.
656
 
657
 
657
-| Type     | Required | Platform |
658
-| -------- | -------- | -------- |
658
+| Type     | Required | Platform            |
659
+| -------- | -------- | ------------------- |
659
 | function | No       | iOS, Android, macOS |
660
 | function | No       | iOS, Android, macOS |
660
 
661
 
661
 Example:
662
 Example:
663
 ```jsx
664
 ```jsx
664
 <WebView
665
 <WebView
665
   source={{ uri: 'https://reactnative.dev' }}
666
   source={{ uri: 'https://reactnative.dev' }}
666
-  onShouldStartLoadWithRequest={request => {
667
+  onShouldStartLoadWithRequest={(request) => {
667
     // Only allow navigating within this website
668
     // Only allow navigating within this website
668
     return request.url.startsWith('https://reactnative.dev');
669
     return request.url.startsWith('https://reactnative.dev');
669
   }}
670
   }}
691
 
692
 
692
 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.
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.
693
 
694
 
694
-| Type | Required | Platform |
695
-| ---- | -------- | -------- |
695
+| Type | Required | Platform            |
696
+| ---- | -------- | ------------------- |
696
 | bool | No       | iOS, Android, macOS |
697
 | bool | No       | iOS, Android, macOS |
697
 
698
 
698
 ---
699
 ---
836
 
837
 
837
 Sets the user-agent for the `WebView`.
838
 Sets the user-agent for the `WebView`.
838
 
839
 
839
-| Type   | Required | Platform |
840
-| ------ | -------- | -------- |
840
+| Type   | Required | Platform            |
841
+| ------ | -------- | ------------------- |
841
 | string | No       | iOS, Android, macOS |
842
 | string | No       | iOS, Android, macOS |
842
 
843
 
843
 ---
844
 ---
846
 
847
 
847
 Append to the existing user-agent. Setting `userAgent` will override this.
848
 Append to the existing user-agent. Setting `userAgent` will override this.
848
 
849
 
849
-| Type   | Required | Platform |
850
-| ------ | -------- | -------- |
850
+| Type   | Required | Platform            |
851
+| ------ | -------- | ------------------- |
851
 | string | No       | iOS, Android, macOS |
852
 | string | No       | iOS, Android, macOS |
852
 
853
 
853
 ```jsx
854
 ```jsx
1004
 
1005
 
1005
 Boolean value that determines whether a horizontal scroll indicator is shown in the `WebView`. The default value is `true`.
1006
 Boolean value that determines whether a horizontal scroll indicator is shown in the `WebView`. The default value is `true`.
1006
 
1007
 
1007
-| Type | Required | Platform |
1008
-| ---- | -------- | -------- |
1008
+| Type | Required | Platform            |
1009
+| ---- | -------- | ------------------- |
1009
 | bool | No       | iOS, Android, macOS |
1010
 | bool | No       | iOS, Android, macOS |
1010
 
1011
 
1011
 ---
1012
 ---
1014
 
1015
 
1015
 Boolean value that determines whether a vertical scroll indicator is shown in the `WebView`. The default value is `true`.
1016
 Boolean value that determines whether a vertical scroll indicator is shown in the `WebView`. The default value is `true`.
1016
 
1017
 
1017
-| Type | Required | Platform |
1018
-| ---- | -------- | -------- |
1018
+| Type | Required | Platform            |
1019
+| ---- | -------- | ------------------- |
1019
 | bool | No       | iOS, Android, macOS |
1020
 | bool | No       | iOS, Android, macOS |
1020
 
1021
 
1021
 ---
1022
 ---
1034
 
1035
 
1035
 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`.
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`.
1036
 
1037
 
1037
-| Type | Required | Platform |
1038
-| ---- | -------- | -------- |
1038
+| Type | Required | Platform            |
1039
+| ---- | -------- | ------------------- |
1039
 | bool | No       | iOS, Android, macOS |
1040
 | bool | No       | iOS, Android, macOS |
1040
 
1041
 
1041
 ---
1042
 ---
1114
 
1115
 
1115
 Does not store any data within the lifetime of the WebView.
1116
 Does not store any data within the lifetime of the WebView.
1116
 
1117
 
1117
-| Type    | Required | Platform |
1118
-| ------- | -------- | -------- |
1118
+| Type    | Required | Platform            |
1119
+| ------- | -------- | ------------------- |
1119
 | boolean | No       | iOS, Android, macOS |
1120
 | boolean | No       | iOS, Android, macOS |
1120
 
1121
 
1121
 ---
1122
 ---
1144
 
1145
 
1145
 Sets whether WebView should use browser caching.
1146
 Sets whether WebView should use browser caching.
1146
 
1147
 
1147
-| Type    | Required | Default | Platform |
1148
-| ------- | -------- | ------- | -------- |
1148
+| Type    | Required | Default | Platform            |
1149
+| ------- | -------- | ------- | ------------------- |
1149
 | boolean | No       | true    | iOS, Android, macOS |
1150
 | boolean | No       | true    | iOS, Android, macOS |
1150
 
1151
 
1151
 ---
1152
 ---
1250
 If not provided, the default is to let the webview try to render the file.
1251
 If not provided, the default is to let the webview try to render the file.
1251
 
1252
 
1252
 Example:
1253
 Example:
1254
+
1253
 ```jsx
1255
 ```jsx
1254
 <WebView
1256
 <WebView
1255
   source={{ uri: 'https://reactnative.dev' }}
1257
   source={{ uri: 'https://reactnative.dev' }}
1256
-  onFileDownload={ ( { nativeEvent: { downloadUrl } } ) => {
1258
+  onFileDownload={({ nativeEvent: { downloadUrl } }) => {
1257
     // You use downloadUrl which is a string to download files however you want.
1259
     // You use downloadUrl which is a string to download files however you want.
1258
   }}
1260
   }}
1259
-  />
1261
+/>
1260
 ```
1262
 ```
1261
 
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
+
1262
 | Type    | Required | Platform |
1274
 | Type    | Required | Platform |
1263
 | ------- | -------- | -------- |
1275
 | ------- | -------- | -------- |
1264
-| function | No       | iOS      |
1276
+| boolean | No       | iOS      |
1277
+
1278
+Example:
1279
+
1280
+```javascript
1281
+<WebView autoManageStatusBarEnabled={false} />
1282
+```
1265
 
1283
 
1266
 ## Methods
1284
 ## Methods
1267
 
1285
 
1326
 ```javascript
1344
 ```javascript
1327
 postMessage('message');
1345
 postMessage('message');
1328
 ```
1346
 ```
1347
+
1329
 Post a message to WebView, handled by [`onMessage`](Reference.md#onmessage).
1348
 Post a message to WebView, handled by [`onMessage`](Reference.md#onmessage).
1330
 
1349
 
1331
 ### `clearFormData()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1350
 ### `clearFormData()`[⬆](#methods-index)<!-- Link generated with jump2header -->

+ 8
- 0
src/WebViewTypes.ts View File

311
   allowsInlineMediaPlayback?: boolean;
311
   allowsInlineMediaPlayback?: boolean;
312
   allowsLinkPreview?: boolean;
312
   allowsLinkPreview?: boolean;
313
   automaticallyAdjustContentInsets?: boolean;
313
   automaticallyAdjustContentInsets?: boolean;
314
+  autoManageStatusBarEnabled?: boolean;
314
   bounces?: boolean;
315
   bounces?: boolean;
315
   contentInset?: ContentInsetProp;
316
   contentInset?: ContentInsetProp;
316
   contentInsetAdjustmentBehavior?: ContentInsetAdjustmentBehavior;
317
   contentInsetAdjustmentBehavior?: ContentInsetAdjustmentBehavior;
498
    */
499
    */
499
   sharedCookiesEnabled?: boolean;
500
   sharedCookiesEnabled?: boolean;
500
 
501
 
502
+  /**
503
+   * Set true if StatusBar should be light when user watch video fullscreen.
504
+   * The default value is `true`.
505
+   * @platform ios
506
+   */
507
+  autoManageStatusBarEnabled?: boolean;
508
+
501
   /**
509
   /**
502
    * A Boolean value that determines whether scrolling is disabled in a particular direction.
510
    * A Boolean value that determines whether scrolling is disabled in a particular direction.
503
    * The default value is `true`.
511
    * The default value is `true`.