Skip to content

Broadcast Receiver #9

@maideribarra

Description

@maideribarra

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:

  1. In Android Manifest: <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions