I integrated twillio for signup user in my application. From my application twillio SMS send to User for One Time Password(OTP). If user can verify OTP then and then he can register in my App.
But Sometime Twillio give error code 30004. But I want to send SMS forcefully to user without any restriction. Is there any way to fulfill my requirement.
I also read this page of twillio for my error https://support.twilio.com/hc/en-us/articles/223134167-Limitations-sending-SMS-messages-to-Indian-mobile-devices
But I want to send SMS to user any how.
2
Answers
Twilio developer evangelist here.
I am guessing, since you mention the article on limitations of sending SMS to India that you are trying to send to an Indian device.
As you have read, there are a number of issues with sending to India that all follow from India’s classification of services like Twilio as marketing. For this reason, you are unable to send messages outside of the hours of 9am – 9pm and if a number is on the Do Not Call registry your message will never be delivered.
If you are trying to implement two factor authentication for India then I recommend you do so using an authenticator application. You can do this using Twilio’s Authy API or by generating a secret and sharing it to applications like Authy or Google Authenticator.
This is more secure than 2FA over SMS and means you do not need to send SMS and rely on delivery in India. Instead the authentication can happen between the server and the device. This is what GitHub did for their 2FA and you can read why about that here.
Let me know if that helps at all.
Error 30004 “Message Delivery – Message blocked” when Sending SMS
If a message you sent is not delivered to the end device and returns a 30004 error code, this means that delivery of your message failed because the destination is blocked from receiving this message