react-native-webview-bootpay 11.26.18 → 11.26.19

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 (52) hide show
  1. package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/transformed/classes/classes.dex +0 -0
  2. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  3. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
  4. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
  5. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
  6. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
  7. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  8. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  9. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  10. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  11. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  12. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  13. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  14. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  15. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  16. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  17. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  18. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  19. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  48. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  49. package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +122 -51
  50. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +2 -1
  51. package/apple/BPCWebView.m +19 -7
  52. package/package.json +1 -1
@@ -165,61 +165,132 @@ class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListen
165
165
 
166
166
  @Override
167
167
  public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
168
- final BPCWebView newWebView = new BPCWebView((ThemedReactContext) view.getContext());
169
- BPCWebChromeClient client = new BPCWebChromeClient(this.mReactContext, view);
170
- // client.onCloseWindow();
171
- client.setProgressChangedFilter(progressChangedFilter);
172
- newWebView.setWebChromeClient(client);
173
- setWebSettingCopy(view, newWebView);
174
-
175
- newWebView.setWebViewClient(new BPCWebViewClient() {
176
-
177
- @Override
178
- public boolean shouldOverrideUrlLoading(WebView view, String url) {
179
- Intent intent = getIntentWithPackage(url);
180
- Context context = view.getContext();
181
-
182
- if(isIntent(url)) {
183
- if(isInstallApp(intent, context)) return startApp(intent, context);
184
- else return startGooglePlay(intent, context);
185
- } else if(isMarket(url)) {
186
- if(isInstallApp(intent, context)) return startApp(intent, context);
187
- else return startGooglePlay(intent, context);
188
- } else if(isSpecialCase(url)) {
189
- if(isInstallApp(intent, context)) return startApp(intent, context);
190
- else return startGooglePlay(intent, context);
168
+
169
+ if(isDialog) {
170
+
171
+ final BPCWebView newWebView = new BPCWebView((ThemedReactContext) view.getContext());
172
+ BPCWebChromeClient client = new BPCWebChromeClient(this.mReactContext, view);
173
+ // client.onCloseWindow();
174
+ client.setProgressChangedFilter(progressChangedFilter);
175
+ newWebView.setWebChromeClient(client);
176
+ setWebSettingCopy(view, newWebView);
177
+
178
+ newWebView.setWebViewClient(new BPCWebViewClient() {
179
+
180
+ @Override
181
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
182
+ Intent intent = getIntentWithPackage(url);
183
+ Context context = view.getContext();
184
+
185
+ if(isIntent(url)) {
186
+ if(isInstallApp(intent, context)) return startApp(intent, context);
187
+ else return startGooglePlay(intent, context);
188
+ } else if(isMarket(url)) {
189
+ if(isInstallApp(intent, context)) return startApp(intent, context);
190
+ else return startGooglePlay(intent, context);
191
+ } else if(isSpecialCase(url)) {
192
+ if(isInstallApp(intent, context)) return startApp(intent, context);
193
+ else return startGooglePlay(intent, context);
194
+ }
195
+ return url.contains("vguardend");
191
196
  }
192
- return url.contains("vguardend");
193
- }
194
- });
195
-
196
- Dialog popupDialog = new Dialog(view.getContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
197
- popupDialog.setContentView(newWebView);
198
- ViewGroup.LayoutParams params = popupDialog.getWindow().getAttributes();
199
- params.width = ViewGroup.LayoutParams.MATCH_PARENT;
200
- params.height = ViewGroup.LayoutParams.MATCH_PARENT;
201
- popupDialog.getWindow().setAttributes((WindowManager.LayoutParams) params);
202
- popupDialog.setOnDismissListener(dialog -> {
203
- // Toast.makeText(view.getContext(), "팝업취소", Toast.LENGTH_SHORT).show();
204
- onCloseWindow(view); //rn에선 딱히 동작하지 않음
205
- });
206
- newWebView.setDialog(popupDialog);
207
- popupDialog.show();
208
-
209
- final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
210
- transport.setWebView(newWebView);
211
- resultMsg.sendToTarget();
197
+ });
198
+
199
+ Dialog popupDialog = new Dialog(view.getContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
200
+ popupDialog.setContentView(newWebView);
201
+ ViewGroup.LayoutParams params = popupDialog.getWindow().getAttributes();
202
+ params.width = ViewGroup.LayoutParams.MATCH_PARENT;
203
+ params.height = ViewGroup.LayoutParams.MATCH_PARENT;
204
+ popupDialog.getWindow().setAttributes((WindowManager.LayoutParams) params);
205
+ popupDialog.setOnDismissListener(dialog -> {
206
+ // Toast.makeText(view.getContext(), "팝업취소", Toast.LENGTH_SHORT).show();
207
+ onCloseWindow(view); //rn에선 딱히 동작하지 않음
208
+ });
209
+ newWebView.setDialog(popupDialog);
210
+ popupDialog.show();
211
+
212
+ final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
213
+ transport.setWebView(newWebView);
214
+ resultMsg.sendToTarget();
215
+
216
+ return true;
217
+ } else {
218
+ final WebView newWebView = new WebView(view.getContext());
219
+ final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
220
+ transport.setWebView(newWebView);
221
+ resultMsg.sendToTarget();
222
+
223
+ return true;
224
+ }
225
+
226
+
227
+ /*
228
+
229
+ String url = resultMsg.getData().getString("url");
230
+
231
+ if(url.startsWith("https://gw.bootpay.co.kr") || url.startsWith("http://gw.bootpay.co.kr")) {
232
+ final BPCWebView newWebView = new BPCWebView((ThemedReactContext) view.getContext());
233
+ BPCWebChromeClient client = new BPCWebChromeClient(this.mReactContext, view);
234
+ // client.onCloseWindow();
235
+ client.setProgressChangedFilter(progressChangedFilter);
236
+ newWebView.setWebChromeClient(client);
237
+ setWebSettingCopy(view, newWebView);
238
+
239
+ newWebView.setWebViewClient(new BPCWebViewClient() {
240
+
241
+ @Override
242
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
243
+ Intent intent = getIntentWithPackage(url);
244
+ Context context = view.getContext();
245
+
246
+ if(isIntent(url)) {
247
+ if(isInstallApp(intent, context)) return startApp(intent, context);
248
+ else return startGooglePlay(intent, context);
249
+ } else if(isMarket(url)) {
250
+ if(isInstallApp(intent, context)) return startApp(intent, context);
251
+ else return startGooglePlay(intent, context);
252
+ } else if(isSpecialCase(url)) {
253
+ if(isInstallApp(intent, context)) return startApp(intent, context);
254
+ else return startGooglePlay(intent, context);
255
+ }
256
+ return url.contains("vguardend");
257
+ }
258
+ });
259
+
260
+ Dialog popupDialog = new Dialog(view.getContext(), android.R.style.Theme_Black_NoTitleBar_Fullscreen);
261
+ popupDialog.setContentView(newWebView);
262
+ ViewGroup.LayoutParams params = popupDialog.getWindow().getAttributes();
263
+ params.width = ViewGroup.LayoutParams.MATCH_PARENT;
264
+ params.height = ViewGroup.LayoutParams.MATCH_PARENT;
265
+ popupDialog.getWindow().setAttributes((WindowManager.LayoutParams) params);
266
+ popupDialog.setOnDismissListener(dialog -> {
267
+ // Toast.makeText(view.getContext(), "팝업취소", Toast.LENGTH_SHORT).show();
268
+ onCloseWindow(view); //rn에선 딱히 동작하지 않음
269
+ });
270
+ newWebView.setDialog(popupDialog);
271
+ popupDialog.show();
272
+
273
+ final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
274
+ transport.setWebView(newWebView);
275
+ resultMsg.sendToTarget();
276
+
277
+ return true;
278
+
279
+ } else {
280
+ final WebView newWebView = new WebView(view.getContext());
281
+ final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
282
+ transport.setWebView(newWebView);
283
+ resultMsg.sendToTarget();
284
+
285
+ return true;
286
+
287
+ }
288
+
289
+ */
290
+
212
291
 
213
- return true;
214
292
 
215
- /*
216
- final WebView newWebView = new WebView(view.getContext());
217
- final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
218
- transport.setWebView(newWebView);
219
- resultMsg.sendToTarget();
220
293
 
221
- return true;
222
- */
223
294
  }
224
295
 
225
296
  @Override
@@ -889,7 +889,8 @@ public class BPCWebViewManager extends SimpleViewManager<WebView> {
889
889
  mReactContext.removeLifecycleEventListener(this);
890
890
  }
891
891
  };
