简体   繁体   English

twilio反应本机集成

[英]twilio react native integration

I'm trying to create a react native app that allows the user to click a button and a call to their phone will be placed using the TWILIO API. 我正在尝试创建一个反应本机应用程序,该应用程序允许用户单击按钮,然后使用TWILIO API拨打其电话。 I have it working from terminal by typing node make_call.js(name of file) but i want the user to be able to make the call when they want to by inputing their phone number and clicking a call button. 我可以通过输入节点make_call.js(文件名)从终端运行它,但是我希望用户能够通过输入电话号码并单击呼叫按钮来拨打电话。 Heres my code. 这是我的代码。 the credentials are fake. 凭据是伪造的。 Is this possible?? 这可能吗??

var accountSid = 'AC76d99966f35141f7c8585e31ed740480'
var authToken = '6470ce0905736f0f9da91456f088e97cc2'

var client = require('twilio')(accountSid, authToken);



client.calls.create({

url: 'https://demo.twilio.com/welcome/voice/',

to: '7781234564',
from: '6042322056',

}, function(err, call) {
if(err) {

    console.log(err);

} else {

    console.log(call.sid);
}

})

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

You can actually build phone calling directly into your application using the Twilio Voice SDK . 实际上,您可以使用Twilio Voice SDK将电话直接建立到应用程序中。

There is already available to, built by the community, a React Native wrapper for the Twilio Voice SDK . 社区已经为Twilio Voice SDK提供React Native包装器

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

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

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