Skip to content

Instantly share code, notes, and snippets.

@MehulKK
Last active May 10, 2019 19:11
Show Gist options
  • Save MehulKK/12168b2746259d89e3bfb5eba749f4b2 to your computer and use it in GitHub Desktop.
Save MehulKK/12168b2746259d89e3bfb5eba749f4b2 to your computer and use it in GitHub Desktop.
private fun startSMSListener() {
val client = SmsRetriever.getClient(this /* context */)
val task = client.startSmsRetriever()
task.addOnSuccessListener {
// Successfully started retriever, expect broadcast intent
// ...
// otpTxtView.text = "Waiting for the OTP"
Timber.e("SMS Retriever starts")
}
task.addOnFailureListener {
//otpTxtView.text = "Cannot Start SMS Retriever"
Timber.e("Cannot Start SMS Retriever")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment