[英]iOS - Make WhatsApp voice/video call programmatically from my application
I have a requirement to make WhatsApp calls from my application.我需要从我的应用程序中进行 WhatsApp 调用。 When I click the mobile number in my app then it should redirect to WhatsApp and initiate voice/video calls without user intervention.当我在我的应用程序中单击手机号码时,它应该重定向到 WhatsApp 并在无需用户干预的情况下发起语音/视频通话。 I've found a solution from the below link but it's opening application and landing on user chat window.我从下面的链接中找到了一个解决方案,但它正在打开应用程序并登陆用户聊天 window。
https://faq.whatsapp.com/en/iphone/23559013 https://faq.whatsapp.com/en/iphone/23559013
There isn't an api for that.没有 api 。 Whatsapp only allows interactions like sharing media such as video, audio and images as mentioned in the FAQ . Whatsapp 仅允许像常见问题解答中提到的共享媒体(如视频、音频和图像)之类的交互。 I tried searching for official developer doc for one of my requirements but, was unsuccessful the FAQ seems to be the only official doc availabe:我尝试为我的要求之一搜索官方开发人员文档,但未成功,FAQ 似乎是唯一可用的官方文档:
If your application creates photos, videos, or audio notes and you'd like your users to share these media using WhatsApp, you can use the Document Interaction API to send your media to your WhatsApp contacts and groups.如果您的应用程序创建照片、视频或音频笔记,并且您希望您的用户使用 WhatsApp 共享这些媒体,您可以使用文档交互 API 将您的媒体发送给您的 WhatsApp 联系人和群组。
The only thing you could do is open the contact page for the user.您唯一能做的就是打开用户的联系页面。 And then he has to call by manually clicking on call button.然后他必须通过手动单击呼叫按钮来呼叫。 Maybe, give an info that suggests user to do so.也许,提供建议用户这样做的信息。
if #available(iOS 10.0, *) {
UIApplication.shared.open(NSURL(string: "whatsapp://send?phone=+91phonenumber")! as URL)
} else {
UIApplication.shared.openURL(NSURL(string: "whatsapp://send?phone=+91phonenumber")! as URL)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.