PWA iOS 收到短信:打开 iMessage 的标签 [英] PWA iOS getting the sms: tag to open iMessage

查看:77
本文介绍了PWA iOS 收到短信:打开 iMessage 的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们目前正在为我们的客户开发 PWA.一切都进展顺利,但在 iPhone (iOS 12.2) 上测试时,我们遇到了带有 sms:123-456-7890 标签的 href 标签问题.您收到由于 sms: 标签,Safari 无法打开此页面"(释义).

We are currently developing a PWA for a client of ours. Everything has been going well, but while testing on iPhone (iOS 12.2) we are having an issue with the tags that have sms:123-456-7890 in the href. You get the "Safari cannot open this page because of the sms: tag" (paraphrasing).

如果您通过 Safari 浏览网站(而不是在 PWA 模式下),锚标签可以正常工作,并且您的 iMessage 会打开并显示其中的数字.但是,当您处于 PWA 模式并单击链接时,您会收到我上面提到的消息的一个版本.

If you are browsing the site via Safari (not in the PWA mode), the anchor tag works fine and your iMessage opens up with the number in it. But when you're in the PWA mode and click the link, you get a version of the message I mentioned above.

从研究来看,这似乎是 iOS 12.2 版本中的某种错误,尽管没有正式提及.

From doing research, this appears to be some sort of bug in the iOS 12.2 release, though not officially mentioned.

我很好奇是否有人有幸解决此问题?

I'm curious if anyone has had any luck with a work-around for this issue?

提前致谢.

编辑...为锚标记添加一些代码....

Edit..to add some code for the anchor tag....

<a href="sms://1234567890;">123-456-7890</a>

我尝试了许多不同的 sms 变体(没有//或 ;),当点击它作为 PWA 时总是相同的结果.使用 Android,在 PWA 模式下一切正常.

I've tried many different variations of the sms (with no // or ;), always same outcome when clicking it as a PWA. With Android, everything works fine in PWA mode.

推荐答案

我确实找到了使用 JavaScript 的解决方法

I did find a workaround by using JavaScript

代码示例:

<a href="#" onclick="openSMSMobile();" >

function openSMSMobile(e) {           
        window.open('sms:1234567890', '_self');
        return false;
    }

这篇关于PWA iOS 收到短信:打开 iMessage 的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