892
-
892
+
893
+ // bootpay added //
893
894
  webView.setWebChromeClient(mWebChromeClient);
894
895
  } else {
895
896
  if (mWebChromeClient != null) {
@@ -317,16 +317,28 @@ RCTAutoInsetsProtocol>
317
317
  [webView loadRequest:navigationAction.request];
318
318
  }
319
319
  return nil;
320
- */
321
- WKWebView *popupView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height) configuration:configuration];
320
+ */
321
+ NSString *url = navigationAction.request.URL.absoluteString;
322
322
 
323
- [popupView autoresizingMask];
324
- popupView.navigationDelegate = self;
325
- popupView.UIDelegate = self;
323
+ if (!navigationAction.targetFrame.isMainFrame) {
324
+
325
+ if ([url hasPrefix:@"https://gw.bootpay.co.kr"] || [url hasPrefix:@"http://gw.bootpay.co.kr"]) {
326
+ // 팝업(새 창) 뜨는 경우 호출됨 (window.open 또는 target="_blank")
327
+ WKWebView *popupView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height) configuration:configuration];
328
+
329
+ [popupView autoresizingMask];
330
+ popupView.navigationDelegate = self;
331
+ popupView.UIDelegate = self;
326
332
 
327
- [self addSubview:popupView];
333
+ [self addSubview:popupView];
328
334
 
329
- return popupView;
335
+ return popupView;
336
+ } else {
337
+ [webView loadRequest:navigationAction.request];
338
+ return nil;
339
+ }
340
+ }
341
+ return nil;
330
342
  }
331
343
 
332
344
 
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "Thibault Malbranche <malbranche.thibault@gmail.com>"
11
11
  ],
12
12
  "license": "MIT",
13
- "version": "11.26.18",
13
+ "version": "11.26.19",
14
14
  "homepage": "https://github.com/bootpay/react-native-webview-bootpay",
15
15
  "scripts": {
16
16
  "android": "react-native run-android",