channel_name_notification_service or channel_name_notification_on_service permission request in android

49 Views Asked by At

Details:

I cannot find the documentation regarding channel_name_notification_on_service.

Currently, i'm using foreground service to download some resources. I need to show the banner notification when the service is running so it's not being suspicious. Since android 13, we found that there is extra notification setting in the notification permission setting called : channel_name_notification_on_service; which by default is all disabled. I need to know how to turn it on, especially the Allow floating notifications permission, but yet i cannot find any documentation for this topic in the official web of developer.android.com.

How to enable this or asking permission for this? What permission should i ask to enable Allow floating notifications.

URL for notification documentations that i mentions: https://developer.android.com/develop/ui/views/notifications/channels

Question

I need to know what permission i need to ask to enable banner notification on running service. Or where i can find the documentations regarding the issue.

Images

notification_setting_1 notification_setting_2

1

There are 1 best solutions below

1
Dhruv Limbachiya On

In order to display notification on Android 13 or higher you need to request POST_NOTIFICATIONS runtime permission.

android.permission.POST_NOTIFICATIONS

<manifest ...>
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <application ...>
        ...
    </application>
</manifest>

Foreground service notification won't appear in notification bar if you've chosen to deny notification permissions. However, you'll still be able to view foreground service within the Task Manager, even without granting those permissions.

Here's a breakdown:

  • Notification permissions: These control whether apps can send you notifications in Android 13 or higher

References: