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.
Files changed (200) hide show
  1. package/README.md +93 -83
  2. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +5 -3
  3. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +2 -4
  4. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -2
  5. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  6. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  7. package/android/build/intermediates/compile_symbol_list/debug/R.txt +8 -72
  8. package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
  9. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +1 -1
  10. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +1 -1
  11. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +1 -1
  12. package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +2 -2
  13. package/android/build/intermediates/incremental/packageDebugResources/merger.xml +1 -1
  14. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
  15. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView.class +0 -0
  16. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
  17. package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
  18. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +200 -198
  19. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +3 -5
  20. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  21. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +8 -66
  22. package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/caches-jvm/{lookups/id-to-file.tab.keystream → jvm/kotlin/java-sources-proto-map.tab} +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/{subtypes.tab_i → java-sources-proto-map.tab_i} +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
  46. package/android/build/outputs/logs/manifest-merger-debug-report.txt +128 -116
  47. package/android/build/tmp/kotlin-classes/debug/META-INF/rnWebView_debug.kotlin_module +0 -0
  48. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
  49. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
  50. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
  51. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
  52. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
  53. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
  54. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
  55. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
  56. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
  57. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
  58. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
  59. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
  60. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
  61. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
  62. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
  63. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
  64. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
  65. package/apple/BPCWebView.h +0 -19
  66. package/apple/BPCWebView.m +104 -284
  67. package/apple/BPCWebViewManager.h +0 -2
  68. package/apple/BPCWebViewManager.m +1 -25
  69. package/index.d.ts +5 -5
  70. package/ios/.DS_Store +0 -0
  71. package/ios/RNCWebView.xcodeproj/project.pbxproj +18 -18
  72. package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/bootpay.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  73. package/lib/WebView.android.d.ts +0 -3
  74. package/lib/WebView.android.d.ts.map +1 -1
  75. package/lib/WebView.android.js +4 -11
  76. package/lib/WebView.d.ts +2 -2
  77. package/lib/WebView.d.ts.map +1 -1
  78. package/lib/WebView.ios.d.ts +0 -1
  79. package/lib/WebView.ios.d.ts.map +1 -1
  80. package/lib/WebView.ios.js +7 -12
  81. package/lib/WebView.macos.d.ts.map +1 -1
  82. package/lib/WebView.macos.js +6 -10
  83. package/lib/WebView.windows.d.ts +2 -4
  84. package/lib/WebView.windows.d.ts.map +1 -1
  85. package/lib/WebView.windows.js +12 -18
  86. package/lib/WebViewShared.d.ts +0 -1
  87. package/lib/WebViewShared.d.ts.map +1 -1
  88. package/lib/WebViewTypes.d.ts +2 -113
  89. package/lib/WebViewTypes.d.ts.map +1 -1
  90. package/package.json +9 -10
  91. package/react-native-webview-bootpay.podspec +3 -1
  92. package/react-native.config.js +61 -47
  93. package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +20 -37
  94. package/windows/ReactNativeWebView/ReactPackageProvider.cpp +1 -5
  95. package/windows/ReactNativeWebView/ReactWebView.cpp +6 -2
  96. package/windows/ReactNativeWebView/ReactWebView.h +2 -3
  97. package/windows/ReactNativeWebView/ReactWebView.idl +1 -13
  98. package/windows/ReactNativeWebView/ReactWebViewManager.cpp +31 -36
  99. package/windows/ReactNativeWebView/packages.config +0 -2
  100. package/windows/ReactNativeWebView/pch.h +0 -6
  101. package/windows/ReactNativeWebView.sln +119 -81
  102. package/windows/WebViewBridgeComponent/PropertySheet.props +16 -0
  103. package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.cpp +1 -1
  104. package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.h +2 -2
  105. package/windows/{ReactNativeWebView → WebViewBridgeComponent}/WebBridge.idl +1 -1
  106. package/windows/WebViewBridgeComponent/WebViewBridgeComponent.def +3 -0
  107. package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj +160 -0
  108. package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj.filters +33 -0
  109. package/windows/WebViewBridgeComponent/packages.config +4 -0
  110. package/windows/WebViewBridgeComponent/pch.cpp +1 -0
  111. package/windows/WebViewBridgeComponent/pch.h +4 -0
  112. package/windows/WebViewBridgeComponent/readme.txt +23 -0
  113. package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/results.bin +0 -1
  114. package/android/build/.transforms/4e87ba7f47baac309fba5367e008cf44/transformed/classes/classes.dex +0 -0
  115. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -100
  116. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  128. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  135. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  158. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  159. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  160. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  161. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  162. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  163. package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  164. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +0 -2
  165. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  166. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  167. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
  168. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  169. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  170. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  171. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
  172. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  173. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  174. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
  175. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  176. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
  177. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
  178. package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i.len +0 -0
  179. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  180. package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
  181. package/lib/WebViewNativeComponent.android.d.ts +0 -4
  182. package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
  183. package/lib/WebViewNativeComponent.android.js +0 -3
  184. package/lib/WebViewNativeComponent.ios.d.ts +0 -4
  185. package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
  186. package/lib/WebViewNativeComponent.ios.js +0 -3
  187. package/lib/WebViewNativeComponent.macos.d.ts +0 -4
  188. package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
  189. package/lib/WebViewNativeComponent.macos.js +0 -3
  190. package/lib/WebViewNativeComponent.windows.d.ts +0 -4
  191. package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
  192. package/lib/WebViewNativeComponent.windows.js +0 -3
  193. package/lib/index.d.ts +0 -4
  194. package/lib/index.d.ts.map +0 -1
  195. package/lib/index.js +0 -3
  196. package/windows/ExperimentalFeatures.props +0 -12
  197. package/windows/ReactNativeWebView/ReactWebView2.cpp +0 -119
  198. package/windows/ReactNativeWebView/ReactWebView2.h +0 -43
  199. package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +0 -147
  200. package/windows/ReactNativeWebView/ReactWebView2Manager.h +0 -54
