-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Description
Hi,
Thank you for your job, i have used it with my students, it´s grate.
The task of broadcast receiver doesn´t work in versions bigger than Android 13, now to show a notification in an Android phone or emulator it`s needed to do the next two things:
- In Android Manifest: <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
- Ask for permissions in the code:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS)
!= PackageManager.PERMISSION_GRANTED
) {
ActivityCompat.requestPermissions(
this,
arrayOf(Manifest.permission.POST_NOTIFICATIONS),
1001
)
}
Thank you a lot,
Maider
Metadata
Metadata
Assignees
Labels
No labels