简体   繁体   中英

Prevent IOS/Safari From Opening App From Link

I have an application that has an IOS app and a web app.

When a user forgets their password, they get an email with this link:

https://my.domain.com/SetPassword/?code=some_code_here

The IOS app has this domain also tied into its settings ( deep linking domain permission stuff) and when users click this link in their email on their IOS device , it opens the app - not the web page to reset their password .

Is there a way to prevent this? Open the webpage in a browser, not the app?

Adding the target="_blank" does not work.

here is the source <a> in the email: (formatted for readability)

<a style="color:#c5534d;
font-family:verdana,sans-serif;
font-size:12px;
font-weight:bold"
href="https://my.domain.com/SetPassword/?code=some_code_here_test_1"
target="_blank" 
data-saferedirecturl="https://www.google.com/url?q=https://my.domain.com/SetPassword/?code=some_code_here_test_1">
     https://my.domain.com/SetPassword
</a>

To fix this, I had to add a apple-app-site-association file and make this route exclusive to NOT open to the mobile app.

I had to include "NOT /myroute/*" to the paths array. The NOT prevents this route from opening the app.

The file for me looks something like this:

{
    "applinks": {
        "apps": [],
        "details": [
            {
                "appID": "62AGA19JEA.com.domain.subhost",
                "paths": [
                    "*",
                    "NOT /SetPassword/*"
                ]
            }
        ]
    }
}

Documentation: https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM