我正在使用SMS检索器API,但正在获取未解决的参考:下一行的状态
val status = extras.get(SmsRetriever.EXTRA_STATUS) as Status
我的代码:
package com.tech.renters.myapplication
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import com.google.android.gms.auth.api.phone.SmsRetriever
class SmsReceiver : BroadcastReceiver(){
private val codePattern = "(\\d{6})".toRegex()
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
}
}
}