@@ -18,13 +18,11 @@
18
18
  #import "objc/runtime.h"
19
19
 
20
20
  static NSTimer *keyboardTimer;
21
- static NSString *const HistoryShimName = @"ReactNativeHistoryShim";
22
- static NSString *const MessageHandlerName = @"ReactNativeWebView";
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 *BPCWebView = (BPCWebView *)[self superview];
57
- RCTAssert([BPCWebView isKindOfClass:[BPCWebView class]], @"superview must be an BPCWebView");
58
- if (![BPCWebView scrollEnabled]) {
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
- - (void)tappedMenuItem:(NSString *)eventType
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
- // Get the selected text
242
- // NOTE: selecting text in an iframe or shadow DOM will not work
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
- // Overwrite method that interprets which action to call upon UIMenu Selection
265
- // https://developer.apple.com/documentation/objectivec/nsobject/1571960-methodsignatureforselector
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
- // Needed to forward messages to other objects
276
- // https://developer.apple.com/documentation/objectivec/nsobject/1571955-forwardinvocation
277
- - (void)forwardInvocation:(NSInvocation *)invocation
278
- {
279
- NSString *sel = NSStringFromSelector([invocation selector]);
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
- // Allows the instance to respond to UIMenuController Actions
289
- - (BOOL)canBecomeFirstResponder
290
- {
291
- return YES;
292
- }
214
+ NSLog(@"222");
293
215
 
294
- // Control which items show up on the UIMenuController
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
- if (match.location == 0) {
302
- return YES;
303
- }
304
- return NO;
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
- * See https://stackoverflow.com/questions/25713069/why-is-wkwebview-not-opening-links-with-target-blank/25853806#25853806 for details.
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
- _webView.customUserAgent = _userAgent;
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
- // Add cookie for subsequent resource requests sent by page itself, if cookie was set in headers on WebView
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
- [self writeCookiesToWebView:httpCookies completion:nil];
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
- [self syncCookiesToWebView:^{
699
- // Because of the way React works, as pages redirect, we actually end up
700
- // passing the redirect urls back here, so we ignore them if trying to load
701
- // the same url. We'll expose a call to 'reload' to allow a user to load
702
- // the existing page.
703
- if ([request.URL isEqual:_webView.URL]) {
704
- return;
705
- }
706
- if (!request.URL) {
707
- // Clear the webview
708
- [_webView loadHTMLString:@"" baseURL:nil];
709
- return;
710
- }
711
- if (request.URL.host) {
712
- [_webView loadRequest:request];
713
- }
714
- else {
715
- NSURL* readAccessUrl = _allowingReadAccessToURL ? [RCTConvert NSURL:_allowingReadAccessToURL] : request.URL;
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
- static NSDictionary<NSNumber *, NSString *> *navigationTypes;
1210
- static dispatch_once_t onceToken;
1211
-
1212
- dispatch_once(&onceToken, ^{
1213
- navigationTypes = @{
1214
- @(WKNavigationTypeLinkActivated): @"click",
1215
- @(WKNavigationTypeFormSubmitted): @"formsubmit",
1216
- @(WKNavigationTypeBackForward): @"backforward",
1217
- @(WKNavigationTypeReload): @"reload",
1218
- @(WKNavigationTypeFormResubmitted): @"formresubmit",
1219
- @(WKNavigationTypeOther): @"other",
1220
- };
1221
- });
1222
-
1223
- WKNavigationType navigationType = navigationAction.navigationType;
1224
- NSURLRequest *request = navigationAction.request;
1225
- BOOL isTopFrame = [request.URL isEqual:request.mainDocumentURL];
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
- if (_onLoadingStart) {
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
- @"navigationType": navigationTypes[@(navigationType)]
1084
+ @"mainDocumentURL": (request.mainDocumentURL).absoluteString,
1085
+ @"navigationType": navigationTypes[@(navigationType)],
1086
+ @"isTopFrame": @(isTopFrame)
1250
1087
  }];
1251
- _onLoadingStart(event);
1088
+ if (![self.delegate webView:self
1089
+ shouldStartLoadForRequest:event
1090
+ withCallback:_onShouldStartLoadWithRequest]) {
1091
+ decisionHandler(WKNavigationActionPolicyCancel);
1092
+ return;
1093
+ }
1252
1094
  }
1253
- }
1254
1095
 
1255
- // Allow all navigation by default
1256
- decisionHandler(WKNavigationActionPolicyAllow);
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
- [self syncCookiesToWebView:nil];
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
 
@@ -8,6 +8,4 @@
8
8
  #import <React/RCTViewManager.h>
9
9
 
10
10
  @interface BPCWebViewManager : RCTViewManager
11
- @property (nonatomic, copy) NSArray<NSDictionary *> * _Nullable menuItems;
12
- @property (nonatomic, copy) RCTDirectEventBlock onCustomMenuSelection;
13
11
  @end
@@ -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, WindowsWebViewProps } from './lib/WebViewTypes';
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 & WindowsWebViewProps;
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?: () => void;
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?: (clear: boolean) => void;
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?: () => void;
61
+ clearHistory: () => void;
62
62
  }
63
63
 
64
64
  export {WebView};
package/ios/.DS_Store CHANGED
Binary file