ARTICLE AD BOX
When I receive the message I got it inside timeout callback but I receive the sms send throught emulator instantly ?
class SmsBroadcastReceiver : BroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { if (SmsRetriever.SMS_RETRIEVED_ACTION == intent.action) { val extras = intent.extras val status = extras!!.get(SmsRetriever.EXTRA_STATUS) as Status? when (status?.statusCode) { CommonStatusCodes.SUCCESS -> { // Get SMS message contents val message = (extras.get(SmsRetriever.EXTRA_SMS_MESSAGE) ?: "") as String // Extract one-time code from the message and complete verification // by sending the code back to your server for verification. Log.e("TAG", message) } CommonStatusCodes.TIMEOUT -> { // Waiting for SMS timed out (5 minutes) // Handle the error ... Log.e("TAG", "timeout") } } } } }