Skip to content

Commit

Permalink
Fix Broadcast Receivers Android 14 Flag
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaailashsharma committed Apr 24, 2024
1 parent e40200a commit bc2220f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
10 changes: 10 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/kotlinScripting.xml

This file was deleted.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion app/src/main/java/app/waste2wealth/com/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.Manifest
import android.annotation.SuppressLint
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
Expand Down Expand Up @@ -136,7 +137,11 @@ class MainActivity : ComponentActivity() {
override fun onFailure() {}
}
val intentFilter = IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION)
registerReceiver(smsBroadcastReceiver, intentFilter)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(smsBroadcastReceiver, intentFilter, RECEIVER_EXPORTED)
} else {
registerReceiver(smsBroadcastReceiver, intentFilter)
}
}


Expand Down

0 comments on commit bc2220f

Please sign in to comment.