react-native-webview-bootpay 13.13.431 → 13.14.0
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 +11 -1
- 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 +30 -31
- package/react-native-webview-bootpay.podspec +46 -0
- package/src/NativeBPCWebViewModule.ts +10 -0
- 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
|
@@ -34,6 +34,11 @@ import com.facebook.react.module.annotations.ReactModule;
|
|
|
34
34
|
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
35
35
|
import com.facebook.react.modules.core.PermissionListener;
|
|
36
36
|
|
|
37
|
+
import android.webkit.CookieManager;
|
|
38
|
+
import android.webkit.WebView;
|
|
39
|
+
import android.os.Handler;
|
|
40
|
+
import android.os.Looper;
|
|
41
|
+
|
|
37
42
|
import java.io.File;
|
|
38
43
|
import java.io.IOException;
|
|
39
44
|
import java.lang.SecurityException;
|
|
@@ -51,6 +56,10 @@ public class BPCWebViewModuleImpl implements ActivityEventListener {
|
|
|
51
56
|
public static final int PICKER_LEGACY = 3;
|
|
52
57
|
public static final int FILE_DOWNLOAD_PERMISSION_REQUEST = 1;
|
|
53
58
|
|
|
59
|
+
// WarmUp을 위한 프리워밍된 WebView
|
|
60
|
+
private static WebView sPrewarmedWebView;
|
|
61
|
+
private static boolean sIsWarmedUp = false;
|
|
62
|
+
|
|
54
63
|
final private ReactApplicationContext mContext;
|
|
55
64
|
|
|
56
65
|
private DownloadManager.Request mDownloadRequest;
|
|
@@ -65,6 +74,51 @@ public class BPCWebViewModuleImpl implements ActivityEventListener {
|
|
|
65
74
|
context.addActivityEventListener(this);
|
|
66
75
|
}
|
|
67
76
|
|
|
77
|
+
/**
|
|
78
|
+
* WebView 프로세스를 미리 초기화하여 첫 결제 화면 로딩 속도를 개선합니다.
|
|
79
|
+
* Application의 onCreate 또는 적절한 시점에 호출하세요.
|
|
80
|
+
*
|
|
81
|
+
* Chromium 엔진 초기화에 200-300ms가 소요되므로, 이 메서드를 미리 호출하면
|
|
82
|
+
* 실제 결제 시 즉시 WebView가 표시됩니다.
|
|
83
|
+
*/
|
|
84
|
+
public void warmUp() {
|
|
85
|
+
if (sIsWarmedUp) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
new Handler(Looper.getMainLooper()).post(() -> {
|
|
90
|
+
try {
|
|
91
|
+
// CookieManager 초기화로 Chromium 엔진 로드 (thread-safe)
|
|
92
|
+
CookieManager.getInstance();
|
|
93
|
+
|
|
94
|
+
// 프리워밍용 WebView 생성
|
|
95
|
+
if (sPrewarmedWebView == null && mContext != null) {
|
|
96
|
+
sPrewarmedWebView = new WebView(mContext);
|
|
97
|
+
// 빈 HTML을 로드하여 WebContent 프로세스 초기화
|
|
98
|
+
sPrewarmedWebView.loadDataWithBaseURL(null, "", "text/html", "UTF-8", null);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
sIsWarmedUp = true;
|
|
102
|
+
} catch (Exception e) {
|
|
103
|
+
Log.w("BPCWebViewModule", "Failed to warm up WebView", e);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* 프리워밍된 WebView 리소스를 해제합니다.
|
|
110
|
+
* 메모리가 부족할 때 호출할 수 있습니다.
|
|
111
|
+
*/
|
|
112
|
+
public void releaseWarmUp() {
|
|
113
|
+
new Handler(Looper.getMainLooper()).post(() -> {
|
|
114
|
+
if (sPrewarmedWebView != null) {
|
|
115
|
+
sPrewarmedWebView.destroy();
|
|
116
|
+
sPrewarmedWebView = null;
|
|
117
|
+
}
|
|
118
|
+
sIsWarmedUp = false;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
68
122
|
@Override
|
|
69
123
|
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
|
|
70
124
|
if (mFilePathCallback == null && mFilePathCallbackLegacy == null) {
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
package kr.co.bootpay.webview;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.content.Intent;
|
|
5
|
+
import android.content.pm.PackageManager;
|
|
6
|
+
import android.net.Uri;
|
|
7
|
+
import android.webkit.WebView;
|
|
8
|
+
import android.util.Log;
|
|
9
|
+
|
|
10
|
+
import java.net.URISyntaxException;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
public class BootpayUrlHelper {
|
|
14
|
+
public static boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
15
|
+
Intent intent = getIntentWithPackage(url);
|
|
16
|
+
Context context = view.getContext();
|
|
17
|
+
|
|
18
|
+
Log.i("bootpay", "doDeepLinkIfPayUrl: " + url);
|
|
19
|
+
|
|
20
|
+
if(isIntent(url)) {
|
|
21
|
+
Log.i("isIntent", "isInstallApp called");
|
|
22
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
23
|
+
else return startGooglePlay(intent, context);
|
|
24
|
+
} else if(isMarket(url)) {
|
|
25
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
26
|
+
else return startGooglePlay(intent, context);
|
|
27
|
+
} else if(isSpecialCase(url)) {
|
|
28
|
+
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
29
|
+
else return startGooglePlay(intent, context);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// return url.contains("vguardend");
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public static Boolean isSpecialCase(String url) {
|
|
37
|
+
return url.matches("^shinhan\\S+$")
|
|
38
|
+
|| url.startsWith("kftc-bankpay://")
|
|
39
|
+
|| url.startsWith("v3mobileplusweb://")
|
|
40
|
+
|| url.startsWith("hdcardappcardansimclick://")
|
|
41
|
+
|| url.startsWith("nidlogin://")
|
|
42
|
+
|| url.startsWith("mpocket.online.ansimclick://")
|
|
43
|
+
|| url.startsWith("wooripay://")
|
|
44
|
+
|| url.startsWith("ispmobile://")
|
|
45
|
+
|| url.startsWith("kakaotalk://");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static Boolean isIntent(String url) {
|
|
49
|
+
Log.d(
|
|
50
|
+
"bootpay",
|
|
51
|
+
String.format("url %s: %s.", url, url.startsWith("intent:"))
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
return url.startsWith("intent:");
|
|
56
|
+
}
|
|
57
|
+
public static Boolean isMarket(String url) {
|
|
58
|
+
return url.startsWith("market://");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
public static Intent getIntentWithPackage(String url) {
|
|
63
|
+
try {
|
|
64
|
+
Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
|
|
65
|
+
if(intent.getPackage() == null) {
|
|
66
|
+
if (url == null) return intent;
|
|
67
|
+
if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
|
|
68
|
+
else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay.android");
|
|
69
|
+
else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
|
|
70
|
+
else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
|
|
71
|
+
else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
|
|
72
|
+
else if (url.startsWith("mpocket.online.ansimclick")) intent.setPackage("kr.co.samsungcard.mpocket");
|
|
73
|
+
else if (url.startsWith("lotteappcard")) intent.setPackage("com.lcacApp");
|
|
74
|
+
else if (url.startsWith("cloudpay")) intent.setPackage("com.hanaskcard.paycla");
|
|
75
|
+
else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
|
|
76
|
+
else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
|
|
77
|
+
else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
|
|
78
|
+
// kvp.jjy.MispAndroid320
|
|
79
|
+
}
|
|
80
|
+
return intent;
|
|
81
|
+
} catch (URISyntaxException e) {
|
|
82
|
+
e.printStackTrace();
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public static boolean isInstallApp(Intent intent, Context context) {
|
|
88
|
+
if (intent == null) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
String packageName = intent.getPackage();
|
|
92
|
+
if (packageName == null) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
PackageManager packageManager = context.getPackageManager();
|
|
97
|
+
Intent launchIntent = packageManager.getLaunchIntentForPackage(packageName);
|
|
98
|
+
boolean isInstalled = launchIntent != null;
|
|
99
|
+
return isInstalled;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
public static boolean startApp(Intent intent, Context context) {
|
|
106
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
107
|
+
context.startActivity(intent);
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public static boolean startGooglePlay(Intent intent, Context context) {
|
|
112
|
+
final String appPackageName = intent.getPackage();
|
|
113
|
+
|
|
114
|
+
if(appPackageName == null) {
|
|
115
|
+
Uri dataUri = intent.getData();
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, intent.getData());
|
|
119
|
+
context.startActivity(addIntent);
|
|
120
|
+
} catch (Exception e) {
|
|
121
|
+
String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
|
|
122
|
+
if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
|
|
123
|
+
|
|
124
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName));
|
|
125
|
+
context.startActivity(addIntent);
|
|
126
|
+
}
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName));
|
|
131
|
+
context.startActivity(addIntent);
|
|
132
|
+
} catch (android.content.ActivityNotFoundException anfe) {
|
|
133
|
+
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName));
|
|
134
|
+
context.startActivity(addIntent);
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -29,6 +29,16 @@ public class BPCWebViewModule extends NativeBPCWebViewModuleSpec {
|
|
|
29
29
|
mBPCWebViewModuleImpl.shouldStartLoadWithLockIdentifier(shouldStart, lockIdentifier);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
@Override
|
|
33
|
+
public void warmUp() {
|
|
34
|
+
mBPCWebViewModuleImpl.warmUp();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Override
|
|
38
|
+
public void releaseWarmUp() {
|
|
39
|
+
mBPCWebViewModuleImpl.releaseWarmUp();
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
public void startPhotoPickerIntent(ValueCallback<Uri> filePathCallback, String acceptType) {
|
|
33
43
|
mBPCWebViewModuleImpl.startPhotoPickerIntent(acceptType, filePathCallback);
|
|
34
44
|
}
|
|
@@ -31,6 +31,16 @@ public class BPCWebViewModule extends ReactContextBaseJavaModule {
|
|
|
31
31
|
mBPCWebViewModuleImpl.shouldStartLoadWithLockIdentifier(shouldStart, lockIdentifier);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
@ReactMethod
|
|
35
|
+
public void warmUp() {
|
|
36
|
+
mBPCWebViewModuleImpl.warmUp();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@ReactMethod
|
|
40
|
+
public void releaseWarmUp() {
|
|
41
|
+
mBPCWebViewModuleImpl.releaseWarmUp();
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
public void startPhotoPickerIntent(ValueCallback<Uri> filePathCallback, String acceptType) {
|
|
35
45
|
mBPCWebViewModuleImpl.startPhotoPickerIntent(acceptType, filePathCallback);
|
|
36
46
|
}
|
|
@@ -12,4 +12,17 @@
|
|
|
12
12
|
+ (instancetype) sharedManager;
|
|
13
13
|
- (WKProcessPool *)sharedProcessPool;
|
|
14
14
|
|
|
15
|
+
/// WebView 프로세스를 미리 초기화하여 첫 결제 화면 로딩 속도를 개선합니다.
|
|
16
|
+
/// @param delay 프리워밍 시작 전 대기 시간 (초). 기본값 0.1초. UI가 느려지면 0.5~1.0으로 늘려보세요.
|
|
17
|
+
- (void)warmUpWithDelay:(NSTimeInterval)delay;
|
|
18
|
+
|
|
19
|
+
/// 기본 딜레이(0.1초)로 프리워밍을 시작합니다.
|
|
20
|
+
- (void)warmUp;
|
|
21
|
+
|
|
22
|
+
/// 프리워밍된 WebView 리소스를 해제합니다.
|
|
23
|
+
- (void)releaseWarmUp;
|
|
24
|
+
|
|
25
|
+
/// 프리워밍 완료 여부를 확인합니다.
|
|
26
|
+
@property (nonatomic, readonly) BOOL isWarmedUp;
|
|
27
|
+
|
|
15
28
|
@end
|
|
@@ -10,9 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
@interface BPCWKProcessPoolManager() {
|
|
12
12
|
WKProcessPool *_sharedProcessPool;
|
|
13
|
+
WKWebView *_prewarmedWebView;
|
|
14
|
+
BOOL _isWarmUpComplete;
|
|
13
15
|
}
|
|
14
16
|
@end
|
|
15
17
|
|
|
18
|
+
/// 프리워밍용 최소 HTML (GPU/WebContent/Networking 프로세스 초기화 트리거)
|
|
19
|
+
static NSString *const kWarmUpHTML = @"<!DOCTYPE html><html><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"></head><body><canvas id=\"c\" width=\"1\" height=\"1\"></canvas><script>var c=document.getElementById('c').getContext('2d');c.fillRect(0,0,1,1);fetch('https://webview.bootpay.co.kr/health',{mode:'no-cors'}).catch(function(){});</script></body></html>";
|
|
20
|
+
|
|
16
21
|
@implementation BPCWKProcessPoolManager
|
|
17
22
|
|
|
18
23
|
+ (id) sharedManager {
|
|
@@ -32,5 +37,43 @@
|
|
|
32
37
|
return _sharedProcessPool;
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
- (void)warmUp {
|
|
41
|
+
[self warmUpWithDelay:0.1];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- (void)warmUpWithDelay:(NSTimeInterval)delay {
|
|
45
|
+
if (_prewarmedWebView != nil) return;
|
|
46
|
+
|
|
47
|
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
48
|
+
if (self->_prewarmedWebView == nil) {
|
|
49
|
+
WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
|
|
50
|
+
config.processPool = [self sharedProcessPool];
|
|
51
|
+
|
|
52
|
+
// WebView 생성 - GPU/WebContent 프로세스 시작
|
|
53
|
+
self->_prewarmedWebView = [[WKWebView alloc] initWithFrame:CGRectMake(0, 0, 1, 1) configuration:config];
|
|
54
|
+
|
|
55
|
+
// 실제 렌더링 + 네트워크 요청으로 모든 프로세스 초기화
|
|
56
|
+
[self->_prewarmedWebView loadHTMLString:kWarmUpHTML baseURL:[NSURL URLWithString:@"https://webview.bootpay.co.kr"]];
|
|
57
|
+
|
|
58
|
+
self->_isWarmUpComplete = YES;
|
|
59
|
+
|
|
60
|
+
#ifdef DEBUG
|
|
61
|
+
NSLog(@"[Bootpay] warmUp started - WebView processes initializing...");
|
|
62
|
+
#endif
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
- (void)releaseWarmUp {
|
|
68
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
69
|
+
self->_prewarmedWebView = nil;
|
|
70
|
+
self->_isWarmUpComplete = NO;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
- (BOOL)isWarmedUp {
|
|
75
|
+
return _isWarmUpComplete && _prewarmedWebView != nil;
|
|
76
|
+
}
|
|
77
|
+
|
|
35
78
|
@end
|
|
36
79
|
|
package/apple/BPCWebView.mm
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
using namespace facebook::react;
|
|
14
14
|
|
|
15
|
-
auto
|
|
15
|
+
auto BPCStringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string value) {
|
|
16
16
|
if (value == "click") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Click;
|
|
17
17
|
if (value == "formsubmit") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Formsubmit;
|
|
18
18
|
if (value == "backforward") return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Backforward;
|
|
@@ -21,7 +21,7 @@ auto bootpayStringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string v
|
|
|
21
21
|
return BPCWebViewEventEmitter::OnShouldStartLoadWithRequestNavigationType::Other;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
auto
|
|
24
|
+
auto BPCStringToOnLoadingStartNavigationTypeEnum(std::string value) {
|
|
25
25
|
if (value == "click") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Click;
|
|
26
26
|
if (value == "formsubmit") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Formsubmit;
|
|
27
27
|
if (value == "backforward") return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Backforward;
|
|
@@ -30,7 +30,7 @@ auto bootpayStringToOnLoadingStartNavigationTypeEnum(std::string value) {
|
|
|
30
30
|
return BPCWebViewEventEmitter::OnLoadingStartNavigationType::Other;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
auto
|
|
33
|
+
auto BPCStringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
34
34
|
if (value == "click") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Click;
|
|
35
35
|
if (value == "formsubmit") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Formsubmit;
|
|
36
36
|
if (value == "backforward") return BPCWebViewEventEmitter::OnLoadingFinishNavigationType::Backforward;
|
|
@@ -81,7 +81,7 @@ auto bootpayStringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
81
81
|
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
82
82
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
83
83
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
84
|
-
.navigationType =
|
|
84
|
+
.navigationType = BPCStringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
|
|
85
85
|
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
86
86
|
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoForward"] boolValue]),
|
|
87
87
|
.isTopFrame = static_cast<bool>([[dictionary valueForKey:@"isTopFrame"] boolValue]),
|
|
@@ -98,7 +98,7 @@ auto bootpayStringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
98
98
|
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
99
99
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
100
100
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
101
|
-
.navigationType =
|
|
101
|
+
.navigationType = BPCStringToOnLoadingStartNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
|
|
102
102
|
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
103
103
|
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoForward"] boolValue]),
|
|
104
104
|
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
|
@@ -146,7 +146,7 @@ auto bootpayStringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
146
146
|
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
147
147
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
148
148
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
149
|
-
.navigationType =
|
|
149
|
+
.navigationType = BPCStringToOnLoadingFinishNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String], [[dictionary valueForKey:@"navigationType"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])),
|
|
150
150
|
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
151
151
|
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoForward"] boolValue]),
|
|
152
152
|
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
package/apple/BPCWebViewImpl.h
CHANGED
|
@@ -36,7 +36,7 @@ shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
|
|
|
36
36
|
|
|
37
37
|
@end
|
|
38
38
|
|
|
39
|
-
@interface
|
|
39
|
+
@interface BPCWeakScriptMessageDelegate : NSObject<WKScriptMessageHandler>
|
|
40
40
|
|
|
41
41
|
@property (nonatomic, weak, nullable) id<WKScriptMessageHandler> scriptDelegate;
|
|
42
42
|
|