问题
I'm trying to send an email with deep linking to my iOS app, using myapp:// format to open it up from email. It works (i.e. tapping on it opens the app) in any iOS mail client (Mail, Mailbox, etc.) but not in Gmail app (or even web), that strips it out leaving text only. Does anyone has a solution/alternative beside creating a web link that redirects then from browser to app?
回答1:
Nope, unfortunately Gmail detects non-http/https protocols in links and strips the anchor () tag (so using data: or javascript: to perform a redirect is out too).
If/When Google implements Actions on Gmail for iOS/Android, those may work (https://developers.google.com/gmail/actions/actions/actions-overview), but as of now, they are not rendered on native mobile clients.
回答2:
You can create a server with a regular endpoint that will redirect to the "special" myapp://
link.
If you are running Node + Express, here's an example of a middleware that does exactly that:
https://github.com/mderazon/node-deeplink
来源:https://stackoverflow.com/questions/23575553/ios-deep-linking-is-stripped-out-in-gmail