-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payment OR Data link open in system browser for the supported android 13 new changes Added. #1001
base: master
Are you sure you want to change the base?
Conversation
The code supported Android API levels of more than 13 also the Google Pixel 7 pro for the capacitor user. also Cordova .
Hi, all this code is perfectly working for payment links Or data links open in system browser support for Android 13. try { |
@@ -454,20 +454,46 @@ private HashMap<String, String> parseFeature(String optString) { | |||
*/ | |||
public String openExternal(String url) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try {
Uri uri = Uri.parse(url);
String scheme = uri.getScheme();
Intent intent = null;
intent = "data".equals(scheme)
? Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_BROWSER)
: new Intent(Intent.ACTION_VIEW);
if ("file".equals(scheme)) {
intent.setDataAndType(uri, webView.getResourceApi().getMimeType(uri));
} else {
intent.setData(uri);
}
// intent.setPackage("com.android.chrome"); // Specify the package name of Chrome
PackageManager packageManager = cordova.getActivity().getPackageManager();
List resolveInfoList = packageManager.queryIntentActivities(intent, 0);
if (resolveInfoList.size() > 0) {
cordova.getActivity().startActivity(Intent.createChooser(intent, "com.android.chrome"));
} else {
// Chrome is not installed,
intent.setPackage(null);
cordova.getActivity().startActivity(Intent.createChooser(intent, "com.android.chrome"));
}
return "";
} catch (Exception e) {
LOG.d(LOG_TAG, "InAppBrowser: Error loading url " + url + ": " + e.toString());
return e.toString();
}
The code supported Android API levels of more than 13 also the Google Pixel 7 pro for the capacitor user. also Cordova .
Platforms affected
Motivation and Context
Description
Testing
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)