I'm trying to use Twilio Api to send SMS to my phone from my Android Kotlin App
I'm putting the initialization of twilio on the onCreate Method https://i.imgur.com/3D75hLn.png
Where sid is my Twilio SID and token is my Twilio TOKEN
and this is the function i'm executing after that to send the message https://i.imgur.com/knuXGt7.png
But i'm getting this error when executing the program https://i.imgur.com/a2rr8on.png
I have INTERNET and SEND_SMS permissions in my manifest.xml
Did anyone already tried Twilio With kotlin 1ndroid ? thanks for your help
I've tried creating a new Android projet and invalidate the cache
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_register)
Twilio.init(sid, token)
register_button.setOnClickListener {
performRegister()
Log.i("Register", generatePassword())
}
}
fun sendPasswordMessage() {
val message = Message.creator(
PhoneNumber("+213793079458"),
PhoneNumber("+14075452670"),
"Hello from aziz"
).create()
println(message.sid)
}