我想在我的应用程序中使用whatsapp将消息发送到其他手机。我在Github上看到了这个公共API,用于here。但我没有找到适用于iOS的API。那么可以在iOS应用中使用whatsapp?那是合法的吗?我在哪里可以找到针对iOS的whatsapp的公共API?我可以在我的应用程序中使用whatsapp发送消息
4
A
回答
9
是的,你可以使用whatsapp通过你的iOS发送文本/图像的应用程序。 有做两种方式这样 1. URL方案
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%2C%20World!"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
}
- UIDocumentInteraction 见下文 http://www.whatsapp.com/faq/en/iphone/23559013
-1
否这是不合法的。你不能在你的应用程序中使用watsapp。
0
的链路是如此简单。希望它可以帮助;-)
NSURL *whatsappURL = [NSURL URLWithString:@"whatsapp://send?text=Hello%20world"];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
//WhatsApp is installed in your device and you can use it.
[[UIApplication sharedApplication] openURL: whatsappURL];
} else {
//WhatsApp is not installed or is not available
}
2
是的,你可以通过:
- URL方案
- UIDocumentInteraction
由于@NSAnant万一你被编码提到
一个混合应用程序(科尔多瓦,phonegap等)一个简单的锚点与来自WhatsApp常见问题解答的URL方案会解决这个问题(integrate WhatsApp into my app)
<a href="whatsapp://send?text=666isthenumberofthebeast" id="my_button" class="button_default button_color">Send Whatsapp Friendly Message</a>
0
在的iOS 9:你需要的info.plist
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fbauth2</string>
<string>fbshareextension</string>
<string>fb-messenger-api</string>
<string>twitter</string>
<string>whatsapp</string>
<string>wechat</string>
<string>line</string>
<string>instagram</string>
<string>kakaotalk</string>
<string>mqq</string>
<string>vk</string>
<string>comgooglemaps</string>
</array>
设置密钥组密钥之后,下面的代码中的iOS 9
工作NSString * msg = @"mahesh";
NSString * urlWhats = [NSString stringWithFormat:@"whatsapp://send?text=%@",msg];
NSURL * whatsappURL = [NSURL URLWithString:[urlWhats stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
if ([[UIApplication sharedApplication] canOpenURL: whatsappURL]) {
[[UIApplication sharedApplication] openURL: whatsappURL];
} else {
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"WhatsApp not installed." message:@"Your device has no WhatsApp installed." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
相关问题
- 1. 使用Java应用程序向我的单元发送消息
- 2. 使用php发送Whatsapp消息
- 3. BizTalk可以向我的C#Web应用程序发送确认消息吗?
- 4. 限制发送应用程序,可以发送我的应用程序ACTION_SEND intent
- 5. 通过我的应用程序发送图像到whatsapp
- 6. 我可以向我的Android应用用户发送定期消息吗?
- 7. 我可以向我的Facebook应用程序发布公共消息吗?
- 8. 即使应用程序在iphone sdk中关闭,我们可以发送消息给用户吗?
- 9. 我想在我的android应用程序发送消息,但我不想使用权限Send_SMS。我想用Intent发送消息
- 10. 我可以在应用程序中发送两个AlarmManager
- 11. 在Android中的另一个应用程序发送WhatsApp消息。没有打开WhatsApp
- 12. 从iPhone应用程序发送消息
- 13. 通过应用程序发送消息
- 14. 如何使用C#编程发送消息到whatsapp数字
- 15. 可以使用SignalR从控制台应用程序发送消息,该消息将显示在浏览器中?
- 16. 从我的NodeJS应用程序发送推送通知消息不起作用
- 17. 如何使用c将消息发送到我的客户端应用程序#
- 18. Sirikit'使用我的应用程序发送消息'仅工作几次
- 19. 发送WhatsApp的使用WhatsappAPI消息在C#
- 20. 是否可以发送Facebook消息给使用我的Facebook应用程序的人?
- 21. 我可以使用我的应用程序分发JDK吗?
- 22. Need Whatsapp api发送来自我的PHP项目的消息
- 23. 如何在短信应用程序中看到我的应用程序中发送的消息?
- 24. OutputDebugString函数不会在我的控制台应用程序中发送消息
- 25. 如何将应用程序发送至应用程序消息
- 26. 通过WhatsApp从我的Android应用程序发送消息到特定的联系人不工作4.4.4
- 27. 如何让我的应用程序向桌面程序发送消息?
- 28. 我可以在我的应用程序中使用notepad ++ exe吗?
- 29. 发送与根的Whatsapp消息
- 30. 可以在我的web应用程序中使用他们的API发布消息或对Yammer的赞美
但在该github的链接是PHP的公共API。 – 2013-03-07 08:12:28
没有API不公开,Github上的代码被逆向设计。因此在法律允许你看到事情是如何工作的。但在您的应用中使用不合法。 – rckoenes 2013-03-07 08:16:19
和苹果肯定会拒绝应用程序 – 2013-03-07 09:14:09