Skip to content

Commit

Permalink
exported
Browse files Browse the repository at this point in the history
  • Loading branch information
@shakhzod.djuraev committed Sep 25, 2023
1 parent 6d152e6 commit 1d8dab0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import androidx.activity.result.IntentSenderRequest.*
import androidx.annotation.NonNull;
import com.google.android.gms.auth.api.identity.GetPhoneNumberHintIntentRequest
Expand Down Expand Up @@ -201,7 +202,12 @@ class OTPPlugin : FlutterPlugin, MethodCallHandler, PluginRegistry.ActivityResul
}

val intentFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION)
this.activity?.registerReceiver(smsRetrieverBroadcastReceiver, intentFilter)
if(Build.VERSION_CODES.O <= Build.VERSION.SDK_INT) {
this.activity?.registerReceiver(smsRetrieverBroadcastReceiver, intentFilter,Context.RECEIVER_EXPORTED)
}else {

this.activity?.registerReceiver(smsRetrieverBroadcastReceiver, intentFilter)
}
}

private fun unRegisterBroadcastReceivers() {
Expand Down

0 comments on commit 1d8dab0

Please sign in to comment.