将文本从网站发送到whatsapp网站

时间:2015-12-03 05:52:01

标签: android ruby-on-rails ruby-on-rails-4 share whatsapp

目前我正在使用

从我的移动网站发送文字到whatsapp
%a{:href => "whatsapp://send?text=#{url}", :id=>"whatsapp", :class=>"btn btn-success share1"}

如果我使用此

,我无法在电脑(网站)上打开此链接
%a{:href => "https://web.whatsapp.com//send?text=#{url}", :id=>"whatsapp", :class=>"btn btn-success share1"}

我可以通过whatsapp(网页)打开whatsapp,但我无法发送文本,因为我可以在移动设备上进行。

我该怎么办?

先谢谢..

1 个答案:

答案 0 :(得分:0)

那不行。使用whatsapi之类的客户端。

通过放入Gemfile安装并运行bundle:

gem 'whatsapi'

然后把它放在一个方法中,然后从某个地方的URL调用它:

require 'whatsapi'
client = WhatsApi::Client.new("1234567", "whatsapp_user", "nickname")
client.connect
client.login "your password"