【问题标题】:Autofill SMS message in Phonegap/Cordova iOS and Android在 Phonegap/Cordova iOS 和 Android 中自动填充 SMS 消息
【发布时间】:2014-12-14 00:30:27
【问题描述】:

有没有办法在 iOS 和 Android 上使用 Phonegap 或 Cordova 自动发送短信?如果没有,有没有办法在本机应用程序中预先填写文本消息,以便用户确认要发送的消息?

【问题讨论】:

    标签: android ios cordova sms


    【解决方案1】:

    sms: 架构

    安卓: sms:+123456789?body=hello there

    iOS != 7: sms:+123456789;body=hello there

    iOS = 7: sms:+123456789 - 支持正文

    您可以使用链接或javascript location:

    <a href="sms:+123456789?body=hello there">Send SMS</a>
    window.location = "sms:+123456789?body=" + encodeURIComponent("hello there");
    

    默认短信应用已打开并预填充了提供的数据。


    Cordova 插件

    一些例子:

    未测试

    9.3.2015 使用 iOS 8 编辑

    【讨论】:

    • 有人查过iOS 8 支持正文吗?正文预填充很重要
    • 仍然有 iOS 7,抱歉。
    【解决方案2】:

    只是添加到 KateMihalikova 的答案(我没有足够的代表来添加评论)但她的答案是正确的,除了 iOS >= 7 部分;不支持iOS 7 body(我相信只有当您已经有相关短信号码的历史记录时它才能工作,但我没有测试过);然而,iOS 8 带来了 body prefill:您必须将用于 iOS ; 替换为 &

    iOS 8: sms:+123456789&amp;body=hello there

    【讨论】:

      【解决方案3】:

      我可以确认,只要被联系的号码有现有的聊天记录,在 ios7 中正文就可以使用。

      【讨论】:

        猜你喜欢
        • 2020-03-22
        • 2018-01-06
        • 2017-12-21
        • 1970-01-01
        • 2014-07-12
        • 1970-01-01
        • 2023-01-09
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多