javascript - 如何在iOS移动网站上添加 "Share on whatsapp"按钮

标签 javascript ios web-applications mobile-website whatsapp

在网站上添加 whatsapp 分享按钮,适用于 iOS8。 我正在使用以下内容:

<spanid="whatsapp_share_android">
    <a href="whatsapp://send?text={{my_meta.og_title.value}} - http://{{ request.get_host }}{{entity.url}}%3Futm_source=whatsapp%26utm_medium=referral" data-action="share/whatsapp/share" onmousedown="_paq.push(['trackEvent','Share on Whatsapp','Mobile','{{request.get_full_path}}']); ga('send', 'event','Share on Whatsapp','Mobile','{{request.get_full_path}}');ga('mobileTracker.send', 'event','Share on Whatsapp','Mobile','{{request.get_full_path}}');"><img src="{{ STATIC_URL }}images/whatsapp_icon.png" /></a>
</span>

它适用于 android 但不适用于 iOS

最佳答案

根据应用程序集成的 WhatsApp 常见问题解答,您的 URL 方案应该有效:

我假设您的示例代码中括号内的所有内容都将被您的应用替换? span 标签和它的 id 属性之间也需要有一个空格。

如果您在两个平台上使用这个简单的示例来尝试一下,效果如何:

<a href="whatsapp://send?text=Hello%20World!">Hello, world!</a>

关于javascript - 如何在iOS移动网站上添加 "Share on whatsapp"按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28541693/

相关文章:

javascript - Angular .js :88 Uncaught Error: [$injector:modulerr]

javascript - 检测 AUI 对话框中按下的 Enter 键

objective-c - 具有(复杂)关系和核心数据/RAILS 的 Restkit

python - 如何使用 WTForms 呈现我的选择字段?

c# - 如何查看从 IEnumerable 返回的对象?

email - 从Google Mail签名中删除链接格式?

javascript - Bootstrap DatePicker 允许通过键入进行编辑

javascript - 正则表达式中的多个条件 - 如何用破折号替换冒号和空格

html - whatsapp html 链接不适用于 iphone 8,chrome

ios - 如何将 Plist 文件与 UITableView/UICollectionView 一起使用?