我想在我的应用程序中使用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. 使用Swift从您的应用程序发送消息给WhatsApp?
- 2. 使用Java应用程序向我的单元发送消息
- 3. 消息应用程序/ Whatsapp发送按钮图像
- 4. 从应用程序发送一个WhatsApp消息
- 5. 使用php发送Whatsapp消息
- 6. 通过whatsapp使用Intent发送消息
- 7. BizTalk可以向我的C#Web应用程序发送确认消息吗?
- 8. 限制发送应用程序,可以发送我的应用程序ACTION_SEND intent
- 9. Facebook应用程序可以向其用户发送消息
- 10. 如何在我的应用程序中知道我何时发送新消息?
- 11. 如何从我的应用程序发送图像到WhatsApp?
- 12. 通过我的应用程序发送图像到whatsapp
- 13. 选择短信中,WhatsApp的,或致电在我的Android应用程序发送消息
- 14. 通过我的应用程序向联系人发送消息?
- 15. 我可以向我的Android应用用户发送定期消息吗?
- 16. 发送android应用程序的消息?
- 17. 是否可以将消息发送到Android应用程序?
- 18. 在我的应用程序中打开“消息”应用程序
- 19. 即使应用程序在iphone sdk中关闭,我们可以发送消息给用户吗?
- 20. 我想在我的android应用程序发送消息,但我不想使用权限Send_SMS。我想用Intent发送消息
- 21. 在我的应用程序中共享消息后从WhatsApp回拨
- 22. 发送我的应用程序的URL计划使用WhatsApp的URL计划
- 23. 我可以在应用程序中发送两个AlarmManager
- 24. 在Android中的另一个应用程序发送WhatsApp消息。没有打开WhatsApp
- 25. 我可以使用WPF应用程序中的Lync 2013 SDK OR API发送即时消息和呼叫吗?
- 26. 当我发送消息时,Socket.io聊天应用程序刷新
- 27. 通过应用程序发送消息
- 28. 从iPhone应用程序发送消息
- 29. 如何使用C#编程发送消息到whatsapp数字
- 30. 可以使用SignalR从控制台应用程序发送消息,该消息将显示在浏览器中?
但在该github的链接是PHP的公共API。 – 2013-03-07 08:12:28
没有API不公开,Github上的代码被逆向设计。因此在法律允许你看到事情是如何工作的。但在您的应用中使用不合法。 – rckoenes 2013-03-07 08:16:19
和苹果肯定会拒绝应用程序 – 2013-03-07 09:14:09