react-native-webview-bootpay 13.13.432 → 13.14.1
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 +37 -0
- package/android/src/main/AndroidManifest.xml +84 -0
- package/android/src/main/AndroidManifestNew.xml +84 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +168 -15
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +41 -3
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +48 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +54 -0
- package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +138 -0
- package/android/src/newarch/kr/co/bootpay/webview/BPCWebViewModule.java +10 -0
- package/android/src/oldarch/kr/co/bootpay/webview/BPCWebViewModule.java +10 -0
- package/apple/BPCWKProcessPoolManager.h +13 -0
- package/apple/BPCWKProcessPoolManager.m +43 -0
- package/apple/BPCWebView.mm +6 -6
- package/apple/BPCWebViewImpl.h +1 -1
- package/apple/BPCWebViewImpl.m +204 -30
- package/apple/BPCWebViewModule.mm +22 -0
- package/index.d.ts +54 -48
- package/lib/NativeBPCWebViewModule.d.ts +12 -2
- package/lib/WebView.android.d.ts +1 -5
- package/lib/WebView.ios.d.ts +1 -5
- package/lib/WebView.macos.d.ts +1 -5
- package/lib/WebView.styles.d.ts +1 -37
- package/lib/WebView.windows.d.ts +1 -5
- package/lib/WebViewShared.d.ts +30 -31
- package/package.json +35 -31
- package/react-native-webview-bootpay.podspec +46 -0
- package/src/NativeBPCWebViewModule.ts +12 -21
- package/lib/BPCWebViewNativeComponent.d.ts +0 -242
- package/lib/BPCWebViewNativeComponent.js +0 -1
- package/lib/NativeBPCWebViewModule.js +0 -1
- package/lib/WebView.android.js +0 -1
- package/lib/WebView.ios.js +0 -1
- package/lib/WebView.js +0 -1
- package/lib/WebView.macos.js +0 -1
- package/lib/WebView.styles.js +0 -1
- package/lib/WebView.windows.js +0 -1
- package/lib/WebViewNativeComponent.macos.js +0 -1
- package/lib/WebViewNativeComponent.windows.js +0 -1
- package/lib/WebViewShared.js +0 -1
- package/lib/WebViewTypes.js +0 -1
- package/lib/index.js +0 -1
package/apple/BPCWebViewImpl.m
CHANGED
|
@@ -18,20 +18,20 @@
|
|
|
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 = @"BPReactNativeHistoryShim";
|
|
22
|
+
static NSString *const MessageHandlerName = @"BootpayRNWebView";
|
|
23
23
|
static NSURLCredential* clientAuthenticationCredential;
|
|
24
24
|
static NSDictionary* customCertificatesForHost;
|
|
25
25
|
|
|
26
|
-
NSString *const
|
|
26
|
+
NSString *const BPCUSTOM_SELECTOR = @"_BPCUSTOM_SELECTOR_";
|
|
27
27
|
|
|
28
28
|
#if TARGET_OS_IOS
|
|
29
29
|
// runtime trick to remove WKWebView keyboard default toolbar
|
|
30
30
|
// see: http://stackoverflow.com/questions/19033292/ios-7-uiwebview-keyboard-issue/19042279#19042279
|
|
31
|
-
@interface
|
|
31
|
+
@interface _BPSwizzleHelperWK : UIView
|
|
32
32
|
@property (nonatomic, copy) WKWebView *webView;
|
|
33
33
|
@end
|
|
34
|
-
@implementation
|
|
34
|
+
@implementation _BPSwizzleHelperWK
|
|
35
35
|
-(id)inputAccessoryView
|
|
36
36
|
{
|
|
37
37
|
if (_webView == nil) {
|
|
@@ -48,13 +48,13 @@ NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
|
48
48
|
@end
|
|
49
49
|
#endif // TARGET_OS_IOS
|
|
50
50
|
|
|
51
|
-
@interface
|
|
51
|
+
@interface BPCWKWebView : WKWebView
|
|
52
52
|
#if !TARGET_OS_OSX
|
|
53
53
|
@property (nonatomic, copy) NSArray<NSDictionary *> * _Nullable menuItems;
|
|
54
54
|
@property (nonatomic, copy) NSArray<NSString *> * _Nullable suppressMenuItems;
|
|
55
55
|
#endif // !TARGET_OS_OSX
|
|
56
56
|
@end
|
|
57
|
-
@implementation
|
|
57
|
+
@implementation BPCWKWebView
|
|
58
58
|
#if !TARGET_OS_OSX
|
|
59
59
|
- (NSString *)stringFromAction:(SEL) action {
|
|
60
60
|
NSString *sel = NSStringFromSelector(action);
|
|
@@ -121,7 +121,7 @@ UIGestureRecognizerDelegate,
|
|
|
121
121
|
#endif // !TARGET_OS_OSX
|
|
122
122
|
RCTAutoInsetsProtocol>
|
|
123
123
|
|
|
124
|
-
@property (nonatomic, copy)
|
|
124
|
+
@property (nonatomic, copy) BPCWKWebView *webView;
|
|
125
125
|
@property (nonatomic, strong) WKUserScript *postMessageScript;
|
|
126
126
|
@property (nonatomic, strong) WKUserScript *injectedObjectJsonScript;
|
|
127
127
|
@property (nonatomic, strong) WKUserScript *atStartScript;
|
|
@@ -280,7 +280,7 @@ RCTAutoInsetsProtocol>
|
|
|
280
280
|
for(NSDictionary *menuItem in self.menuItems) {
|
|
281
281
|
NSString *menuItemLabel = [RCTConvert NSString:menuItem[@"label"]];
|
|
282
282
|
NSString *menuItemKey = [RCTConvert NSString:menuItem[@"key"]];
|
|
283
|
-
NSString *sel = [NSString stringWithFormat:@"%@%@",
|
|
283
|
+
NSString *sel = [NSString stringWithFormat:@"%@%@", BPCUSTOM_SELECTOR, menuItemKey];
|
|
284
284
|
UIMenuItem *item = [[UIMenuItem alloc] initWithTitle: menuItemLabel
|
|
285
285
|
action: NSSelectorFromString(sel)];
|
|
286
286
|
[menuControllerItems addObject: item];
|
|
@@ -296,7 +296,7 @@ RCTAutoInsetsProtocol>
|
|
|
296
296
|
for(NSDictionary *menuItem in self.menuItems) {
|
|
297
297
|
NSString *menuItemLabel = [RCTConvert NSString:menuItem[@"label"]];
|
|
298
298
|
NSString *menuItemKey = [RCTConvert NSString:menuItem[@"key"]];
|
|
299
|
-
NSString *sel = [NSString stringWithFormat:@"%@%@",
|
|
299
|
+
NSString *sel = [NSString stringWithFormat:@"%@%@", BPCUSTOM_SELECTOR, menuItemKey];
|
|
300
300
|
UICommand *command = [UICommand commandWithTitle:menuItemLabel
|
|
301
301
|
image:nil
|
|
302
302
|
action:NSSelectorFromString(sel)
|
|
@@ -357,7 +357,7 @@ RCTAutoInsetsProtocol>
|
|
|
357
357
|
- (void)forwardInvocation:(NSInvocation *)invocation
|
|
358
358
|
{
|
|
359
359
|
NSString *sel = NSStringFromSelector([invocation selector]);
|
|
360
|
-
NSRange match = [sel rangeOfString:
|
|
360
|
+
NSRange match = [sel rangeOfString:BPCUSTOM_SELECTOR];
|
|
361
361
|
if (match.location == 0) {
|
|
362
362
|
[self tappedMenuItem:[sel substringFromIndex:17]];
|
|
363
363
|
} else {
|
|
@@ -376,7 +376,7 @@ RCTAutoInsetsProtocol>
|
|
|
376
376
|
{
|
|
377
377
|
NSString *sel = NSStringFromSelector(action);
|
|
378
378
|
// Do any of them have our custom keys?
|
|
379
|
-
NSRange match = [sel rangeOfString:
|
|
379
|
+
NSRange match = [sel rangeOfString:BPCUSTOM_SELECTOR];
|
|
380
380
|
|
|
381
381
|
if (match.location == 0) {
|
|
382
382
|
return YES;
|
|
@@ -389,20 +389,44 @@ RCTAutoInsetsProtocol>
|
|
|
389
389
|
*/
|
|
390
390
|
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
|
|
391
391
|
{
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
392
|
+
if (!navigationAction.targetFrame.isMainFrame) {
|
|
393
|
+
NSString *url = navigationAction.request.URL.absoluteString;
|
|
394
|
+
if ([url containsString:@"bootpay.co.kr"]) {
|
|
395
|
+
// 팝업(새 창) 뜨는 경우 호출됨 (window.open 또는 target="_blank")
|
|
396
|
+
WKWebView *popupView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height) configuration:configuration];
|
|
397
|
+
[popupView autoresizingMask];
|
|
398
|
+
popupView.navigationDelegate = self;
|
|
399
|
+
popupView.UIDelegate = self;
|
|
400
|
+
[self addSubview:popupView];
|
|
401
|
+
return popupView;
|
|
402
|
+
} else {
|
|
403
|
+
if (_onOpenWindow) {
|
|
404
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
405
|
+
[event addEntriesFromDictionary: @{@"targetUrl": url}];
|
|
406
|
+
_onOpenWindow(event);
|
|
407
|
+
} else {
|
|
408
|
+
[webView loadRequest:navigationAction.request];
|
|
409
|
+
}
|
|
410
|
+
}
|
|
401
411
|
}
|
|
402
|
-
|
|
412
|
+
// if (!navigationAction.targetFrame.isMainFrame) {
|
|
413
|
+
// NSURL *url = navigationAction.request.URL;
|
|
414
|
+
//
|
|
415
|
+
// if (_onOpenWindow) {
|
|
416
|
+
// NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
417
|
+
// [event addEntriesFromDictionary: @{@"targetUrl": url.absoluteString}];
|
|
418
|
+
// _onOpenWindow(event);
|
|
419
|
+
// } else {
|
|
420
|
+
// [webView loadRequest:navigationAction.request];
|
|
421
|
+
// }
|
|
422
|
+
// }
|
|
403
423
|
return nil;
|
|
404
424
|
}
|
|
405
425
|
|
|
426
|
+
- (void)webViewDidClose:(WKWebView *)webView {
|
|
427
|
+
[webView removeFromSuperview];
|
|
428
|
+
}
|
|
429
|
+
|
|
406
430
|
/**
|
|
407
431
|
* Enables file input on macos, see https://developer.apple.com/documentation/webkit/wkuidelegate/1641952-webview
|
|
408
432
|
*/
|
|
@@ -488,7 +512,7 @@ RCTAutoInsetsProtocol>
|
|
|
488
512
|
#endif
|
|
489
513
|
|
|
490
514
|
// Shim the HTML5 history API:
|
|
491
|
-
[wkWebViewConfig.userContentController addScriptMessageHandler:[[
|
|
515
|
+
[wkWebViewConfig.userContentController addScriptMessageHandler:[[BPCWeakScriptMessageDelegate alloc] initWithDelegate:self]
|
|
492
516
|
name:HistoryShimName];
|
|
493
517
|
[self resetupScripts:wkWebViewConfig];
|
|
494
518
|
|
|
@@ -516,7 +540,7 @@ RCTAutoInsetsProtocol>
|
|
|
516
540
|
{
|
|
517
541
|
if (self.window != nil && _webView == nil) {
|
|
518
542
|
WKWebViewConfiguration *wkWebViewConfig = [self setUpWkWebViewConfig];
|
|
519
|
-
_webView = [[
|
|
543
|
+
_webView = [[BPCWKWebView alloc] initWithFrame:self.bounds configuration: wkWebViewConfig];
|
|
520
544
|
[self setBackgroundColor: _savedBackgroundColor];
|
|
521
545
|
#if !TARGET_OS_OSX
|
|
522
546
|
_webView.menuItems = _menuItems;
|
|
@@ -979,7 +1003,7 @@ RCTAutoInsetsProtocol>
|
|
|
979
1003
|
|
|
980
1004
|
if(subview == nil) return;
|
|
981
1005
|
|
|
982
|
-
NSString* name = [NSString stringWithFormat:@"%@
|
|
1006
|
+
NSString* name = [NSString stringWithFormat:@"%@_BPSwizzleHelperWK", subview.class.superclass];
|
|
983
1007
|
Class newClass = NSClassFromString(name);
|
|
984
1008
|
|
|
985
1009
|
if(newClass == nil)
|
|
@@ -987,7 +1011,7 @@ RCTAutoInsetsProtocol>
|
|
|
987
1011
|
newClass = objc_allocateClassPair(subview.class, [name cStringUsingEncoding:NSASCIIStringEncoding], 0);
|
|
988
1012
|
if(!newClass) return;
|
|
989
1013
|
|
|
990
|
-
Method method = class_getInstanceMethod([
|
|
1014
|
+
Method method = class_getInstanceMethod([_BPSwizzleHelperWK class], @selector(inputAccessoryView));
|
|
991
1015
|
class_addMethod(newClass, @selector(inputAccessoryView), method_getImplementation(method), method_getTypeEncoding(method));
|
|
992
1016
|
|
|
993
1017
|
objc_registerClassPair(newClass);
|
|
@@ -1001,7 +1025,7 @@ RCTAutoInsetsProtocol>
|
|
|
1001
1025
|
UIView* subview;
|
|
1002
1026
|
|
|
1003
1027
|
for (UIView* view in _webView.scrollView.subviews) {
|
|
1004
|
-
if([[view.class description] hasSuffix:@"
|
|
1028
|
+
if([[view.class description] hasSuffix:@"_BPSwizzleHelperWK"])
|
|
1005
1029
|
subview = view;
|
|
1006
1030
|
}
|
|
1007
1031
|
|
|
@@ -1306,6 +1330,25 @@ RCTAutoInsetsProtocol>
|
|
|
1306
1330
|
- (void) webView:(WKWebView *)webView
|
|
1307
1331
|
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
|
|
1308
1332
|
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
|
|
1333
|
+
{
|
|
1334
|
+
NSString *url = navigationAction.request.URL.absoluteString;
|
|
1335
|
+
|
|
1336
|
+
if([self isItunesURL:url]) {
|
|
1337
|
+
[self startAppToApp:[NSURL URLWithString:url]];
|
|
1338
|
+
decisionHandler(WKNavigationActionPolicyCancel);
|
|
1339
|
+
} else if([url hasPrefix:@"about:blank"]) {
|
|
1340
|
+
decisionHandler(WKNavigationActionPolicyAllow);
|
|
1341
|
+
} else if(![url hasPrefix:@"http"]) {
|
|
1342
|
+
[self startAppToApp:[NSURL URLWithString:url]];
|
|
1343
|
+
decisionHandler(WKNavigationActionPolicyCancel);
|
|
1344
|
+
} else {
|
|
1345
|
+
[self webViewRN:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler];
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
- (void) webViewRN:(WKWebView *)webView
|
|
1350
|
+
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
|
|
1351
|
+
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
|
|
1309
1352
|
{
|
|
1310
1353
|
static NSDictionary<NSNumber *, NSString *> *navigationTypes;
|
|
1311
1354
|
static dispatch_once_t onceToken;
|
|
@@ -1811,7 +1854,7 @@ didFinishNavigation:(WKNavigation *)navigation
|
|
|
1811
1854
|
[wkWebViewConfig.userContentController removeScriptMessageHandlerForName:MessageHandlerName];
|
|
1812
1855
|
if(self.enableApplePay){
|
|
1813
1856
|
if (self.postMessageScript){
|
|
1814
|
-
[wkWebViewConfig.userContentController addScriptMessageHandler:[[
|
|
1857
|
+
[wkWebViewConfig.userContentController addScriptMessageHandler:[[BPCWeakScriptMessageDelegate alloc] initWithDelegate:self]
|
|
1815
1858
|
name:MessageHandlerName];
|
|
1816
1859
|
}
|
|
1817
1860
|
return;
|
|
@@ -1902,7 +1945,7 @@ didFinishNavigation:(WKNavigation *)navigation
|
|
|
1902
1945
|
|
|
1903
1946
|
if(_messagingEnabled){
|
|
1904
1947
|
if (self.postMessageScript){
|
|
1905
|
-
[wkWebViewConfig.userContentController addScriptMessageHandler:[[
|
|
1948
|
+
[wkWebViewConfig.userContentController addScriptMessageHandler:[[BPCWeakScriptMessageDelegate alloc] initWithDelegate:self]
|
|
1906
1949
|
name:MessageHandlerName];
|
|
1907
1950
|
[wkWebViewConfig.userContentController addUserScript:self.postMessageScript];
|
|
1908
1951
|
}
|
|
@@ -1939,9 +1982,140 @@ didFinishNavigation:(WKNavigation *)navigation
|
|
|
1939
1982
|
return request;
|
|
1940
1983
|
}
|
|
1941
1984
|
|
|
1985
|
+
#pragma mark - WebView Javascript
|
|
1986
|
+
|
|
1987
|
+
-(void) doJavascript:(NSString*) script {
|
|
1988
|
+
[_webView evaluateJavaScript:script completionHandler:nil];
|
|
1989
|
+
}
|
|
1990
|
+
|
|
1991
|
+
- (void) loadUrl:(NSString*) urlString {
|
|
1992
|
+
NSURL *url = [NSURL URLWithString:urlString];
|
|
1993
|
+
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
|
|
1994
|
+
[_webView loadRequest:request];
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
- (void) naverLoginBugFix {
|
|
1998
|
+
// if([_beforeUrl hasPrefix:@"naversearchthirdlogin://"]) {
|
|
1999
|
+
// NSString* value = [self getQueryStringParameter:_beforeUrl :@"session"];
|
|
2000
|
+
// if(value != nil && [value length] > 0) {
|
|
2001
|
+
// NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://nid.naver.com/login/scheme.redirect?session=%@", value]];
|
|
2002
|
+
// NSURLRequest *request = [[NSURLRequest alloc] initWithURL:url];
|
|
2003
|
+
// [_webView loadRequest:request];
|
|
2004
|
+
// }
|
|
2005
|
+
// }
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
- (NSString*) getQueryStringParameter:(NSString*)url :(NSString*)param {
|
|
2009
|
+
NSMutableDictionary *queryStringDictionary = [[NSMutableDictionary alloc] init];
|
|
2010
|
+
NSArray *urlComponents = [url componentsSeparatedByString:@"&"];
|
|
2011
|
+
|
|
2012
|
+
for (NSString *keyValuePair in urlComponents)
|
|
2013
|
+
{
|
|
2014
|
+
NSArray *pairComponents = [keyValuePair componentsSeparatedByString:@"="];
|
|
2015
|
+
NSString *key = [[pairComponents firstObject] stringByRemovingPercentEncoding];
|
|
2016
|
+
NSString *value = [[pairComponents lastObject] stringByRemovingPercentEncoding];
|
|
2017
|
+
|
|
2018
|
+
if([param isEqualToString:key]) {
|
|
2019
|
+
return value;
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
return @"";
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
- (void) startAppToApp:(NSURL*) url {
|
|
2027
|
+
UIApplication *application = [UIApplication sharedApplication];
|
|
2028
|
+
|
|
2029
|
+
if (@available(iOS 10.0, *)) {
|
|
2030
|
+
[application openURL:url options:@{} completionHandler: ^(BOOL success) {
|
|
2031
|
+
if(success == false) {
|
|
2032
|
+
[self startItunesToInstall:url];
|
|
2033
|
+
}
|
|
2034
|
+
}];
|
|
2035
|
+
} else {
|
|
2036
|
+
[application openURL:url];
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
|
|
2040
|
+
|
|
2041
|
+
- (void) startItunesToInstall:(NSURL*) url {
|
|
2042
|
+
NSString *sUrl = url.absoluteString;
|
|
2043
|
+
NSString *itunesUrl = @"";
|
|
2044
|
+
|
|
2045
|
+
if([sUrl hasPrefix: @"kfc-bankpay"]) {
|
|
2046
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EB%B1%85%ED%81%AC%ED%8E%98%EC%9D%B4-%EA%B8%88%EC%9C%B5%EA%B8%B0%EA%B4%80-%EA%B3%B5%EB%8F%99-%EA%B3%84%EC%A2%8C%EC%9D%B4%EC%B2%B4-%EA%B2%B0%EC%A0%9C-%EC%A0%9C%EB%A1%9C%ED%8E%98%EC%9D%B4/id398456030";
|
|
2047
|
+
} else if([sUrl hasPrefix: @"ispmobile"]) {
|
|
2048
|
+
itunesUrl = @"https://apps.apple.com/kr/app/isp/id369125087";
|
|
2049
|
+
} else if([sUrl hasPrefix: @"hdcardappcardansimclick"] || [sUrl hasPrefix: @"smhyundaiansimclick"]) {
|
|
2050
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%ED%98%84%EB%8C%80%EC%B9%B4%EB%93%9C/id702653088";
|
|
2051
|
+
} else if([sUrl hasPrefix: @"shinhan-sr-ansimclick"] || [sUrl hasPrefix: @"smshinhanansimclick"]) {
|
|
2052
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%8B%A0%ED%95%9C%ED%8E%98%EC%9D%B4%ED%8C%90/id572462317";
|
|
2053
|
+
} else if([sUrl hasPrefix: @"kb-acp"]) {
|
|
2054
|
+
itunesUrl = @"https://apps.apple.com/kr/app/kb-pay/id695436326";
|
|
2055
|
+
} else if([sUrl hasPrefix: @"liivbank"]) {
|
|
2056
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EB%A6%AC%EB%B8%8C/id1126232922";
|
|
2057
|
+
} else if([sUrl hasPrefix: @"mpocket.online.ansimclick"] || [sUrl hasPrefix: @"ansimclickscard"] || [sUrl hasPrefix: @"ansimclickipcollect"] || [sUrl hasPrefix: @"samsungpay"] || [sUrl hasPrefix: @"scardcertiapp"]) {
|
|
2058
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%82%BC%EC%84%B1%EC%B9%B4%EB%93%9C/id535125356";
|
|
2059
|
+
} else if([sUrl hasPrefix: @"lottesmartpay"]) {
|
|
2060
|
+
itunesUrl = @"https://apps.apple.com/us/app/%EB%A1%AF%EB%8D%B0%EC%B9%B4%EB%93%9C-%EC%95%B1%EC%B9%B4%EB%93%9C/id688047200";
|
|
2061
|
+
} else if([sUrl hasPrefix: @"lotteappcard"]) {
|
|
2062
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EB%94%94%EC%A7%80%EB%A1%9C%EC%B9%B4-%EB%A1%AF%EB%8D%B0%EC%B9%B4%EB%93%9C/id688047200";
|
|
2063
|
+
} else if([sUrl hasPrefix: @"newsmartpib"]) {
|
|
2064
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%9A%B0%EB%A6%AC-won-%EB%B1%85%ED%82%B9/id1470181651";
|
|
2065
|
+
} else if([sUrl hasPrefix: @"com.wooricard.wcard"]) {
|
|
2066
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%9A%B0%EB%A6%ACwon%EC%B9%B4%EB%93%9C/id1499598869";
|
|
2067
|
+
} else if([sUrl hasPrefix: @"citispay"] || [sUrl hasPrefix: @"citicardappkr"] || [sUrl hasPrefix: @"citimobileapp"]) {
|
|
2068
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%94%A8%ED%8B%B0%EB%AA%A8%EB%B0%94%EC%9D%BC/id1179759666";
|
|
2069
|
+
} else if([sUrl hasPrefix: @"shinsegaeeasypayment"]) {
|
|
2070
|
+
itunesUrl = @"https://apps.apple.com/kr/app/ssgpay/id666237916";
|
|
2071
|
+
} else if([sUrl hasPrefix: @"cloudpay"]) {
|
|
2072
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%ED%95%98%EB%82%98%EC%B9%B4%EB%93%9C-%EC%9B%90%ED%81%90%ED%8E%98%EC%9D%B4/id847268987";
|
|
2073
|
+
} else if([sUrl hasPrefix: @"hanawalletmembers"]) {
|
|
2074
|
+
itunesUrl = @"https://apps.apple.com/kr/app/n-wallet/id492190784";
|
|
2075
|
+
} else if([sUrl hasPrefix: @"nhappvardansimclick"]) {
|
|
2076
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%98%AC%EC%9B%90%ED%8E%98%EC%9D%B4-nh%EC%95%B1%EC%B9%B4%EB%93%9C/id1177889176";
|
|
2077
|
+
} else if([sUrl hasPrefix: @"nhallonepayansimclick"] || [sUrl hasPrefix: @"nhappcardansimclick"] || [sUrl hasPrefix: @"nhallonepayansimclick"] || [sUrl hasPrefix: @"nonghyupcardansimclick"]) {
|
|
2078
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%98%AC%EC%9B%90%ED%8E%98%EC%9D%B4-nh%EC%95%B1%EC%B9%B4%EB%93%9C/id1177889176";
|
|
2079
|
+
} else if([sUrl hasPrefix: @"payco"]) {
|
|
2080
|
+
itunesUrl = @"https://apps.apple.com/kr/app/payco/id924292102";
|
|
2081
|
+
} else if([sUrl hasPrefix: @"lpayapp"] || [sUrl hasPrefix: @"lmslpay"]) {
|
|
2082
|
+
itunesUrl = @"https://apps.apple.com/kr/app/l-point-with-l-pay/id473250588";
|
|
2083
|
+
} else if([sUrl hasPrefix: @"naversearchapp"]) {
|
|
2084
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EB%84%A4%EC%9D%B4%EB%B2%84-naver/id393499958";
|
|
2085
|
+
} else if([sUrl hasPrefix: @"tauthlink"]) {
|
|
2086
|
+
itunesUrl = @"https://apps.apple.com/kr/app/pass-by-skt/id1141258007";
|
|
2087
|
+
} else if([sUrl hasPrefix: @"uplusauth"] || [sUrl hasPrefix: @"upluscorporation"] ) {
|
|
2088
|
+
itunesUrl = @"https://apps.apple.com/kr/app/pass-by-u/id1147394645";
|
|
2089
|
+
} else if([sUrl hasPrefix: @"ktauthexternalcall"]) {
|
|
2090
|
+
itunesUrl = @"https://apps.apple.com/kr/app/pass-by-kt/id1134371550";
|
|
2091
|
+
} else if([sUrl hasPrefix: @"supertoss"]) {
|
|
2092
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%ED%86%A0%EC%8A%A4/id839333328";
|
|
2093
|
+
} else if([sUrl hasPrefix: @"kakaotalk"]) {
|
|
2094
|
+
itunesUrl = @"https://apps.apple.com/kr/app/kakaotalk/id362057947";
|
|
2095
|
+
} else if([sUrl hasPrefix: @"chaipayment"]) {
|
|
2096
|
+
itunesUrl = @"https://apps.apple.com/kr/app/%EC%B0%A8%EC%9D%B4/id1459979272";
|
|
2097
|
+
} else if([sUrl hasPrefix: @"ukbanksmartbanknonloginpay"]) {
|
|
2098
|
+
itunesUrl = @"https://itunes.apple.com/kr/developer/%EC%BC%80%EC%9D%B4%EB%B1%85%ED%81%AC/id1178872626?mt=8";
|
|
2099
|
+
} else if([sUrl hasPrefix: @"newliiv"]) {
|
|
2100
|
+
itunesUrl = @"https://apps.apple.com/us/app/%EB%A6%AC%EB%B8%8C-next/id1573528126";
|
|
2101
|
+
} else if([sUrl hasPrefix: @"kbbank"]) {
|
|
2102
|
+
itunesUrl = @"https://apps.apple.com/kr/app/kb%EC%8A%A4%ED%83%80%EB%B1%85%ED%82%B9/id373742138";
|
|
2103
|
+
}
|
|
2104
|
+
|
|
2105
|
+
if(itunesUrl.length > 0) {
|
|
2106
|
+
NSURL *appstore = [NSURL URLWithString: itunesUrl];
|
|
2107
|
+
[self startAppToApp: appstore];
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
- (BOOL) isItunesURL:(NSString*) urlString {
|
|
2112
|
+
NSRange match = [urlString rangeOfString: @"itunes.apple.com"];
|
|
2113
|
+
return match.location != NSNotFound;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
1942
2116
|
@end
|
|
1943
2117
|
|
|
1944
|
-
@implementation
|
|
2118
|
+
@implementation BPCWeakScriptMessageDelegate
|
|
1945
2119
|
|
|
1946
2120
|
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate {
|
|
1947
2121
|
self = [super init];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#import "BPCWebViewModule.h"
|
|
2
2
|
|
|
3
3
|
#import "BPCWebViewDecisionManager.h"
|
|
4
|
+
#import "BPCWKProcessPoolManager.h"
|
|
4
5
|
|
|
5
6
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
6
7
|
#import <React/RCTFabricComponentsPlugins.h>
|
|
@@ -10,6 +11,27 @@
|
|
|
10
11
|
|
|
11
12
|
RCT_EXPORT_MODULE(BPCWebViewModule)
|
|
12
13
|
|
|
14
|
+
// 모듈 로드 시 자동으로 WebView 프리워밍 시작
|
|
15
|
+
// +load 대신 constructor attribute 사용 (RCT_EXPORT_MODULE이 이미 +load를 정의하므로 충돌 방지)
|
|
16
|
+
__attribute__((constructor))
|
|
17
|
+
static void BPCWebViewModuleAutoWarmUp(void) {
|
|
18
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
19
|
+
[[BPCWKProcessPoolManager sharedManager] warmUp];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
RCT_EXPORT_METHOD(warmUp) {
|
|
24
|
+
[[BPCWKProcessPoolManager sharedManager] warmUp];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
RCT_EXPORT_METHOD(warmUpWithDelay:(double)delay) {
|
|
28
|
+
[[BPCWKProcessPoolManager sharedManager] warmUpWithDelay:delay];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
RCT_EXPORT_METHOD(releaseWarmUp) {
|
|
32
|
+
[[BPCWKProcessPoolManager sharedManager] releaseWarmUp];
|
|
33
|
+
}
|
|
34
|
+
|
|
13
35
|
RCT_EXPORT_METHOD(isFileUploadSupported:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject) {
|
|
14
36
|
if (resolve) {
|
|
15
37
|
resolve(@(YES));
|
package/index.d.ts
CHANGED
|
@@ -2,64 +2,70 @@ import { Component } from 'react';
|
|
|
2
2
|
// eslint-disable-next-line
|
|
3
3
|
import { IOSWebViewProps, AndroidWebViewProps, WindowsWebViewProps } from './lib/WebViewTypes';
|
|
4
4
|
|
|
5
|
-
export {
|
|
5
|
+
export {
|
|
6
|
+
FileDownload,
|
|
7
|
+
WebViewMessageEvent,
|
|
8
|
+
WebViewNavigation,
|
|
9
|
+
} from './lib/WebViewTypes';
|
|
6
10
|
|
|
7
|
-
export type WebViewProps = IOSWebViewProps &
|
|
11
|
+
export type WebViewProps = IOSWebViewProps &
|
|
12
|
+
AndroidWebViewProps &
|
|
13
|
+
WindowsWebViewProps;
|
|
8
14
|
|
|
9
15
|
declare class WebView<P = {}> extends Component<WebViewProps & P> {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Go back one page in the webview's history.
|
|
18
|
+
*/
|
|
19
|
+
goBack: () => void;
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Go forward one page in the webview's history.
|
|
23
|
+
*/
|
|
24
|
+
goForward: () => void;
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Reloads the current page.
|
|
28
|
+
*/
|
|
29
|
+
reload: () => void;
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Stop loading the current page.
|
|
33
|
+
*/
|
|
34
|
+
stopLoading(): void;
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Executes the JavaScript string.
|
|
38
|
+
*/
|
|
39
|
+
injectJavaScript: (script: string) => void;
|
|
34
40
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Posts a message to WebView.
|
|
42
|
-
*/
|
|
43
|
-
postMessage: (message: string) => void;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* (Android only)
|
|
47
|
-
* Removes the autocomplete popup from the currently focused form field, if present.
|
|
48
|
-
*/
|
|
49
|
-
clearFormData?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Focuses on WebView redered page.
|
|
43
|
+
*/
|
|
44
|
+
requestFocus: () => void;
|
|
50
45
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
clearCache?: (clear: boolean) => void;
|
|
46
|
+
/**
|
|
47
|
+
* Posts a message to WebView.
|
|
48
|
+
*/
|
|
49
|
+
postMessage: (message: string) => void;
|
|
56
50
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
/**
|
|
52
|
+
* (Android only)
|
|
53
|
+
* Removes the autocomplete popup from the currently focused form field, if present.
|
|
54
|
+
*/
|
|
55
|
+
clearFormData?: () => void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* (Android only)
|
|
59
|
+
* Clears the resource cache. Note that the cache is per-application, so this will clear the cache for all WebViews used.
|
|
60
|
+
*/
|
|
61
|
+
clearCache?: (clear: boolean) => void;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* (Android only)
|
|
65
|
+
* Tells this WebView to clear its internal back/forward list.
|
|
66
|
+
*/
|
|
67
|
+
clearHistory?: () => void;
|
|
62
68
|
}
|
|
63
69
|
|
|
64
|
-
export {WebView};
|
|
70
|
+
export { WebView };
|
|
65
71
|
export default WebView;
|
|
@@ -3,6 +3,16 @@ import { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
|
3
3
|
export interface Spec extends TurboModule {
|
|
4
4
|
isFileUploadSupported(): Promise<boolean>;
|
|
5
5
|
shouldStartLoadWithLockIdentifier(shouldStart: boolean, lockIdentifier: Double): void;
|
|
6
|
+
/**
|
|
7
|
+
* WebView 프로세스를 미리 초기화하여 첫 결제 화면 로딩 속도를 개선합니다.
|
|
8
|
+
* 앱 시작 시 또는 결제 화면 진입 전에 호출하세요.
|
|
9
|
+
*/
|
|
10
|
+
warmUp(): void;
|
|
11
|
+
/**
|
|
12
|
+
* 프리워밍된 WebView 리소스를 해제합니다.
|
|
13
|
+
* 메모리가 부족할 때 호출할 수 있습니다.
|
|
14
|
+
*/
|
|
15
|
+
releaseWarmUp(): void;
|
|
6
16
|
}
|
|
7
|
-
declare const
|
|
8
|
-
export default
|
|
17
|
+
declare const _default: any;
|
|
18
|
+
export default _default;
|
package/lib/WebView.android.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { AndroidWebViewProps } from './WebViewTypes';
|
|
3
|
-
declare const WebView: React.ForwardRefExoticComponent<AndroidWebViewProps & React.RefAttributes<{}>> & {
|
|
4
|
-
isFileUploadSupported: () => Promise<boolean>;
|
|
5
|
-
};
|
|
1
|
+
declare const WebView: any;
|
|
6
2
|
export default WebView;
|
package/lib/WebView.ios.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { IOSWebViewProps } from './WebViewTypes';
|
|
3
|
-
declare const WebView: React.ForwardRefExoticComponent<IOSWebViewProps & React.RefAttributes<{}>> & {
|
|
4
|
-
isFileUploadSupported: () => Promise<boolean>;
|
|
5
|
-
};
|
|
1
|
+
declare const WebView: any;
|
|
6
2
|
export default WebView;
|
package/lib/WebView.macos.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { MacOSWebViewProps } from './WebViewTypes';
|
|
3
|
-
declare const WebView: React.ForwardRefExoticComponent<MacOSWebViewProps & React.RefAttributes<{}>> & {
|
|
4
|
-
isFileUploadSupported: () => Promise<boolean>;
|
|
5
|
-
};
|
|
1
|
+
declare const WebView: any;
|
|
6
2
|
export default WebView;
|
package/lib/WebView.styles.d.ts
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
declare const styles:
|
|
2
|
-
container: {
|
|
3
|
-
flex: number;
|
|
4
|
-
overflow: "hidden";
|
|
5
|
-
};
|
|
6
|
-
loadingOrErrorView: {
|
|
7
|
-
position: "absolute";
|
|
8
|
-
flex: number;
|
|
9
|
-
justifyContent: "center";
|
|
10
|
-
alignItems: "center";
|
|
11
|
-
height: "100%";
|
|
12
|
-
width: "100%";
|
|
13
|
-
backgroundColor: string;
|
|
14
|
-
};
|
|
15
|
-
loadingProgressBar: {
|
|
16
|
-
height: number;
|
|
17
|
-
};
|
|
18
|
-
errorText: {
|
|
19
|
-
fontSize: number;
|
|
20
|
-
textAlign: "center";
|
|
21
|
-
marginBottom: number;
|
|
22
|
-
};
|
|
23
|
-
errorTextTitle: {
|
|
24
|
-
fontSize: number;
|
|
25
|
-
fontWeight: "500";
|
|
26
|
-
marginBottom: number;
|
|
27
|
-
};
|
|
28
|
-
webView: {
|
|
29
|
-
backgroundColor: string;
|
|
30
|
-
};
|
|
31
|
-
flexStart: {
|
|
32
|
-
alignSelf: "flex-start";
|
|
33
|
-
};
|
|
34
|
-
colorRed: {
|
|
35
|
-
color: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
1
|
+
declare const styles: any;
|
|
38
2
|
export default styles;
|
package/lib/WebView.windows.d.ts
CHANGED
|
@@ -9,9 +9,5 @@
|
|
|
9
9
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
10
|
* Licensed under the MIT License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
import { WindowsWebViewProps } from './WebViewTypes';
|
|
14
|
-
declare const WebView: React.ForwardRefExoticComponent<WindowsWebViewProps & React.RefAttributes<{}>> & {
|
|
15
|
-
isFileUploadSupported: () => Promise<boolean>;
|
|
16
|
-
};
|
|
12
|
+
declare const WebView: any;
|
|
17
13
|
export default WebView;
|