react-native-webview-bootpay 11.18.11 → 11.18.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -83
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +5 -3
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +2 -4
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -2
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +8 -72
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +2 -2
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +1 -1
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +200 -198
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +3 -5
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +8 -66
- package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/{lookups/id-to-file.tab.keystream → jvm/kotlin/java-sources-proto-map.tab} +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/{subtypes.tab_i → java-sources-proto-map.tab_i} +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +128 -116
- package/android/build/tmp/kotlin-classes/debug/META-INF/rnWebView_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
- package/apple/BPCWebView.h +0 -19
- package/apple/BPCWebView.m +104 -284
- package/apple/BPCWebViewManager.h +0 -2
- package/apple/BPCWebViewManager.m +1 -25
- package/index.d.ts +5 -5
- package/ios/.DS_Store +0 -0
- package/ios/RNCWebView.xcodeproj/project.pbxproj +18 -18
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/bootpay.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/WebView.android.d.ts +0 -3
- package/lib/WebView.android.d.ts.map +1 -1
- package/lib/WebView.android.js +4 -11
- package/lib/WebView.d.ts +2 -2
- package/lib/WebView.d.ts.map +1 -1
- package/lib/WebView.ios.d.ts +0 -1
- package/lib/WebView.ios.d.ts.map +1 -1
- package/lib/WebView.ios.js +7 -12
- package/lib/WebView.macos.d.ts.map +1 -1
- package/lib/WebView.macos.js +6 -10
- package/lib/WebView.windows.d.ts +2 -4
- package/lib/WebView.windows.d.ts.map +1 -1
- package/lib/WebView.windows.js +12 -18
- package/lib/WebViewShared.d.ts +0 -1
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewTypes.d.ts +2 -113
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/package.json +9 -10
- package/react-native-webview-bootpay.podspec +3 -1
- package/react-native.config.js +61 -47
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +20 -37
- package/windows/ReactNativeWebView/ReactPackageProvider.cpp +1 -5
- package/windows/ReactNativeWebView/ReactWebView.cpp +6 -2
- package/windows/ReactNativeWebView/ReactWebView.h +2 -3
- package/windows/ReactNativeWebView/ReactWebView.idl +1 -13
- package/windows/ReactNativeWebView/ReactWebViewManager.cpp +31 -36
- package/windows/ReactNativeWebView/packages.config +0 -2
- package/windows/ReactNativeWebView/pch.h +0 -6
- package/windows/ReactNativeWebView.sln +119 -81
- package/windows/WebViewBridgeComponent/PropertySheet.props +16 -0
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.cpp +1 -1
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.h +2 -2
- package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.idl +1 -1
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.def +3 -0
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj +160 -0
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj.filters +33 -0
- package/windows/WebViewBridgeComponent/packages.config +4 -0
- package/windows/WebViewBridgeComponent/pch.cpp +1 -0
- package/windows/WebViewBridgeComponent/pch.h +4 -0
- package/windows/WebViewBridgeComponent/readme.txt +23 -0
- package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/results.bin +0 -1
- package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/transformed/classes/classes.dex +0 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -100
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
- package/lib/WebViewNativeComponent.android.d.ts +0 -4
- package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.android.js +0 -3
- package/lib/WebViewNativeComponent.ios.d.ts +0 -4
- package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.ios.js +0 -3
- package/lib/WebViewNativeComponent.macos.d.ts +0 -4
- package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.macos.js +0 -3
- package/lib/WebViewNativeComponent.windows.d.ts +0 -4
- package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.windows.js +0 -3
- package/lib/index.d.ts +0 -4
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -3
- package/windows/ExperimentalFeatures.props +0 -12
- package/windows/ReactNativeWebView/ReactWebView2.cpp +0 -119
- package/windows/ReactNativeWebView/ReactWebView2.h +0 -43
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +0 -147
- package/windows/ReactNativeWebView/ReactWebView2Manager.h +0 -54
package/apple/BPCWebView.m
CHANGED
|
@@ -18,13 +18,11 @@
|
|
|
18
18
|
#import "objc/runtime.h"
|
|
19
19
|
|
|
20
20
|
static NSTimer *keyboardTimer;
|
|
21
|
-
static NSString *const HistoryShimName = @"
|
|
22
|
-
static NSString *const MessageHandlerName = @"
|
|
21
|
+
static NSString *const HistoryShimName = @"ReactNativeHistoryShimBootpay";
|
|
22
|
+
static NSString *const MessageHandlerName = @"BootpayRNWebView";
|
|
23
23
|
static NSURLCredential* clientAuthenticationCredential;
|
|
24
24
|
static NSDictionary* customCertificatesForHost;
|
|
25
25
|
|
|
26
|
-
NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
27
|
-
|
|
28
26
|
#if !TARGET_OS_OSX
|
|
29
27
|
// runtime trick to remove WKWebView keyboard default toolbar
|
|
30
28
|
// see: http://stackoverflow.com/questions/19033292/ios-7-uiwebview-keyboard-issue/19042279#19042279
|
|
@@ -53,9 +51,9 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
53
51
|
@end
|
|
54
52
|
@implementation BPCWKWebView
|
|
55
53
|
- (void)scrollWheel:(NSEvent *)theEvent {
|
|
56
|
-
BPCWebView *
|
|
57
|
-
RCTAssert([
|
|
58
|
-
if (![
|
|
54
|
+
BPCWebView *bpcWebView = (BPCWebView *)[self superview];
|
|
55
|
+
RCTAssert([bpcWebView isKindOfClass:[bpcWebView class]], @"superview must be an BPCWebView");
|
|
56
|
+
if (![bpcWebView scrollEnabled]) {
|
|
59
57
|
[[self nextResponder] scrollWheel:theEvent];
|
|
60
58
|
return;
|
|
61
59
|
}
|
|
@@ -149,9 +147,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
149
147
|
_savedAutomaticallyAdjustsScrollIndicatorInsets = NO;
|
|
150
148
|
#endif
|
|
151
149
|
_enableApplePay = NO;
|
|
152
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
|
|
153
|
-
_mediaCapturePermissionGrantType = BPCWebViewPermissionGrantType_Prompt;
|
|
154
|
-
#endif
|
|
155
150
|
}
|
|
156
151
|
|
|
157
152
|
#if !TARGET_OS_OSX
|
|
@@ -193,126 +188,45 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
193
188
|
return self;
|
|
194
189
|
}
|
|
195
190
|
|
|
196
|
-
#if !TARGET_OS_OSX
|
|
197
|
-
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
|
198
|
-
// Only allow long press gesture
|
|
199
|
-
if ([otherGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {
|
|
200
|
-
return YES;
|
|
201
|
-
}else{
|
|
202
|
-
return NO;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
// Listener for long presses
|
|
207
|
-
- (void)startLongPress:(UILongPressGestureRecognizer *)pressSender
|
|
208
|
-
{
|
|
209
|
-
// When a long press ends, bring up our custom UIMenu
|
|
210
|
-
if(pressSender.state == UIGestureRecognizerStateEnded) {
|
|
211
|
-
if (!self.menuItems || self.menuItems.count == 0) {
|
|
212
|
-
return;
|
|
213
|
-
}
|
|
214
|
-
UIMenuController *menuController = [UIMenuController sharedMenuController];
|
|
215
|
-
NSMutableArray *menuControllerItems = [NSMutableArray arrayWithCapacity:self.menuItems.count];
|
|
216
|
-
|
|
217
|
-
for(NSDictionary *menuItem in self.menuItems) {
|
|
218
|
-
NSString *menuItemLabel = [RCTConvert NSString:menuItem[@"label"]];
|
|
219
|
-
NSString *menuItemKey = [RCTConvert NSString:menuItem[@"key"]];
|
|
220
|
-
NSString *sel = [NSString stringWithFormat:@"%@%@", CUSTOM_SELECTOR, menuItemKey];
|
|
221
|
-
UIMenuItem *item = [[UIMenuItem alloc] initWithTitle: menuItemLabel
|
|
222
|
-
action: NSSelectorFromString(sel)];
|
|
223
|
-
|
|
224
|
-
[menuControllerItems addObject: item];
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
menuController.menuItems = menuControllerItems;
|
|
228
|
-
[menuController setMenuVisible:YES animated:YES];
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
#endif // !TARGET_OS_OSX
|
|
233
|
-
|
|
234
191
|
- (void)dealloc
|
|
235
192
|
{
|
|
236
193
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
237
194
|
}
|
|
238
195
|
|
|
239
|
-
|
|
196
|
+
/**
|
|
197
|
+
* See https://stackoverflow.com/questions/25713069/why-is-wkwebview-not-opening-links-with-target-blank/25853806#25853806 for details.
|
|
198
|
+
*/
|
|
199
|
+
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
|
|
240
200
|
{
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
[self.webView evaluateJavaScript: @"window.getSelection().toString()" completionHandler: ^(id result, NSError *error) {
|
|
244
|
-
if (error != nil) {
|
|
245
|
-
RCTLogWarn(@"%@", [NSString stringWithFormat:@"Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string. %@", error]);
|
|
246
|
-
} else {
|
|
247
|
-
if (self.onCustomMenuSelection) {
|
|
248
|
-
NSPredicate *filter = [NSPredicate predicateWithFormat:@"key contains[c] %@ ",eventType];
|
|
249
|
-
NSArray *filteredMenuItems = [self.menuItems filteredArrayUsingPredicate:filter];
|
|
250
|
-
NSDictionary *selectedMenuItem = filteredMenuItems[0];
|
|
251
|
-
NSString *label = [RCTConvert NSString:selectedMenuItem[@"label"]];
|
|
252
|
-
self.onCustomMenuSelection(@{
|
|
253
|
-
@"key": eventType,
|
|
254
|
-
@"label": label,
|
|
255
|
-
@"selectedText": result
|
|
256
|
-
});
|
|
257
|
-
} else {
|
|
258
|
-
RCTLogWarn(@"Error evaluating onCustomMenuSelection: You must implement an `onCustomMenuSelection` callback when using custom menu items");
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}];
|
|
262
|
-
}
|
|
201
|
+
//팝업관련
|
|
202
|
+
NSLog(@"------ popup url: %@", navigationAction.request.URL.absoluteString);
|
|
263
203
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel
|
|
267
|
-
{
|
|
268
|
-
NSMethodSignature *existingSelector = [super methodSignatureForSelector:sel];
|
|
269
|
-
if (existingSelector) {
|
|
270
|
-
return existingSelector;
|
|
271
|
-
}
|
|
272
|
-
return [super methodSignatureForSelector:@selector(tappedMenuItem:)];
|
|
273
|
-
}
|
|
204
|
+
if([navigationAction.request.URL.absoluteString rangeOfString:@"bootpay.co.kr"].location == NSNotFound) {
|
|
205
|
+
NSLog(@"111");
|
|
274
206
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
NSRange match = [sel rangeOfString:CUSTOM_SELECTOR];
|
|
281
|
-
if (match.location == 0) {
|
|
282
|
-
[self tappedMenuItem:[sel substringFromIndex:17]];
|
|
207
|
+
//원래 로직
|
|
208
|
+
if (!navigationAction.targetFrame.isMainFrame) {
|
|
209
|
+
[webView loadRequest:navigationAction.request];
|
|
210
|
+
}
|
|
211
|
+
return nil;
|
|
283
212
|
} else {
|
|
284
|
-
[super forwardInvocation:invocation];
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
213
|
|
|
288
|
-
|
|
289
|
-
- (BOOL)canBecomeFirstResponder
|
|
290
|
-
{
|
|
291
|
-
return YES;
|
|
292
|
-
}
|
|
214
|
+
NSLog(@"222");
|
|
293
215
|
|
|
294
|
-
|
|
295
|
-
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
|
|
296
|
-
{
|
|
297
|
-
NSString *sel = NSStringFromSelector(action);
|
|
298
|
-
// Do any of them have our custom keys?
|
|
299
|
-
NSRange match = [sel rangeOfString:CUSTOM_SELECTOR];
|
|
216
|
+
WKWebView *popupView = [[WKWebView alloc] initWithFrame:webView.bounds configuration:configuration];
|
|
300
217
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
218
|
+
popupView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
|
|
219
|
+
popupView.navigationDelegate = self;
|
|
220
|
+
popupView.UIDelegate = self;
|
|
221
|
+
[webView addSubview:popupView];
|
|
222
|
+
|
|
223
|
+
return popupView;
|
|
224
|
+
}
|
|
305
225
|
}
|
|
306
226
|
|
|
307
|
-
|
|
308
|
-
*
|
|
309
|
-
|
|
310
|
-
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
|
|
311
|
-
{
|
|
312
|
-
if (!navigationAction.targetFrame.isMainFrame) {
|
|
313
|
-
[webView loadRequest:navigationAction.request];
|
|
314
|
-
}
|
|
315
|
-
return nil;
|
|
227
|
+
|
|
228
|
+
- (void)webViewDidClose:(WKWebView *)webView {
|
|
229
|
+
[webView removeFromSuperview];
|
|
316
230
|
}
|
|
317
231
|
|
|
318
232
|
- (WKWebViewConfiguration *)setUpWkWebViewConfig
|
|
@@ -335,14 +249,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
335
249
|
[prefs setValue:@TRUE forKey:@"javaScriptCanOpenWindowsAutomatically"];
|
|
336
250
|
_prefsUsed = YES;
|
|
337
251
|
}
|
|
338
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */
|
|
339
|
-
if (@available(iOS 14.5, *)) {
|
|
340
|
-
if (!_textInteractionEnabled) {
|
|
341
|
-
[prefs setValue:@FALSE forKey:@"textInteractionEnabled"];
|
|
342
|
-
_prefsUsed = YES;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
#endif
|
|
346
252
|
if (_prefsUsed) {
|
|
347
253
|
wkWebViewConfig.preferences = prefs;
|
|
348
254
|
}
|
|
@@ -430,7 +336,9 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
430
336
|
[_webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:nil];
|
|
431
337
|
_webView.allowsBackForwardNavigationGestures = _allowsBackForwardNavigationGestures;
|
|
432
338
|
|
|
433
|
-
|
|
339
|
+
if (_userAgent) {
|
|
340
|
+
_webView.customUserAgent = _userAgent;
|
|
341
|
+
}
|
|
434
342
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
|
435
343
|
if ([_webView.scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
|
|
436
344
|
_webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior;
|
|
@@ -447,18 +355,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
447
355
|
[self setKeyboardDisplayRequiresUserAction: _savedKeyboardDisplayRequiresUserAction];
|
|
448
356
|
[self visitSource];
|
|
449
357
|
}
|
|
450
|
-
#if !TARGET_OS_OSX
|
|
451
|
-
// Allow this object to recognize gestures
|
|
452
|
-
if (self.menuItems != nil) {
|
|
453
|
-
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(startLongPress:)];
|
|
454
|
-
longPress.delegate = self;
|
|
455
|
-
|
|
456
|
-
longPress.minimumPressDuration = 0.4f;
|
|
457
|
-
longPress.numberOfTouchesRequired = 1;
|
|
458
|
-
longPress.cancelsTouchesInView = YES;
|
|
459
|
-
[self addGestureRecognizer:longPress];
|
|
460
|
-
}
|
|
461
|
-
#endif // !TARGET_OS_OSX
|
|
462
358
|
}
|
|
463
359
|
|
|
464
360
|
// Update webview property when the component prop changes.
|
|
@@ -683,39 +579,38 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
683
579
|
}
|
|
684
580
|
[_webView loadHTMLString:html baseURL:baseURL];
|
|
685
581
|
return;
|
|
686
|
-
}
|
|
687
|
-
//
|
|
688
|
-
NSString *headerCookie = [RCTConvert NSString:_source[@"headers"][@"cookie"]];
|
|
582
|
+
}
|
|
583
|
+
//Add cookie for subsequent resource requests sent by page itself, if cookie was set in headers on WebView
|
|
584
|
+
NSString *headerCookie = [RCTConvert NSString:_source[@"headers"][@"cookie"]];
|
|
689
585
|
if(headerCookie) {
|
|
690
586
|
NSDictionary *headers = [NSDictionary dictionaryWithObjectsAndKeys:headerCookie,@"Set-Cookie",nil];
|
|
691
587
|
NSURL *urlString = [NSURL URLWithString:_source[@"uri"]];
|
|
692
588
|
NSArray *httpCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:headers forURL:urlString];
|
|
693
|
-
|
|
589
|
+
for (NSHTTPCookie *httpCookie in httpCookies) {
|
|
590
|
+
[_webView.configuration.websiteDataStore.httpCookieStore setCookie:httpCookie completionHandler:nil];
|
|
591
|
+
}
|
|
694
592
|
}
|
|
695
593
|
|
|
696
594
|
NSURLRequest *request = [self requestForSource:_source];
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
[_webView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
|
|
717
|
-
}
|
|
718
|
-
}];
|
|
595
|
+
// Because of the way React works, as pages redirect, we actually end up
|
|
596
|
+
// passing the redirect urls back here, so we ignore them if trying to load
|
|
597
|
+
// the same url. We'll expose a call to 'reload' to allow a user to load
|
|
598
|
+
// the existing page.
|
|
599
|
+
if ([request.URL isEqual:_webView.URL]) {
|
|
600
|
+
return;
|
|
601
|
+
}
|
|
602
|
+
if (!request.URL) {
|
|
603
|
+
// Clear the webview
|
|
604
|
+
[_webView loadHTMLString:@"" baseURL:nil];
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
if (request.URL.host) {
|
|
608
|
+
[_webView loadRequest:request];
|
|
609
|
+
}
|
|
610
|
+
else {
|
|
611
|
+
NSURL* readAccessUrl = _allowingReadAccessToURL ? [RCTConvert NSURL:_allowingReadAccessToURL] : request.URL;
|
|
612
|
+
[_webView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
|
|
613
|
+
}
|
|
719
614
|
}
|
|
720
615
|
|
|
721
616
|
#if !TARGET_OS_OSX
|
|
@@ -831,12 +726,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
831
726
|
}
|
|
832
727
|
#endif // !TARGET_OS_OSX
|
|
833
728
|
|
|
834
|
-
- (void)setUserAgent:(NSString*)userAgent
|
|
835
|
-
{
|
|
836
|
-
_userAgent = userAgent;
|
|
837
|
-
_webView.customUserAgent = userAgent;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
729
|
- (void)setScrollEnabled:(BOOL)scrollEnabled
|
|
841
730
|
{
|
|
842
731
|
_scrollEnabled = scrollEnabled;
|
|
@@ -972,15 +861,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
972
861
|
}
|
|
973
862
|
}
|
|
974
863
|
}
|
|
975
|
-
if ([[challenge protectionSpace] authenticationMethod] == NSURLAuthenticationMethodHTTPBasic) {
|
|
976
|
-
NSString *username = [_basicAuthCredential valueForKey:@"username"];
|
|
977
|
-
NSString *password = [_basicAuthCredential valueForKey:@"password"];
|
|
978
|
-
if (username && password) {
|
|
979
|
-
NSURLCredential *credential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceNone];
|
|
980
|
-
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
|
|
981
|
-
return;
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
864
|
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
|
|
985
865
|
}
|
|
986
866
|
|
|
@@ -1075,32 +955,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
1075
955
|
#endif // !TARGET_OS_OSX
|
|
1076
956
|
}
|
|
1077
957
|
|
|
1078
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
|
|
1079
|
-
/**
|
|
1080
|
-
* Media capture permissions (prevent multiple prompts)
|
|
1081
|
-
*/
|
|
1082
|
-
- (void) webView:(WKWebView *)webView
|
|
1083
|
-
requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin
|
|
1084
|
-
initiatedByFrame:(WKFrameInfo *)frame
|
|
1085
|
-
type:(WKMediaCaptureType)type
|
|
1086
|
-
decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler {
|
|
1087
|
-
if (_mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt || _mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny) {
|
|
1088
|
-
if ([origin.host isEqualToString:webView.URL.host]) {
|
|
1089
|
-
decisionHandler(WKPermissionDecisionGrant);
|
|
1090
|
-
} else {
|
|
1091
|
-
WKPermissionDecision decision = _mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt ? WKPermissionDecisionPrompt : WKPermissionDecisionDeny;
|
|
1092
|
-
decisionHandler(decision);
|
|
1093
|
-
}
|
|
1094
|
-
} else if (_mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_Deny) {
|
|
1095
|
-
decisionHandler(WKPermissionDecisionDeny);
|
|
1096
|
-
} else if (_mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_Grant) {
|
|
1097
|
-
decisionHandler(WKPermissionDecisionGrant);
|
|
1098
|
-
} else {
|
|
1099
|
-
decisionHandler(WKPermissionDecisionPrompt);
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
#endif
|
|
1103
|
-
|
|
1104
958
|
#if !TARGET_OS_OSX
|
|
1105
959
|
/**
|
|
1106
960
|
* topViewController
|
|
@@ -1201,59 +1055,58 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
1201
1055
|
}
|
|
1202
1056
|
|
|
1203
1057
|
|
|
1204
|
-
|
|
1205
|
-
- (void) navigationOriginRN:(WKWebView *)webView
|
|
1058
|
+
- (void) navigationOriginRN:(WKWebView *)webView
|
|
1206
1059
|
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
|
|
1207
1060
|
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
|
|
1208
1061
|
{
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
if (_onShouldStartLoadWithRequest) {
|
|
1228
|
-
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
1229
|
-
[event addEntriesFromDictionary: @{
|
|
1230
|
-
@"url": (request.URL).absoluteString,
|
|
1231
|
-
@"mainDocumentURL": (request.mainDocumentURL).absoluteString,
|
|
1232
|
-
@"navigationType": navigationTypes[@(navigationType)],
|
|
1233
|
-
@"isTopFrame": @(isTopFrame)
|
|
1234
|
-
}];
|
|
1235
|
-
if (![self.delegate webView:self
|
|
1236
|
-
shouldStartLoadForRequest:event
|
|
1237
|
-
withCallback:_onShouldStartLoadWithRequest]) {
|
|
1238
|
-
decisionHandler(WKNavigationActionPolicyCancel);
|
|
1239
|
-
return;
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1062
|
+
static NSDictionary<NSNumber *, NSString *> *navigationTypes;
|
|
1063
|
+
static dispatch_once_t onceToken;
|
|
1064
|
+
|
|
1065
|
+
dispatch_once(&onceToken, ^{
|
|
1066
|
+
navigationTypes = @{
|
|
1067
|
+
@(WKNavigationTypeLinkActivated): @"click",
|
|
1068
|
+
@(WKNavigationTypeFormSubmitted): @"formsubmit",
|
|
1069
|
+
@(WKNavigationTypeBackForward): @"backforward",
|
|
1070
|
+
@(WKNavigationTypeReload): @"reload",
|
|
1071
|
+
@(WKNavigationTypeFormResubmitted): @"formresubmit",
|
|
1072
|
+
@(WKNavigationTypeOther): @"other",
|
|
1073
|
+
};
|
|
1074
|
+
});
|
|
1075
|
+
|
|
1076
|
+
WKNavigationType navigationType = navigationAction.navigationType;
|
|
1077
|
+
NSURLRequest *request = navigationAction.request;
|
|
1078
|
+
BOOL isTopFrame = [request.URL isEqual:request.mainDocumentURL];
|
|
1242
1079
|
|
|
1243
|
-
|
|
1244
|
-
// We have this check to filter out iframe requests and whatnot
|
|
1245
|
-
if (isTopFrame) {
|
|
1080
|
+
if (_onShouldStartLoadWithRequest) {
|
|
1246
1081
|
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
1247
1082
|
[event addEntriesFromDictionary: @{
|
|
1248
1083
|
@"url": (request.URL).absoluteString,
|
|
1249
|
-
@"
|
|
1084
|
+
@"mainDocumentURL": (request.mainDocumentURL).absoluteString,
|
|
1085
|
+
@"navigationType": navigationTypes[@(navigationType)],
|
|
1086
|
+
@"isTopFrame": @(isTopFrame)
|
|
1250
1087
|
}];
|
|
1251
|
-
|
|
1088
|
+
if (![self.delegate webView:self
|
|
1089
|
+
shouldStartLoadForRequest:event
|
|
1090
|
+
withCallback:_onShouldStartLoadWithRequest]) {
|
|
1091
|
+
decisionHandler(WKNavigationActionPolicyCancel);
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1252
1094
|
}
|
|
1253
|
-
}
|
|
1254
1095
|
|
|
1255
|
-
|
|
1256
|
-
|
|
1096
|
+
if (_onLoadingStart) {
|
|
1097
|
+
// We have this check to filter out iframe requests and whatnot
|
|
1098
|
+
if (isTopFrame) {
|
|
1099
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
1100
|
+
[event addEntriesFromDictionary: @{
|
|
1101
|
+
@"url": (request.URL).absoluteString,
|
|
1102
|
+
@"navigationType": navigationTypes[@(navigationType)]
|
|
1103
|
+
}];
|
|
1104
|
+
_onLoadingStart(event);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
// Allow all navigation by default
|
|
1109
|
+
decisionHandler(WKNavigationActionPolicyAllow);
|
|
1257
1110
|
}
|
|
1258
1111
|
|
|
1259
1112
|
/**
|
|
@@ -1406,15 +1259,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
1406
1259
|
- (void)webView:(WKWebView *)webView
|
|
1407
1260
|
didFinishNavigation:(WKNavigation *)navigation
|
|
1408
1261
|
{
|
|
1409
|
-
if(_sharedCookiesEnabled && @available(iOS 11.0, *)) {
|
|
1410
|
-
// Write all cookies from WKWebView back to sharedHTTPCookieStorage
|
|
1411
|
-
[webView.configuration.websiteDataStore.httpCookieStore getAllCookies:^(NSArray* cookies) {
|
|
1412
|
-
for (NSHTTPCookie *cookie in cookies) {
|
|
1413
|
-
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];
|
|
1414
|
-
}
|
|
1415
|
-
}];
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
1262
|
if (_ignoreSilentHardwareSwitch) {
|
|
1419
1263
|
[self forceIgnoreSilentHardwareSwitch:true];
|
|
1420
1264
|
}
|
|
@@ -1448,6 +1292,7 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
1448
1292
|
*/
|
|
1449
1293
|
NSURLRequest *request = [self requestForSource:self.source];
|
|
1450
1294
|
|
|
1295
|
+
|
|
1451
1296
|
if (request.URL && !_webView.URL.absoluteString.length) {
|
|
1452
1297
|
[_webView loadRequest:request];
|
|
1453
1298
|
} else {
|
|
@@ -1560,33 +1405,6 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
1560
1405
|
}
|
|
1561
1406
|
}
|
|
1562
1407
|
|
|
1563
|
-
- (void)writeCookiesToWebView:(NSArray<NSHTTPCookie *>*)cookies completion:(void (^)(void))completion {
|
|
1564
|
-
// The required cookie APIs only became available on iOS 11
|
|
1565
|
-
if(_sharedCookiesEnabled && @available(iOS 11.0, *)) {
|
|
1566
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
1567
|
-
dispatch_group_t group = dispatch_group_create();
|
|
1568
|
-
for (NSHTTPCookie *cookie in cookies) {
|
|
1569
|
-
dispatch_group_enter(group);
|
|
1570
|
-
[_webView.configuration.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:^{
|
|
1571
|
-
dispatch_group_leave(group);
|
|
1572
|
-
}];
|
|
1573
|
-
}
|
|
1574
|
-
dispatch_group_notify(group, dispatch_get_main_queue(), ^{
|
|
1575
|
-
if (completion) {
|
|
1576
|
-
completion();
|
|
1577
|
-
}
|
|
1578
|
-
});
|
|
1579
|
-
});
|
|
1580
|
-
} else if (completion) {
|
|
1581
|
-
completion();
|
|
1582
|
-
}
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
- (void)syncCookiesToWebView:(void (^)(void))completion {
|
|
1586
|
-
NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
|
|
1587
|
-
[self writeCookiesToWebView:cookies completion:completion];
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
1408
|
- (void)resetupScripts:(WKWebViewConfiguration *)wkWebViewConfig {
|
|
1591
1409
|
[wkWebViewConfig.userContentController removeAllUserScripts];
|
|
1592
1410
|
[wkWebViewConfig.userContentController removeScriptMessageHandlerForName:MessageHandlerName];
|
|
@@ -1631,7 +1449,9 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
1631
1449
|
if(!_incognito && !_cacheEnabled) {
|
|
1632
1450
|
wkWebViewConfig.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];
|
|
1633
1451
|
}
|
|
1634
|
-
[
|
|
1452
|
+
for (NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
|
|
1453
|
+
[wkWebViewConfig.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:nil];
|
|
1454
|
+
}
|
|
1635
1455
|
} else {
|
|
1636
1456
|
NSMutableString *script = [NSMutableString string];
|
|
1637
1457
|
|
|
@@ -22,16 +22,6 @@ RCT_ENUM_CONVERTER(WKContentMode, (@{
|
|
|
22
22
|
@"desktop": @(WKContentModeDesktop),
|
|
23
23
|
}), WKContentModeRecommended, integerValue)
|
|
24
24
|
#endif
|
|
25
|
-
|
|
26
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
|
|
27
|
-
RCT_ENUM_CONVERTER(BPCWebViewPermissionGrantType, (@{
|
|
28
|
-
@"grantIfSameHostElsePrompt": @(BPCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt),
|
|
29
|
-
@"grantIfSameHostElseDeny": @(BPCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny),
|
|
30
|
-
@"deny": @(BPCWebViewPermissionGrantType_Deny),
|
|
31
|
-
@"grant": @(BPCWebViewPermissionGrantType_Grant),
|
|
32
|
-
@"prompt": @(BPCWebViewPermissionGrantType_Prompt),
|
|
33
|
-
}), BPCWebViewPermissionGrantType_Prompt, integerValue)
|
|
34
|
-
#endif
|
|
35
25
|
@end
|
|
36
26
|
|
|
37
27
|
@implementation BPCWebViewManager
|
|
@@ -82,11 +72,11 @@ RCT_EXPORT_VIEW_PROPERTY(hideKeyboardAccessoryView, BOOL)
|
|
|
82
72
|
RCT_EXPORT_VIEW_PROPERTY(allowsBackForwardNavigationGestures, BOOL)
|
|
83
73
|
RCT_EXPORT_VIEW_PROPERTY(incognito, BOOL)
|
|
84
74
|
RCT_EXPORT_VIEW_PROPERTY(pagingEnabled, BOOL)
|
|
75
|
+
RCT_EXPORT_VIEW_PROPERTY(userAgent, NSString)
|
|
85
76
|
RCT_EXPORT_VIEW_PROPERTY(applicationNameForUserAgent, NSString)
|
|
86
77
|
RCT_EXPORT_VIEW_PROPERTY(cacheEnabled, BOOL)
|
|
87
78
|
RCT_EXPORT_VIEW_PROPERTY(allowsLinkPreview, BOOL)
|
|
88
79
|
RCT_EXPORT_VIEW_PROPERTY(allowingReadAccessToURL, NSString)
|
|
89
|
-
RCT_EXPORT_VIEW_PROPERTY(basicAuthCredential, NSDictionary)
|
|
90
80
|
|
|
91
81
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
|
92
82
|
RCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)
|
|
@@ -103,14 +93,6 @@ RCT_EXPORT_VIEW_PROPERTY(contentMode, WKContentMode)
|
|
|
103
93
|
RCT_EXPORT_VIEW_PROPERTY(limitsNavigationsToAppBoundDomains, BOOL)
|
|
104
94
|
#endif
|
|
105
95
|
|
|
106
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */
|
|
107
|
-
RCT_EXPORT_VIEW_PROPERTY(textInteractionEnabled, BOOL)
|
|
108
|
-
#endif
|
|
109
|
-
|
|
110
|
-
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
|
|
111
|
-
RCT_EXPORT_VIEW_PROPERTY(mediaCapturePermissionGrantType, BPCWebViewPermissionGrantType)
|
|
112
|
-
#endif
|
|
113
|
-
|
|
114
96
|
/**
|
|
115
97
|
* Expose methods to enable messaging the webview.
|
|
116
98
|
*/
|
|
@@ -118,8 +100,6 @@ RCT_EXPORT_VIEW_PROPERTY(messagingEnabled, BOOL)
|
|
|
118
100
|
RCT_EXPORT_VIEW_PROPERTY(onMessage, RCTDirectEventBlock)
|
|
119
101
|
RCT_EXPORT_VIEW_PROPERTY(onScroll, RCTDirectEventBlock)
|
|
120
102
|
RCT_EXPORT_VIEW_PROPERTY(enableApplePay, BOOL)
|
|
121
|
-
RCT_EXPORT_VIEW_PROPERTY(menuItems, NSArray);
|
|
122
|
-
RCT_EXPORT_VIEW_PROPERTY(onCustomMenuSelection, RCTDirectEventBlock)
|
|
123
103
|
|
|
124
104
|
RCT_EXPORT_METHOD(postMessage:(nonnull NSNumber *)reactTag message:(NSString *)message)
|
|
125
105
|
{
|
|
@@ -145,10 +125,6 @@ RCT_CUSTOM_VIEW_PROPERTY(useSharedProcessPool, BOOL, BPCWebView) {
|
|
|
145
125
|
view.useSharedProcessPool = json == nil ? true : [RCTConvert BOOL: json];
|
|
146
126
|
}
|
|
147
127
|
|
|
148
|
-
RCT_CUSTOM_VIEW_PROPERTY(userAgent, NSString, BPCWebView) {
|
|
149
|
-
view.userAgent = [RCTConvert NSString: json];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
128
|
RCT_CUSTOM_VIEW_PROPERTY(scrollEnabled, BOOL, BPCWebView) {
|
|
153
129
|
view.scrollEnabled = json == nil ? true : [RCTConvert BOOL: json];
|
|
154
130
|
}
|
package/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
// eslint-disable-next-line
|
|
3
|
-
import { IOSWebViewProps, AndroidWebViewProps
|
|
3
|
+
import { IOSWebViewProps, AndroidWebViewProps } from './lib/WebViewTypes';
|
|
4
4
|
|
|
5
5
|
export { FileDownload, WebViewMessageEvent, WebViewNavigation } from "./lib/WebViewTypes";
|
|
6
6
|
|
|
7
|
-
export type WebViewProps = IOSWebViewProps & AndroidWebViewProps
|
|
7
|
+
export type WebViewProps = IOSWebViewProps & AndroidWebViewProps;
|
|
8
8
|
|
|
9
9
|
declare class WebView<P = {}> extends Component<WebViewProps & P> {
|
|
10
10
|
/**
|
|
@@ -46,19 +46,19 @@ declare class WebView<P = {}> extends Component<WebViewProps & P> {
|
|
|
46
46
|
* (Android only)
|
|
47
47
|
* Removes the autocomplete popup from the currently focused form field, if present.
|
|
48
48
|
*/
|
|
49
|
-
clearFormData
|
|
49
|
+
clearFormData: () => void;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* (Android only)
|
|
53
53
|
* Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.
|
|
54
54
|
*/
|
|
55
|
-
clearCache
|
|
55
|
+
clearCache: (clear: boolean) => void;
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* (Android only)
|
|
59
59
|
* Tells this WebView to clear its internal back/forward list.
|
|
60
60
|
*/
|
|
61
|
-
clearHistory
|
|
61
|
+
clearHistory: () => void;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
export {WebView};
|
package/ios/.DS_Store
CHANGED
|
Binary file
|