react-native-webview-bootpay 13.8.41 → 13.13.4-4.alpha.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 +53 -69
- package/android/build.gradle +1 -11
- package/android/gradle.properties +5 -47
- package/android/src/main/AndroidManifest.xml +9 -5
- package/android/src/main/AndroidManifestNew.xml +97 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +57 -11
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +101 -68
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +70 -56
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +119 -65
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewMessagingModule.kt +9 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +1 -1
- package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +91 -75
- package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewManager.java +118 -109
- package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewModule.java +1 -1
- package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewManager.java +63 -58
- package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewModule.java +1 -1
- package/apple/BPCWebView.mm +21 -12
- package/apple/BPCWebViewImpl.h +10 -0
- package/apple/BPCWebViewImpl.m +267 -205
- package/apple/BPCWebViewManager.mm +5 -24
- package/apple/BPCWebViewModule.h +23 -0
- package/apple/BPCWebViewModule.mm +34 -0
- package/apple/RCTConvert+WKDataDetectorTypes.h +11 -0
- package/apple/RCTConvert+WKDataDetectorTypes.m +27 -0
- package/index.d.ts +54 -48
- package/ios/RNCWebView.xcodeproj/project.pbxproj +24 -24
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/taesupyoon.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNCWebView.xcodeproj/xcuserdata/taesupyoon.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/BPCWebViewNativeComponent.d.ts +24 -25
- package/lib/BPCWebViewNativeComponent.js +1 -1
- package/lib/{NativeBPCWebView.d.ts → NativeBPCWebViewModule.d.ts} +2 -5
- package/lib/{NativeBPCWebView.js → NativeBPCWebViewModule.js} +1 -1
- package/lib/WebView.android.d.ts +0 -1
- package/lib/WebView.android.js +1 -1
- package/lib/WebView.d.ts +0 -1
- package/lib/WebView.ios.d.ts +0 -1
- package/lib/WebView.ios.js +1 -1
- package/lib/WebView.js +1 -1
- package/lib/WebView.macos.d.ts +0 -1
- package/lib/WebView.macos.js +1 -1
- package/lib/WebView.styles.d.ts +37 -11
- package/lib/WebView.styles.js +1 -1
- package/lib/WebView.windows.d.ts +0 -1
- package/lib/WebView.windows.js +1 -1
- package/lib/WebViewNativeComponent.macos.d.ts +1 -2
- package/lib/WebViewNativeComponent.windows.d.ts +1 -2
- package/lib/WebViewShared.d.ts +0 -1
- package/lib/WebViewShared.js +1 -1
- package/lib/WebViewTypes.d.ts +51 -3
- package/lib/WebViewTypes.js +1 -1
- package/lib/index.d.ts +0 -1
- package/macos/RNCWebView.xcodeproj/project.pbxproj +36 -36
- package/package.json +12 -11
- package/react-native-webview-bootpay.podspec +2 -2
- package/react-native.config.js +1 -5
- package/src/BPCWebViewNativeComponent.ts +143 -79
- package/src/NativeBPCWebViewModule.ts +13 -0
- package/src/WebView.android.tsx +295 -190
- package/src/WebView.ios.tsx +253 -186
- package/src/WebView.macos.tsx +220 -152
- package/src/WebView.styles.ts +9 -12
- package/src/WebView.tsx +14 -7
- package/src/WebView.windows.tsx +180 -126
- package/src/WebViewNativeComponent.macos.ts +4 -5
- package/src/WebViewNativeComponent.windows.ts +6 -8
- package/src/WebViewShared.tsx +139 -91
- package/src/WebViewTypes.ts +80 -35
- package/src/__tests__/WebViewShared-test.js +170 -55
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +8 -17
- package/windows/ReactNativeWebView/ReactPackageProvider.cpp +5 -1
- package/windows/ReactNativeWebView/ReactWebView.cpp +73 -6
- package/windows/ReactNativeWebView/ReactWebView.h +11 -1
- package/windows/ReactNativeWebView/ReactWebView.idl +12 -3
- package/windows/ReactNativeWebView/ReactWebView2.cpp +294 -129
- package/windows/ReactNativeWebView/ReactWebView2.h +42 -5
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +60 -34
- package/windows/ReactNativeWebView/ReactWebView2Manager.h +4 -4
- package/windows/ReactNativeWebView/ReactWebViewHelpers.cpp +70 -0
- package/windows/ReactNativeWebView/ReactWebViewHelpers.h +16 -0
- package/windows/ReactNativeWebView/ReactWebViewManager.cpp +22 -3
- package/windows/ReactNativeWebView/ReactWebViewManager.h +6 -1
- package/windows/ReactNativeWebView/pch.h +11 -7
- package/windows/ReactNativeWebView.sln +14 -14
- package/ios/main.jsbundle +0 -457
- package/lib/BPCWebViewNativeComponent.d.ts.map +0 -1
- package/lib/NativeBPCWebView.d.ts.map +0 -1
- package/lib/WebView.android.d.ts.map +0 -1
- package/lib/WebView.d.ts.map +0 -1
- package/lib/WebView.ios.d.ts.map +0 -1
- package/lib/WebView.macos.d.ts.map +0 -1
- package/lib/WebView.styles.d.ts.map +0 -1
- package/lib/WebView.windows.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
- package/lib/WebViewShared.d.ts.map +0 -1
- package/lib/WebViewTypes.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/src/NativeBPCWebView.ts +0 -14
- package/windows/ReactNativeWebView/packages.config +0 -5
- /package/android/src/main/java/kr/co/bootpay/webview/{BPCWebviewWrapper.kt → BPCWebViewWrapper.kt} +0 -0
|
@@ -5,43 +5,54 @@ import android.content.Intent;
|
|
|
5
5
|
import android.content.pm.PackageManager;
|
|
6
6
|
import android.net.Uri;
|
|
7
7
|
import android.webkit.WebView;
|
|
8
|
+
import android.util.Log;
|
|
8
9
|
|
|
9
10
|
import java.net.URISyntaxException;
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
public class BootpayUrlHelper {
|
|
13
14
|
public static boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
public static Boolean isSpecialCase(String url) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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://");
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
public static Boolean isIntent(String url) {
|
|
44
|
-
|
|
49
|
+
Log.d(
|
|
50
|
+
"bootpay",
|
|
51
|
+
String.format("url %s: %s.", url, url.startsWith("intent:"))
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
return url.startsWith("intent:");
|
|
45
56
|
}
|
|
46
57
|
public static Boolean isMarket(String url) {
|
|
47
58
|
return url.startsWith("market://");
|
|
@@ -49,47 +60,47 @@ public class BootpayUrlHelper {
|
|
|
49
60
|
|
|
50
61
|
|
|
51
62
|
public static Intent getIntentWithPackage(String url) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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");
|
|
67
78
|
// kvp.jjy.MispAndroid320
|
|
68
|
-
}
|
|
69
|
-
return intent;
|
|
70
|
-
} catch (URISyntaxException e) {
|
|
71
|
-
e.printStackTrace();
|
|
72
|
-
return null;
|
|
73
79
|
}
|
|
80
|
+
return intent;
|
|
81
|
+
} catch (URISyntaxException e) {
|
|
82
|
+
e.printStackTrace();
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
74
85
|
}
|
|
75
86
|
|
|
76
|
-
public static boolean isInstallApp(Intent intent, Context context) {
|
|
77
|
-
|
|
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;
|
|
78
100
|
}
|
|
79
101
|
|
|
80
102
|
|
|
81
|
-
private static boolean isExistPackageInfo(Intent intent, Context context) {
|
|
82
|
-
try {
|
|
83
|
-
return intent != null && context.getPackageManager().getPackageInfo(intent.getPackage(), PackageManager.GET_ACTIVITIES) != null;
|
|
84
|
-
} catch (PackageManager.NameNotFoundException e) {
|
|
85
|
-
e.printStackTrace();
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
103
|
|
|
90
|
-
private static boolean isExistLaunchedIntent(Intent intent, Context context) {
|
|
91
|
-
return intent != null && intent.getPackage() != null && context.getPackageManager().getLaunchIntentForPackage(intent.getPackage()) != null;
|
|
92
|
-
}
|
|
93
104
|
|
|
94
105
|
public static boolean startApp(Intent intent, Context context) {
|
|
95
106
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
@@ -98,25 +109,30 @@ public class BootpayUrlHelper {
|
|
|
98
109
|
}
|
|
99
110
|
|
|
100
111
|
public static boolean startGooglePlay(Intent intent, Context context) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
context.startActivity(new Intent(Intent.ACTION_VIEW, intent.getData()));
|
|
107
|
-
} catch (Exception e) {
|
|
108
|
-
String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
|
|
109
|
-
if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
|
|
110
|
-
|
|
111
|
-
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName)));
|
|
112
|
-
}
|
|
113
|
-
return true;
|
|
114
|
-
}
|
|
112
|
+
final String appPackageName = intent.getPackage();
|
|
113
|
+
|
|
114
|
+
if(appPackageName == null) {
|
|
115
|
+
Uri dataUri = intent.getData();
|
|
116
|
+
|
|
115
117
|
try {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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);
|
|
119
126
|
}
|
|
120
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;
|
|
121
137
|
}
|
|
122
138
|
}
|