Skip to content
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

Mobile 4602 #4143

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/core/initializers/prepare-inapp-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { CoreSiteError } from '@classes/errors/siteerror';
import { CoreLoginHelper } from '@features/login/services/login-helper';
import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config';
import { CoreUserNullSupportConfig } from '@features/user/classes/support/null-support-config';
import { CorePlatform } from '@services/platform';
import { CoreSites } from '@services/sites';
import { CoreCustomURLSchemes } from '@services/urlschemes';
import { CoreDomUtils } from '@services/utils/dom';
Expand Down Expand Up @@ -62,11 +61,6 @@ export default function(): void {
return;
}

if (!CorePlatform.isAndroid()) {
return;
}

// Check if the URL has a custom URL scheme. In Android they need to be opened manually.
if (!isExternalApp) {
lastInAppUrl = protocol ? `${protocol}://${url}` : url;

Expand All @@ -76,8 +70,8 @@ export default function(): void {
// Open in browser should launch the right app if found and do nothing if not found.
CoreUtils.openInBrowser(url, { showBrowserWarning: false });

// At this point the InAppBrowser is showing a "Webpage not available" error message.
// Try to navigate to last loaded URL so this error message isn't found.
// At this point, URL schemes will stop working in IAB, and in Android the IAB is showing a "Webpage not available" error.
// Re-loading the page inside the existing IAB doesn't fix it, we need to re-load the whole IAB.
if (lastInAppUrl) {
CoreUtils.openInApp(lastInAppUrl);
} else {
Expand Down
2 changes: 0 additions & 2 deletions src/core/services/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,6 @@ export class CoreUtilsProvider {

this.setInAppBrowserToolbarColors(options);

this.iabInstance?.close(); // Close window if there is one already open, only allow one.

this.iabInstance = InAppBrowser.create(url, '_blank', options);

if (CorePlatform.isMobile()) {
Expand Down