我试图通过 WhatsApp Web 发送 .apk 文件,但最终它在收件人端(Android 手机)转换为 zip 文件
有没有办法避免这种转换
我在使用 Whatsapp Cloud API(已于 5 月 22 日向公众发布)时遇到问题。我在“设置开发人员资产和平台访问”部分中完成了入门中的所有操作,这样我就能够在 Ubuntu 20.04.4 LTS 中使用以下命令发送模板hello world :
curl -i -X POST \
https://graph.facebook.com/v14.0/my_number/messages \
-H 'Authorization: Bearer my_token' \
-H 'Content-Type: application/json' \
-d '{ "messaging_product": "whatsapp",
"to": "my_reciever",
"type": "template",
"template": { "name": "hello_world", "language": { "code": "en_US" } }
}'
Run Code Online (Sandbox Code Playgroud)
或者使用Python 3.10和requests 2.27.1:
from requests import Session
import json
from requests.exceptions import ConnectionError, Timeout, TooManyRedirects
BASE_URL = "https://graph.facebook.com/"
API_VERSION = "v13.0/"
SENDER = …
Run Code Online (Sandbox Code Playgroud) 使用 Postman 进行测试,我正在尝试根据文档中的故障示例项目发送一条消息
我正在尝试编写一个 API 端点,当人们向我的组织的 Whatsapp 号码发送消息时,我可以使用 Webhook 来访问它。API 将发送自动响应。
当我发送带有以下正文的 POST 时,https://graph.facebook.com/v14.0/redacted/messages
它会返回以下响应:
{
"error": {
"message": "(#131030) Recipient phone number not in allowed list",
"type": "OAuthException",
"code": 131030,
"error_data": {
"messaging_product": "whatsapp",
"details": "Recipient phone number not in allowed list: Add recipient phone number to recipient list and try again."
},
"error_subcode": 2655007,
"fbtrace_id": "A5YKQbpB0PEaaA-gIROEv-n"
}
}
Run Code Online (Sandbox Code Playgroud)
错误代码未在错误代码页中列出,而且我也找不到任何有关添加收件人电话号码的信息(要求我可以向其发送消息的预定义收件人电话号码列表是没有意义的) 。
这是消息正文:
{
"messaging_product": "whatsapp",
"to": "redacted",
"text": {
"body": "Ack: Hello world"
}
} …
Run Code Online (Sandbox Code Playgroud) 我已创建 WhatsApp Business Platform 测试帐户。我能够发送和接收 hello-world 模板消息,但是当我发送没有模板的测试消息(由 api 指定)时,它不会将其推送到手机。奇怪的是,我在这两种情况下都得到了成功响应。
网址:https://graph.facebook.com/v15.0/11ZZZZZZZZZZZZZ/messages
这是 json 及其响应
{
"messaging_product":"whatsapp",
"to":"91ZZZZZZZZZZ",
"type":"template",
"template":{
"name":"hello_world",
"language":{
"code":"en_US"
}
}
}
{
"messaging_product":"whatsapp",
"contacts":[
{
"input":"91ZZZZZZZZZZ",
"wa_id":"91ZZZZZZZZZZ"
}
],
"messages":[
{
"id":"wamid.HBgMOTE3MjkwMDIxMzYwFQIAERgSMjZCRkQ3RDc0RjM0QkNEZZZZZZ=="
}
]
}
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我成功地在手机上收到消息
{
"messaging_product":"whatsapp",
"to":"91ZZZZZZZZZZ",
"type":"text",
"text":{
"preview_url":false,
"body":"Hello World Testing"
}
}
{
"messaging_product":"whatsapp",
"contacts":[
{
"input":"91ZZZZZZZZZZ",
"wa_id":"91ZZZZZZZZZZ"
}
],
"messages":[
{
"id":"wamid.HBgMOTE3MjkwMDIxMzYwFQIAERgSQUJERkM2RUE1RTEwQTExZZZZZZ=="
}
]
}
Run Code Online (Sandbox Code Playgroud)
但是我在手机上收不到消息。在第二种情况下我有什么遗漏的吗?
我正在尝试从我的应用程序中选择联系人的Whatsapp地址,但鉴于我的应用程序是Whatsapp的工具,我希望用户继续使用本机方式选择联系人,这样他们就不会有习惯一种新的做事方式,这对我们大多数人来说都很烦人.
我做了一些研究,我知道链接,如发送文本到特定联系人(whatsapp),通过WhatsApp发送消息,以及网站上的一些其他问题和答案,但他们不使用Whatsapp的联系人选择器.
希望你能帮忙.
我想写一个自动解密我的Whatsapp数据库的Android应用程序,所以我按照本教程将其翻译成Java.但后来我注意到Android上没有openssl二进制文件所以我问google如何手动解密aes但我找不到有用的东西.
所以基本上我得到了这个shell命令
openssl enc -aes-256-cbc -d -nosalt -nopad -bufsize 16384 -in msgstore.db.crypt7.nohdr -K $k -iv $iv > msgstore.db
Run Code Online (Sandbox Code Playgroud)
$ k是64位十六进制字符串.但是当我尝试将它用作aes解密的密钥时,我得到一个带有"Unsupported key size:64 bytes"消息的InvalidKeyException.当我在我的电脑上执行此命令时,我工作得很好.
我目前正在使用这个java代码来解密数据库,它在cipher.init失败:
public void decryptDatabase(String k, String iv)
throws InvalidKeyException, InvalidAlgorithmParameterException,
NoSuchAlgorithmException, NoSuchPaddingException, IOException {
File extStore = Environment.getExternalStorageDirectory();
FileInputStream fis = new FileInputStream(extStore
+ "/WhatsApp/Databases/msgstore.db.crypt7.nohdr");
FileOutputStream fos = new FileOutputStream(extStore + "/Decrypted.db");
SecretKeySpec sks = new SecretKeySpec(k.getBytes(), "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
cipher.init(Cipher.DECRYPT_MODE, sks,
new IvParameterSpec(iv.getBytes()));
CipherInputStream cis = new CipherInputStream(fis, cipher);
int b;
byte[] …
Run Code Online (Sandbox Code Playgroud) 我正在尝试与我的 android 应用程序共享链接:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, share);
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "");
mContext.startActivity(intent);
Run Code Online (Sandbox Code Playgroud)
这是share
强:
Check out my link:\n http://my123domain.com/v.php?vid=123456-123456-123456
Run Code Online (Sandbox Code Playgroud)
但是当我Whats App
通过链接分享它时无法点击,知道为什么吗?
是否可以将whatsapp消息发送到未存储在通讯录中的特定whatsapp帐户(电话号码)?
想在我的网站上设置whatsapp网址方案,以通过whatsapp提供直接联系。
我正在尝试将图像分享给whatsapp或其他应用程序.图像在android studio中的drawable文件夹中.但是当我尝试这样做时,Toast表示不支持文件格式化.以下是我的代码.请提前帮助谢谢
public void share(View view)
{
Uri uri=Uri.parse("android.resource://com.faisal.home.myapplication/drawable/"+R.drawable.tease);
Intent intent,chooser;
intent=new Intent(Intent.ACTION_SEND);
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_STREAM,uri);
chooser=Intent.createChooser(intent,"share Image");
if(intent.resolveActivity(getPackageManager())!=null)
{
startActivity(chooser);
}
else
{
Toast.makeText(this,"No app to share",Toast.LENGTH_LONG).show();
}
}
Run Code Online (Sandbox Code Playgroud) 我目前正在使用Twilio WhatsApp API和Bot Framework Direct Line通道尝试将我的聊天机器人集成到WhatsApp。
由于我的聊天机器人对话是有指导的,因此会使用很多PromptDialog.Choices消息(这是英雄卡片)。有没有一种方法可以使用Twilio WhatsApp API将这些消息以其预期的形式(即带有单击按钮的含义)发送给Whatsapp?