I have established a nodejs application on ubuntu 16.0. I installed it using npm and configured all required dependencies. Now everything is working fine. Cloud code functions are working and adding data in database. Now my problem is that I am using twilio to send confirmation sms to user. Following is my code:
console.log("call 6");
var twilio = require("twilio")("A123456789123456789123456789123456", "a1234567891234567891234567891234");
console.log("call 7");
twilio.sendMessage({
From: "+1 123-456-7890",
To: request.params.number,
Body: "Enter 123 to verify your phone number..."
}, function (err, responseData) {
if (err) {
response.error("Error:" + err.message);
} else {
response.success("Success");
}
});
Now "call 6" is shown in the logs but "call 7" does not show and this function did not through any response. I am calling it from iPhone and it keeps waiting for the response and throws request time out.
I have solved this and posting here so that if someone else stuck with this error. I was using parse-server-example project from parse and added parse-server in it as dependency. After installing twilio in parse-server-example rather than parse-server solved my issue.