Skip to content

Commit 451c3cf

Browse files
authored
fix(android): openUrl (#10161)
1 parent 5b6e4d6 commit 451c3cf

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎packages/core/utils/index.android.ts‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,11 @@ export function openUrl(location: string): boolean {
2222
const context = ad.getApplicationContext();
2323
try {
2424
const intent = new android.content.Intent(android.content.Intent.ACTION_VIEW, android.net.Uri.parse(location.trim()));
25-
const packageManager = context.getPackageManager();
26-
2725
intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
28-
29-
// Handle schemes like mailto, tel, etc
30-
if (intent.resolveActivity(packageManager) == null) {
31-
Trace.write('Unable to open ' + location + '. Make sure to add queries element(https://developer.android.com/guide/topics/manifest/queries-element) matching the scheme to the AndroidManifest.xml file.', Trace.categories.Error, Trace.messageType.error);
32-
return false;
33-
}
34-
3526
context.startActivity(intent);
3627
} catch (e) {
37-
// We Don't do anything with an error. We just output it
38-
Trace.write('Error in OpenURL', Trace.categories.Error, Trace.messageType.error);
28+
// We don't do anything with an error. We just output it
29+
Trace.write(`Failed to start activity for handling URL: ${location}`, Trace.categories.Error, Trace.messageType.error);
3930

4031
return false;
4132
}

0 commit comments

Comments
 (0)