【问题标题】:Send whatsapp message using android/IOS aplication使用 android/IOS 应用程序发送 whatsapp 消息
【发布时间】:2019-08-03 06:04:46
【问题描述】:

打开 WhatsApp 应用程序发送消息的最佳方式是什么?

我编写此代码是因为我希望它以一种方式通过计算机浏览器打开,否则通过移动应用程序打开。

首先我做了一个条件来检查用户访问的位置。如果是通过某些移动设备,则属于第一个条件,否则属于第二个链接。

打开应用程序的条件不起作用,我认为可能是'whatsapp:// ...'链接有人可以帮助我吗?

        function MakeLink() {
            if ( isMobile.any ) {
                let target = 'whatsapp://send?'
                    target += 'phone='+ encodeURIComponent(phone);
                return target
            } else {
                let target = 'https://web.whatsapp.com/send?'
                    target += 'phone='+ phone;
                return target
            }

        }

    window.location.href = MakeLink();

Ps:我不想使用“api.whatsapp”地址,因为它会掉到中间页面,增加客户端路径。

【问题讨论】:

    标签: javascript android html api whatsapp


    【解决方案1】:

    不知道有没有没有api的方法

    let target = 'https://api.whatsapp.com/send?'
      target += 'phone='+ phone;
    

    编辑:它从昨天开始突然停止工作。

    【讨论】:

    • 是的,我使用浏览器的 web.whatsapp.com/send 和移动设备的 api.whatsapp.com 解决了这个问题。是的,whatsapp 的“api”这几天一直出现问题,没有人知道为什么。谢谢你。
    猜你喜欢
    • 2015-11-25
    • 1970-01-01
    • 1970-01-01
    • 2015-04-17
    • 2017-04-08
    • 2011-10-18
    • 2018-07-11
    • 1970-01-01
    • 2015-11-09
    相关资源
    最近更新 更多