Exposing Notification Settings to the Android System

Joe Birch
Joe Birch
Aug 20, 2018 · 2 min read

Have you ever looked at the Android System settings page for a specific application and wondered about the option to view “Additional settings in the app”? If you haven’t seen this before in your settings, or aren’t aware of it, this is what it looks like:

This option allows developers to essentially provide a link to a push notification settings screen in their application — this allows users to quickly and easily continue altering their notification settings for the chosen app directly from the system. The ability to hook into this was added at API level 21 (Android 5.0), but not all applications are making use of the feature.

To add this to your app we simply need to make use of the Notification Preferences Intent Category to define which activity to be launched when this link within the system settings is pressed. By default if our application has not make use of this Intent Category then the option within settings will not be displayed. If you want to display this option within your settings for your users then all you need to do is the following:

<activity android:name=”.PushSettingsActivity”>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category
.NOTIFICATION_PREFERENCES” />
</intent-filter>
</activity>

Now, the “Additional settings in the app” option will display on our application notification settings and when clicked, the PushSettingsActivity defined above will be launched.

Note: In some cases application setting screens will require the user to be logged in. Because of this, you may need to add some extra logic to your application to ensure that there is an authenticated user and if not, handling that case accordingly. Whilst the chance of this happening may be slim, it’s a small amount of work to ensure that the user doesn’t end up in a weird state.

Buffer Engineering & Data

Learnings, thoughts and musings from Buffer’s Engineering…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store