From 2b28b4409da8cd158837c366e400a588d6d945aa Mon Sep 17 00:00:00 2001 From: Donghyeun Kim Date: Fri, 30 May 2025 04:28:40 +0900 Subject: [PATCH 01/18] chore: correct spelling error in WebView documentation (#3771) --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 394b44493..8da90a04e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -33,7 +33,7 @@ declare class WebView

extends Component { injectJavaScript: (script: string) => void; /** - * Focuses on WebView redered page. + * Focuses on WebView rendered page. */ requestFocus: () => void; From f66ecfdad7058068c7b3dca19b5648a6ba5cb687 Mon Sep 17 00:00:00 2001 From: Florian Daniel Date: Thu, 29 May 2025 21:29:54 +0200 Subject: [PATCH 02/18] chore: Update JSDOC for clearCache (#3748) --- index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 8da90a04e..a85ac8535 100644 --- a/index.d.ts +++ b/index.d.ts @@ -49,10 +49,9 @@ declare class WebView

extends Component { clearFormData?: () => void; /** - * (Android only) * Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used. */ - clearCache?: (clear: boolean) => void; + clearCache?: (includeDiskFiles: boolean) => void; /** * (Android only) From 159e207384cd62bdd6a8f3d5bec1b55b90a3256e Mon Sep 17 00:00:00 2001 From: Robert Keresnyei Date: Thu, 29 May 2025 21:32:20 +0200 Subject: [PATCH 03/18] chore: Improve domStorageEnabled documentation (#3769) --- docs/Reference.md | 2 +- src/WebViewTypes.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Reference.md b/docs/Reference.md index 897cada86..480fd4850 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -897,7 +897,7 @@ A floating-point number that determines how quickly the scroll view decelerates ### `domStorageEnabled`[⬆](#props-index) -Boolean value to control whether DOM Storage is enabled. Used only in Android. +Boolean value to control whether DOM Storage is enabled. Used only in Android. The default value is `true`. | Type | Required | Platform | | ---- | -------- | -------- | diff --git a/src/WebViewTypes.ts b/src/WebViewTypes.ts index c8e017e62..ce1378435 100644 --- a/src/WebViewTypes.ts +++ b/src/WebViewTypes.ts @@ -1044,7 +1044,7 @@ export interface AndroidWebViewProps extends WebViewSharedProps { /** * Boolean value to control whether DOM Storage is enabled. Used only in - * Android. + * Android. The default value is `true`. * @platform android */ domStorageEnabled?: boolean; From 6af6a830aea5b57ca68c1935c927759244c7d6fd Mon Sep 17 00:00:00 2001 From: animaonline Date: Sun, 1 Jun 2025 03:17:06 +0200 Subject: [PATCH 04/18] feat(ios): Added support for scrollview indicatorStyle (#3743) * added support for light scroll indicators on iOS * rename prop, and cleaned * Update RNCWebViewManager.java --------- Co-authored-by: Roman Alifanov Co-authored-by: Thibault Malbranche Co-authored-by: Thibault Malbranche --- .../webview/RNCWebViewManager.java | 3 ++ apple/RNCWebView.mm | 27 ++++++++++------ apple/RNCWebViewImpl.h | 1 + apple/RNCWebViewImpl.m | 32 ++++++++++++++++--- apple/RNCWebViewManager.mm | 4 +++ docs/Reference.md | 11 +++++++ src/RNCWebViewNativeComponent.ts | 1 + src/WebViewTypes.ts | 28 ++++++++++++---- 8 files changed, 86 insertions(+), 21 deletions(-) diff --git a/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java b/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java index ff2cba5f7..aa2223e0a 100644 --- a/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java +++ b/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java @@ -395,6 +395,9 @@ public void setPullToRefreshEnabled(RNCWebViewWrapper view, boolean value) {} @Override public void setRefreshControlLightMode(RNCWebViewWrapper view, boolean value) {} + @Override + public void setIndicatorStyle(RNCWebViewWrapper view, @Nullable String value) {} + @Override public void setScrollEnabled(RNCWebViewWrapper view, boolean value) {} diff --git a/apple/RNCWebView.mm b/apple/RNCWebView.mm index f9d080e3d..95c0fcc91 100644 --- a/apple/RNCWebView.mm +++ b/apple/RNCWebView.mm @@ -71,9 +71,9 @@ - (instancetype)initWithFrame:(CGRect)frame if (self = [super initWithFrame:frame]) { static const auto defaultProps = std::make_shared(); _props = defaultProps; - + _view = [[RNCWebViewImpl alloc] init]; - + _view.onShouldStartLoadWithRequest = [self](NSDictionary* dictionary) { if (_eventEmitter) { auto webViewEventEmitter = std::static_pointer_cast(_eventEmitter); @@ -191,7 +191,7 @@ - (instancetype)initWithFrame:(CGRect)frame .selectedText = std::string([[dictionary valueForKey:@"selectedText"] UTF8String]), .key = std::string([[dictionary valueForKey:@"key"] UTF8String]), .label = std::string([[dictionary valueForKey:@"label"] UTF8String]) - + }; webViewEventEmitter->onCustomMenuSelection(data); } @@ -312,7 +312,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & REMAP_WEBVIEW_PROP(showsHorizontalScrollIndicator) REMAP_WEBVIEW_PROP(showsVerticalScrollIndicator) REMAP_WEBVIEW_PROP(keyboardDisplayRequiresUserAction) - + #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */ REMAP_WEBVIEW_PROP(automaticallyAdjustContentInsets) #endif @@ -398,7 +398,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & for (const auto &menuItem: newViewProps.suppressMenuItems) { [suppressMenuItems addObject: RCTNSStringFromString(menuItem)]; } - + [_view setSuppressMenuItems:suppressMenuItems]; } if (oldViewProps.hasOnFileDownload != newViewProps.hasOnFileDownload) { @@ -410,10 +410,10 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & .downloadUrl = std::string([[dictionary valueForKey:@"downloadUrl"] UTF8String]) }; webViewEventEmitter->onFileDownload(data); - } + } }; } else { - _view.onFileDownload = nil; + _view.onFileDownload = nil; } } if (oldViewProps.hasOnOpenWindowEvent != newViewProps.hasOnOpenWindowEvent) { @@ -459,7 +459,16 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & } } #endif - + if (oldViewProps.indicatorStyle != newViewProps.indicatorStyle) { + if (newViewProps.indicatorStyle == RNCWebViewIndicatorStyle::Black) { + [_view setIndicatorStyle:@"black"]; + } else if (newViewProps.indicatorStyle == RNCWebViewIndicatorStyle::White) { + [_view setIndicatorStyle:@"white"]; + } else { + [_view setIndicatorStyle:@"default"]; + } + } + NSMutableDictionary* source = [[NSMutableDictionary alloc] init]; if (!newViewProps.newSource.uri.empty()) { [source setValue:RCTNSStringFromString(newViewProps.newSource.uri) forKey:@"uri"]; @@ -484,7 +493,7 @@ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const & [source setValue:RCTNSStringFromString(newViewProps.newSource.method) forKey:@"method"]; } [_view setSource:source]; - + [super updateProps:props oldProps:oldProps]; } diff --git a/apple/RNCWebViewImpl.h b/apple/RNCWebViewImpl.h index 6246c45ef..1f6bbfd69 100644 --- a/apple/RNCWebViewImpl.h +++ b/apple/RNCWebViewImpl.h @@ -102,6 +102,7 @@ shouldStartLoadForRequest:(NSMutableDictionary *)request @property (nonatomic, assign) BOOL allowsLinkPreview; @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator; @property (nonatomic, assign) BOOL showsVerticalScrollIndicator; +@property (nonatomic, copy) NSString * _Nullable indicatorStyle; @property (nonatomic, assign) BOOL directionalLockEnabled; @property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch; @property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL; diff --git a/apple/RNCWebViewImpl.m b/apple/RNCWebViewImpl.m index d2923edf7..7f5c24d6e 100644 --- a/apple/RNCWebViewImpl.m +++ b/apple/RNCWebViewImpl.m @@ -74,7 +74,7 @@ - (NSString *)stringFromAction:(SEL) action { @"toggleUnderline:": @"underline", @"_share:": @"share", }; - + return map[sel] ?: sel; } @@ -86,7 +86,7 @@ - (BOOL)canPerformAction:(SEL)action return NO; } } - + if (!self.menuItems) { return [super canPerformAction:action withSender:sender]; } @@ -276,7 +276,7 @@ - (void)startLongPress:(UILongPressGestureRecognizer *)pressSender UIMenuController *menuController = [UIMenuController sharedMenuController]; NSMutableArray *menuControllerItems = [NSMutableArray arrayWithCapacity:self.menuItems.count]; - + for(NSDictionary *menuItem in self.menuItems) { NSString *menuItemLabel = [RCTConvert NSString:menuItem[@"label"]]; NSString *menuItemKey = [RCTConvert NSString:menuItem[@"key"]]; @@ -535,6 +535,15 @@ - (void)didMoveToWindow _webView.scrollView.bounces = _pullToRefreshEnabled || _bounces; _webView.scrollView.showsHorizontalScrollIndicator = _showsHorizontalScrollIndicator; _webView.scrollView.showsVerticalScrollIndicator = _showsVerticalScrollIndicator; + + if ([_indicatorStyle isEqualToString:@"black"]) { + _webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleBlack; + } else if ([_indicatorStyle isEqualToString:@"white"]) { + _webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite; + } else { + _webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleDefault; + } + _webView.scrollView.directionalLockEnabled = _directionalLockEnabled; #endif // !TARGET_OS_OSX _webView.allowsLinkPreview = _allowsLinkPreview; @@ -852,7 +861,7 @@ - (void)visitSource [self syncCookiesToWebView:^{ // Add observer to sync cookies from webview to sharedHTTPCookieStorage [webView.configuration.websiteDataStore.httpCookieStore addObserver:self]; - + // Because of the way React works, as pages redirect, we actually end up // passing the redirect urls back here, so we ignore them if trying to load // the same url. We'll expose a call to 'reload' to allow a user to load @@ -1084,6 +1093,19 @@ - (void)setShowsVerticalScrollIndicator:(BOOL)showsVerticalScrollIndicator _showsVerticalScrollIndicator = showsVerticalScrollIndicator; _webView.scrollView.showsVerticalScrollIndicator = showsVerticalScrollIndicator; } + +- (void)setIndicatorStyle:(NSString *)indicatorStyle +{ + _indicatorStyle = indicatorStyle; + + if ([indicatorStyle isEqualToString:@"black"]) { + _webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleBlack; + } else if ([indicatorStyle isEqualToString:@"white"]) { + _webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite; + } else { + _webView.scrollView.indicatorStyle = UIScrollViewIndicatorStyleDefault; + } +} #endif // !TARGET_OS_OSX - (void)postMessage:(NSString *)message @@ -1399,7 +1421,7 @@ - (void) webView:(WKWebView *)webView } /** - * Called when the web view’s content process is terminated. + * Called when the web view's content process is terminated. * @see https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455639-webviewwebcontentprocessdidtermi?language=objc */ - (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView diff --git a/apple/RNCWebViewManager.mm b/apple/RNCWebViewManager.mm index a0e0d0063..f8f375f23 100644 --- a/apple/RNCWebViewManager.mm +++ b/apple/RNCWebViewManager.mm @@ -167,6 +167,10 @@ - (RNCView *)view view.showsVerticalScrollIndicator = json == nil ? true : [RCTConvert BOOL: json]; } +RCT_CUSTOM_VIEW_PROPERTY(indicatorStyle, NSString, RNCWebViewImpl) { + view.indicatorStyle = [RCTConvert NSString: json]; +} + RCT_CUSTOM_VIEW_PROPERTY(keyboardDisplayRequiresUserAction, BOOL, RNCWebViewImpl) { view.keyboardDisplayRequiresUserAction = json == nil ? true : [RCTConvert BOOL: json]; } diff --git a/docs/Reference.md b/docs/Reference.md index 480fd4850..83787205e 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -53,6 +53,7 @@ This document lays out the current public properties and methods for the React N - [`contentInsetAdjustmentBehavior`](Reference.md#contentInsetAdjustmentBehavior) - [`contentMode`](Reference.md#contentMode) - [`dataDetectorTypes`](Reference.md#datadetectortypes) +- [`indicatorStyle`](Reference.md#indicatorStyle) - [`scrollEnabled`](Reference.md#scrollenabled) - [`nestedScrollEnabled`](Reference.md#nestedscrollenabled) - [`setBuiltInZoomControls`](Reference.md#setBuiltInZoomControls) @@ -1149,6 +1150,16 @@ Boolean value that determines whether scrolling is enabled in the `WebView`. The --- +### `indicatorStyle`[⬆](#props-index) + +The colorstyle of the scroll indicator. The default value is `default`. + +| Type | Required | Platform | +| ------ | -------- | -------- | +| string | No | iOS | + +--- + ### `nestedScrollEnabled`[⬆](#props-index) Boolean value that determines whether scrolling is possible in the `WebView` when used inside a `ScrollView` on Android. The default value is `false`. diff --git a/src/RNCWebViewNativeComponent.ts b/src/RNCWebViewNativeComponent.ts index be8ba0869..7dd9179f1 100644 --- a/src/RNCWebViewNativeComponent.ts +++ b/src/RNCWebViewNativeComponent.ts @@ -281,6 +281,7 @@ export interface NativeProps extends ViewProps { onShouldStartLoadWithRequest: DirectEventHandler; showsHorizontalScrollIndicator?: WithDefault; showsVerticalScrollIndicator?: WithDefault; + indicatorStyle?: WithDefault<'default' | 'black' | 'white', 'default'>; newSource: Readonly<{ uri?: string; method?: string; diff --git a/src/WebViewTypes.ts b/src/WebViewTypes.ts index ce1378435..17d1cb396 100644 --- a/src/WebViewTypes.ts +++ b/src/WebViewTypes.ts @@ -182,6 +182,8 @@ export type CacheMode = export type AndroidLayerType = 'none' | 'software' | 'hardware'; +export type IndicatorStyleType = 'default' | 'black' | 'white'; + export interface WebViewSourceUri { /** * The URI to load in the `WebView`. Can be a local or remote file. @@ -424,7 +426,7 @@ export interface IOSWebViewProps extends WebViewSharedProps { /** * If the value of this property is true, the scroll view stops on multiples - * of the scroll view’s bounds when the user scrolls. + * of the scroll view's bounds when the user scrolls. * The default value is false. * @platform ios */ @@ -660,14 +662,26 @@ export interface IOSWebViewProps extends WebViewSharedProps { pullToRefreshEnabled?: boolean; /** - * 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` + * Boolean value that determines whether the refresh control color is white or not. + * The default value is `false`, meaning the refresh control color will be the default. * @platform ios * */ refreshControlLightMode?: boolean; + /** + * Determines the style of the scroll indicators. This property works the same + * as `indicatorStyle` on React Native's ScrollView. + * The default value is `'default'`. + * + * Possible values: + * - `'default'` - Default style (dark on light backgrounds, light on dark backgrounds) + * - `'black'` - Black scroll indicators + * - `'white'` - White scroll indicators + * @platform ios + */ + indicatorStyle?: IndicatorStyleType; + /** * Function that is invoked when the client needs to download a file. * @@ -689,9 +703,9 @@ export interface IOSWebViewProps extends WebViewSharedProps { /** * A Boolean value which, when set to `true`, indicates to WebKit that a WKWebView * will only navigate to app-bound domains. Once set, any attempt to navigate away - * from an app-bound domain will fail with the error “App-bound domain failure.” + * from an app-bound domain will fail with the error "App-bound domain failure." * - * Applications can specify up to 10 “app-bound” domains using a new + * Applications can specify up to 10 "app-bound" domains using a new * Info.plist key `WKAppBoundDomains`. * @platform ios */ @@ -786,7 +800,7 @@ export interface MacOSWebViewProps extends WebViewSharedProps { /** * If the value of this property is true, the scroll view stops on multiples - * of the scroll view’s bounds when the user scrolls. + * of the scroll view's bounds when the user scrolls. * The default value is false. * @platform macos */ From 7ba2b4b1f71226dbffcfda47067a9c33fef5267d Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sun, 1 Jun 2025 01:18:41 +0000 Subject: [PATCH 05/18] chore(release): 13.14.0 [skip ci] # [13.14.0](https://github.com/react-native-webview/react-native-webview/compare/v13.13.5...v13.14.0) (2025-06-01) ### Features * **ios:** Added support for scrollview indicatorStyle ([#3743](https://github.com/react-native-webview/react-native-webview/issues/3743)) ([6af6a83](https://github.com/react-native-webview/react-native-webview/commit/6af6a830aea5b57ca68c1935c927759244c7d6fd)) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be0470be0..cb38ce114 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "Thibault Malbranche " ], "license": "MIT", - "version": "13.13.5", + "version": "13.14.0", "homepage": "https://github.com/react-native-webview/react-native-webview#readme", "scripts": { "android": "react-native run-android", From 823e6aeefb9216c4c3aa00f93bb840e5a925d690 Mon Sep 17 00:00:00 2001 From: Thibault Malbranche Date: Mon, 2 Jun 2025 14:22:55 +0200 Subject: [PATCH 06/18] fix: support react-native-codegen properly (#3777) --- package.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package.json b/package.json index cb38ce114..60f428a87 100644 --- a/package.json +++ b/package.json @@ -95,6 +95,14 @@ "jsSrcsDir": "./src", "android": { "javaPackageName": "com.reactnativecommunity.webview" + }, + "ios": { + "componentProvider": { + "RNCWebView": "RNCWebView" + }, + "modulesProvider": { + "RNCWebViewModule": "RNCWebViewModule" + } } }, "packageManager": "yarn@1.22.19" From 87b2265d6e5e700ca607ddd64e75997c9e6ca35a Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 2 Jun 2025 12:25:03 +0000 Subject: [PATCH 07/18] chore(release): 13.14.1 [skip ci] ## [13.14.1](https://github.com/react-native-webview/react-native-webview/compare/v13.14.0...v13.14.1) (2025-06-02) ### Bug Fixes * support react-native-codegen properly ([#3777](https://github.com/react-native-webview/react-native-webview/issues/3777)) ([823e6ae](https://github.com/react-native-webview/react-native-webview/commit/823e6aeefb9216c4c3aa00f93bb840e5a925d690)) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 60f428a87..58a2efbfc 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "Thibault Malbranche " ], "license": "MIT", - "version": "13.14.0", + "version": "13.14.1", "homepage": "https://github.com/react-native-webview/react-native-webview#readme", "scripts": { "android": "react-native run-android", From 5a7394836a3e03aaf170ef3227ddf8dcd89241cf Mon Sep 17 00:00:00 2001 From: Shawn Dempsey <96719+shwanton@users.noreply.github.com> Date: Sat, 7 Jun 2025 01:08:10 -0700 Subject: [PATCH 08/18] fix(android): suppressMenuItems native view config name with extra space (#3780) --- .../com/reactnativecommunity/webview/RNCWebViewManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java b/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java index aa2223e0a..afc546127 100644 --- a/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java +++ b/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java @@ -226,7 +226,7 @@ public void setMenuItems(RNCWebViewWrapper view, @Nullable ReadableArray items) } @Override - @ReactProp(name = "suppressMenuItems ") + @ReactProp(name = "suppressMenuItems") public void setSuppressMenuItems(RNCWebViewWrapper view, @Nullable ReadableArray items) {} @Override From 3b5d9895a32cef34e04c5404007bd2d56e43e18e Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 7 Jun 2025 08:10:16 +0000 Subject: [PATCH 09/18] chore(release): 13.14.2 [skip ci] ## [13.14.2](https://github.com/react-native-webview/react-native-webview/compare/v13.14.1...v13.14.2) (2025-06-07) ### Bug Fixes * **android:** suppressMenuItems native view config name with extra space ([#3780](https://github.com/react-native-webview/react-native-webview/issues/3780)) ([5a73948](https://github.com/react-native-webview/react-native-webview/commit/5a7394836a3e03aaf170ef3227ddf8dcd89241cf)) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 58a2efbfc..b95bbc77a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "Thibault Malbranche " ], "license": "MIT", - "version": "13.14.1", + "version": "13.14.2", "homepage": "https://github.com/react-native-webview/react-native-webview#readme", "scripts": { "android": "react-native run-android", From 4ea6d6bcb20835eb46fbcf04a69b363ed9fd3b5f Mon Sep 17 00:00:00 2001 From: Dominik Mengelt Date: Sun, 8 Jun 2025 14:22:49 +0200 Subject: [PATCH 10/18] feat(android): add support for enabling the Payment Request API (#2278) (#3763) * feat(android) add support for enabling the Payment Request API * updated androidx.webkit:webkit version to 1.14.0-beta01 * updated androidx.webkit:webkit version to 1.14.0-rc01 * updated androidx.webkit:webkit version to 1.14.0 --- android/gradle.properties | 2 +- android/src/main/AndroidManifest.xml | 12 ++++++++++ android/src/main/AndroidManifestNew.xml | 13 +++++++++++ .../webview/RNCWebViewManagerImpl.kt | 7 ++++++ .../webview/RNCWebViewManager.java | 6 +++++ .../webview/RNCWebViewManager.java | 5 +++++ docs/Reference.md | 14 ++++++++++-- example/App.tsx | 16 ++++++++++++++ example/examples/GooglePay.tsx | 22 +++++++++++++++++++ src/RNCWebViewNativeComponent.ts | 1 + src/WebViewTypes.ts | 6 +++++ 11 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 example/examples/GooglePay.tsx diff --git a/android/gradle.properties b/android/gradle.properties index c17e0668f..89b8a8a8e 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ ReactNativeWebView_kotlinVersion=1.6.0 -ReactNativeWebView_webkitVersion=1.4.0 +ReactNativeWebView_webkitVersion=1.14.0 ReactNativeWebView_compileSdkVersion=31 ReactNativeWebView_targetSdkVersion=31 ReactNativeWebView_minSdkVersion=21 diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index b8f945d14..d9fdd5cc7 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,6 +1,18 @@ + + + + + + + + + + + + + + + + + + + + + + + + + **NOTE** > -> In order to restrict playing video in picture in picture mode this props need to be set to `false` -. +> In order to restrict playing video in picture in picture mode this props need to be set to `false`. + | Type | Required | Platform | | ---- | -------- | -------- | | bool | No | iOS | @@ -1729,6 +1730,15 @@ Default is `false`. Supported on iOS as of 16.4, previous versions always allow | ------- | -------- | -------- | | boolean | No | iOS & Android | +### `paymentRequestEnabled`[⬆](#props-index) + +Whether or not the webview has the Payment Request API enabled. Default is `false`. +This is needed for Google Pay to work within the WebView. + +| Type | Required | Platform | +| ------- | -------- | -------- | +| boolean | No | Android | + ## Methods ### `goForward()`[⬆](#methods-index) diff --git a/example/App.tsx b/example/App.tsx index b2dd6fafc..03843b998 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -21,6 +21,7 @@ import Messaging from './examples/Messaging'; import MultiMessaging from './examples/MultiMessaging'; import NativeWebpage from './examples/NativeWebpage'; import ApplePay from './examples/ApplePay'; +import GooglePay from './examples/GooglePay'; import CustomMenu from './examples/CustomMenu'; import OpenWindow from './examples/OpenWindow'; import SuppressMenuItems from './examples/Suppress'; @@ -123,6 +124,14 @@ const TESTS = { return ; }, }, + GooglePay: { + title: 'Google Pay ', + testId: 'GooglePay', + description: 'Test to open a Google Pay supported page', + render() { + return ; + }, + }, CustomMenu: { title: 'Custom Menu', testId: 'CustomMenu', @@ -250,6 +259,13 @@ export default class App extends Component { onPress={() => this._changeTest('ApplePay')} /> )} + {Platform.OS === 'android' && ( +