From 890673d8ac437088d6e50218a85c3c2ead01e17c Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 2 Sep 2021 11:22:42 -0700 Subject: [PATCH] Avoid opening iOS --- src/open/OpenLinkViewModel.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/open/OpenLinkViewModel.js b/src/open/OpenLinkViewModel.js index d2fefe6..c8d65a3 100644 --- a/src/open/OpenLinkViewModel.js +++ b/src/open/OpenLinkViewModel.js @@ -23,6 +23,7 @@ import {ServerConsentViewModel} from "./ServerConsentViewModel.js"; import {getLabelForLinkKind} from "../Link.js"; import {orderedUnique} from "../utils/unique.js"; import {getMatchingPlatforms, selectPlatforms} from "./clients/index.js"; +import {Platform} from "../Platform.js"; export class OpenLinkViewModel extends ViewModel { constructor(options) { @@ -59,6 +60,11 @@ export class OpenLinkViewModel extends ViewModel { // Client doesn't support deep links. We can't open it. return false; } + } else { + if (this.platforms.includes(Platform.iOS)) { + // Do not try to auto-open links on iOS because of the scary warning. + return false; + } } this.openDefaultViewModel = new AutoOpenViewModel(this.childOptions({ client,