communicate with users outside of our app. Many apps use notifications to inform more users of news of high importance. However, getting users to accept notifications is becoming more and more difficult every year. In this session, we will introduce the optimization of notification channels as one of our efforts to get users to receive notifications.
session ◦ Developers considering channel optimization ◦ Managers who want to improve notification acceptance rates • What I will talk about ◦ Benefits of optimizing notification channel ◦ How to migrate from in-app settings • What I won’t talk about ◦ Notification support specific to Android 13
detail introduced in Android 8 (Oreo). ◦ All notifications must be assigned to a channel • Allows users to set in detail whether and how they will receive ◦ Sound ◦ Popup ◦ Display on lock screen…
notification I want comes in. • They can't make individual settings. ◦ They want to receive notifications, but they don't want them to pop up, etc. • Settings are scattered throughout the app and the OS, making it difficult to understand. • The absolute number of notifications increases
makes it easy to turn off notification permissions ◦ Once the permission for notifications is turned off, it is difficult to get people to turn it back on. • Management of permission is complicated because it coexists with settings in the app. • More notifications make it easier for people to turn off permissions
configurable display of notifications and privacy considerations that you wish to receive. • Reduce the number of notifications • (If permission information is centralized in the OS, ) there is no need to configure it in both the app and the OS
necessary to obtain notification permissions. It will be significant to have the channel set by transitioning to the OS settings rather than the settings in the app.
• Migration of existing settings • Getting status from a channel • Receive operation events synchronously from a channel • Rebuild the in-app settings screen ◦ Functions ◦ Design
represent channels. Note that they are listed in order of name, not order of creation - name: Labels displayed on notification management screen and channel screen - importance: Importance of notification - description: (Optional) Channel Description. Note that long descriptions may be omitted depending on the OS version and device.
NotificationManager, the importance level is unchangeable Users can change the app's channel settings at any time behavior: Can be changed as long as it is less than the set value until the user operates it after first sending it to NotificationManager
if the user has not changed any // fields on this channel yet. ….. https://cs.android.com/android/platform/superproject/+/master:framewo rks/base/services/core/java/com/android/server/notification/Preferences Helper.java;l=900;drc=20ffbd23f13b00dd32f6cc4c7cfed2cc8ea46614
turning it OFF once, it will return to the default value specified by the app on many devices, but be aware that some devices may default to the device's default value. Example: If IMPORTANCE_HIGH is set on the app side, but the user turns OFF => ON, it becomes equivalent to IMPORTANCE_DEFAULT.
delete channel group notificationManager.deleteNotificationChannelGroup("01_breaking_group") If a channel is deleted once and then re-created with the same ID, the settings before deletion are inherited.
= notificationManager.getNotificationChannel("01_breaking_group") val enabled = notificationChannel.importance != NotificationManager.IMPORTANCE_NONE // Permission for all notices val enabledBase = notificationManager.areNotificationsEnabled()
received by BroadcaseReceiver if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) { return } // The blockedState is returned, true if disabled, false if enabled. val isEnabled = !intent.getBooleanExtra(NotificationManager.EXTRA_BLOCKED_STATE, false)
// Processing upon receipt of all notification permission events } NotificationManager.ACTION_NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED -> { val channelId = intent.getStringExtra(NotificationManager.EXTRA_NOTIFICATION_CHANNEL_ID) // Processing when a channel permission event is received } }
experience that the permission is cut off at the same time the notification is struck, and a large number of requests may be sent to the back end • when a switch is hit repeatedly, it is not possible to control It is necessary to thwart the event with the BroadcastReceiver that receives it.
Android 12 or later. • Do not set this option if less than 12, as the foreground service may start (displaying a notification) as backward compatible. ◦ recommended: to sync regularly when the app is launched as it may not always be activated
the app and persist them in the DB • Change permissions in the settings screen • Controls sending notifications in conjunction with backend setting in the app before optimization
Save users who had previously been set up in the app. ◦ A certain number of users are unaware of OS notification settings • In the future, when permission settings for each user are created, they can be managed on the same screen. ※ Our application does not support Android 7 from 2022
want to set up notifications on a per-user basis rather than per-device basis, place them on the same screen • Directly within the app Image is an example.
• Steps to move to a notification channel, with real-life examples ◦ Craete Channel ◦ Notification Settings and behavior in the application ◦ Get channel status ◦ Receive permission change events
receive notifications. This is expected to reduce the risk of notification permissions being turned off. In addition, the centralization of permission information in the OS makes it easier to organize the classification of notifications. We will continue to improve notifications while observing changes in permissions.
also specify whether notification content should be displayed on the lock screen, but the user's lock screen settings take precedence. VISIBILITY_PUBLIC View full content of notifications VISIBILITY_SECRET Do not display some of the notifications on the lock screen VISIBILITY_PRIVATE Basic information such as the icon and content title of the notification is displayed. The complete content of the notification is not displayed.