Opening new SMS on iOS in web app mode with HTML5 link from within Bootstrap popup

时间秒杀一切 提交于 2019-12-24 19:26:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!