简体   繁体   English

使用 Twilio 从 arduino 向 Android 应用发送短信,反之亦然

[英]Send SMS from arduino to Android App Using Twilio and Vice Versa

I am building an app which intends to send data from an arduino uno to an android app and vice versa using twilio.我正在构建一个应用程序,它打算使用 twilio 将数据从 arduino uno 发送到 android 应用程序,反之亦然。

I know the best way to do this is by using a RESTFUL API, however, is there a way to send and receive SMS directly from the android app through twilio?我知道最好的方法是使用 RESTFUL API,但是,有没有办法通过 twilio 直接从 android 应用程序发送和接收 SMS?

Twilio developer evangelist here. Twilio 开发人员布道者在这里。

You could send an SMS from an Android app via Twilio, however it's not recommended.您可以通过 Twilio 从 Android 应用程序发送短信,但不建议这样做。 There is a discussion on why this is an issue and how to work around it in this blog post by my colleague Marcos . 我的同事 Marcos 在这篇博文中讨论了为什么会出现这个问题以及如何解决这个问题 The key is this point:关键是这一点:

While Twilio is a REST API and theoretically you could make an HTTP request to it directly, you would need to store your Twilio credentials inside your app which poses a serious security issue.虽然 Twilio 是一个 REST API,理论上您可以直接向它发出 HTTP 请求,但您需要将 Twilio 凭据存储在您的应用程序中,这会带来严重的安全问题。 An attacker could decompile the application, extract your credentials and use your Twilio account for anything they liked.攻击者可以反编译应用程序、提取您的凭据并将您的 Twilio 帐户用于他们喜欢的任何内容。

So the best practice is to use a server to send SMS messages from your Android app.因此,最佳做法是使用服务器从您的 Android 应用程序发送 SMS 消息

Let me know if that helps at all.让我知道这是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM