react-native-webview-bootpay 13.8.3 → 13.8.41
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.
|
@@ -34,6 +34,12 @@ import kr.co.bootpay.webview.events.TopShouldStartLoadWithRequestEvent;
|
|
|
34
34
|
|
|
35
35
|
import java.util.concurrent.atomic.AtomicReference;
|
|
36
36
|
|
|
37
|
+
|
|
38
|
+
import android.app.AlertDialog;
|
|
39
|
+
import android.content.DialogInterface;
|
|
40
|
+
import android.content.Intent;
|
|
41
|
+
import android.widget.Toast;
|
|
42
|
+
|
|
37
43
|
public class BPCWebViewClient extends WebViewClient {
|
|
38
44
|
private static String TAG = "BPCWebViewClient";
|
|
39
45
|
protected static final int SHOULD_OVERRIDE_URL_LOADING_TIMEOUT = 250;
|
|
@@ -213,6 +219,37 @@ public class BPCWebViewClient extends WebViewClient {
|
|
|
213
219
|
description,
|
|
214
220
|
failingUrl
|
|
215
221
|
);
|
|
222
|
+
alertSSLError(webView, handler, error);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
void alertSSLError(WebView view, SslErrorHandler handler, SslError error) {
|
|
226
|
+
// for SSLErrorHandler
|
|
227
|
+
AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext());
|
|
228
|
+
builder.setTitle("SSL Connection Error");
|
|
229
|
+
builder.setMessage("Your device's Android version is outdated and may not securely connect to our service. To continue using the app securely, please update your device's operating system. If you choose to proceed without updating, it may expose you to security vulnerabilities.");
|
|
230
|
+
builder.setPositiveButton("Update", new DialogInterface.OnClickListener() {
|
|
231
|
+
@Override
|
|
232
|
+
public void onClick(DialogInterface dialog, int which) {
|
|
233
|
+
// Redirect the user to the system update settings
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
Intent intent = new Intent("android.settings.SYSTEM_UPDATE_SETTINGS");
|
|
237
|
+
if (intent.resolveActivity(view.getContext().getPackageManager()) != null) {
|
|
238
|
+
view.getContext().startActivity(intent);
|
|
239
|
+
} else {
|
|
240
|
+
// If the device does not support system update settings intent
|
|
241
|
+
Toast.makeText(view.getContext(), "System update option not available. Please check your device settings manually.", Toast.LENGTH_LONG).show();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
builder.setNeutralButton("Cancel", new DialogInterface.OnClickListener() {
|
|
246
|
+
@Override
|
|
247
|
+
public void onClick(DialogInterface dialog, int which) {
|
|
248
|
+
handler.cancel();
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
AlertDialog dialog = builder.create();
|
|
252
|
+
dialog.show();
|
|
216
253
|
}
|
|
217
254
|
|
|
218
255
|
@Override
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Thibault Malbranche <malbranche.thibault@gmail.com>"
|
|
12
12
|
],
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "13.8.
|
|
14
|
+
"version": "13.8.41",
|
|
15
15
|
"homepage": "https://github.com/bootpay/react-native-webview-bootpay",
|
|
16
16
|
"scripts": {
|
|
17
17
|
"android": "react-native run-android",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"test:windows": "yarn jest --setupFiles=./jest-setups/jest.setup.js",
|
|
29
29
|
"add:macos": "yarn add react-native-macos@0.73.17"
|
|
30
30
|
},
|
|
31
|
-
|
|
32
31
|
"rn-docs": {
|
|
33
32
|
"title": "Webview",
|
|
34
33
|
"type": "Component"
|
|
@@ -89,11 +88,6 @@
|
|
|
89
88
|
"react-native-webview-bootpay.podspec",
|
|
90
89
|
"react-native.config.js"
|
|
91
90
|
],
|
|
92
|
-
"resolutions": {
|
|
93
|
-
"@react-native-community/cli": "10.2.4",
|
|
94
|
-
"@react-native-community/cli-platform-android": "10.2.0",
|
|
95
|
-
"@react-native-community/cli-platform-ios": "10.2.4"
|
|
96
|
-
},
|
|
97
91
|
"codegenConfig": {
|
|
98
92
|
"name": "BPCWebViewSpec",
|
|
99
93
|
"type": "all",
|