问题
Fairly specific here; I'm wanting to open a new blank text message to a particular phone number in a web app on iOS. I need this link in a Bootstrap popover. (Ref - https://getbootstrap.com/docs/4.0/components/popovers/)
The following SMS link works on iOS inside a popover (with Bootstrap 4.1.3) and has done what I want in web app mode on iOS:
<a href='#' onclick='window.open(`sms:1112225555`, `_self`);'>Link</a>
But I'd like to upgrade to the latest Bootstrap (4.4.1) which sanitizes popover contents, and for some reason a "normal" basic link does not open a new SMS text/iMessage on iOS:
When I test the following link on iOS 13.2.3, I get the following message...
<a href='sms:1112225555'>Link</a>
Safari cannot open the page because it cannot redirect to locations starting with "sms:".
You'd think this should be REALLY simple... https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/SMSLinks/SMSLinks.html
But it seems to hate the web-app mode...
Has anyone else found a workaround without using Javascript to open SMS links from within web app mode?
Note: <a href='sms:1112225555' target='_self'>Link</a> or <a href='sms:1112225555' target='_top'>Link</a> don't work either.
来源:https://stackoverflow.com/questions/59256976/opening-new-sms-on-ios-in-web-app-mode-with-html5-link-from-within-bootstrap-pop