Exposing Notification Settings to the Android System

Aug 17, 2018 2 min readOverflow
Photo of Joe Birch
Joe Birch

Senior Engineer @ Buffer

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.

Brought to you by

Try Buffer for free

140,000+ small businesses like yours use Buffer to build their brand on social media every month

Get started now

Related Articles

OverflowJul 12, 2024
How We're Preventing Breaking Changes in GraphQL APIs at Buffer — and Why It's Essential for Our Customers

As part of our commitment to transparency and building in public, Buffer engineer Joe Birch shares how we’re doing this for our own GraphQL API via the use of GitHub Actions.

OverflowDec 13, 2022
Highlighting Text Input with Jetpack Compose

We recently launched a new feature at Buffer, called Ideas. With Ideas, you can store all your best ideas, tweak them until they’re ready, and drop them straight into your Buffer queue. Now that Ideas has launched in our web and mobile apps, we have some time to share some learnings from the development of this feature. In this blog post, we’ll dive into how we added support for URL highlighting to the Ideas Composer on Android, using Jetpack Compose. We started adopting Jetpack Compose into ou

OverflowApr 18, 2022
Secure Access To Opensearch on AWS

With the surprising swap of Elasticsearch with Opensearch on AWS. Learn how the team at Buffer achieved secure access without AWS credentials.

140,000+ people like you use Buffer to build their brand on social media every month