# Customizing notifications

-Batch allows you to customize your notifications adding specific keys to the payload or by setting some configuration in native code.

Advanced notification configuration is highly OS-specific and requires implementation at a lower level than Flutter.\
Therefore, you might find what you want in the native documentations for each OS:

* [iOS](/developer/sdk/ios/advanced/customizing-notifications.md)
* [Android](/developer/sdk/android/advanced/customizing-notifications.md)

### Small push notification icon

In order to make sure that users understand that your notifications come from your app, you need to setup a Small Icon and Notification Color. An icon can be generated using Android Studio's asset generator: as it will be tinted and masked by the system, only the alpha channel matters and will define the shape displayed. It should be of 24x24dp size. If your notifications shows up in the system statusbar in a white shape, this is what you need to configure.

This can be configured in the manifest as metadata in the application tag:

{% code title="AndroidManifest.xml" %}

```xml
<!-- Assuming there is a push_icon.png in your res/drawable-{dpi} folder -->

<manifest ...>
    <application ...>
        <meta-data
            android:name="com.batch.android.push.smallicon"
            android:resource="@drawable/push_icon" />

        <!-- Notification color. ARGB but the alpha value can only be FF -->
        <meta-data
            android:name="com.batch.android.push.color"
            android:value="#FF00FF00" />
```

{% endcode %}

For more information, please see the android native [documentation](/developer/sdk/android/advanced/customizing-notifications.md#setting-up-custom-push-icons).

### Disabling foreground notifications

By default, the Batch Flutter plugin will always show foreground notifications on both platforms.

The SDK exposes a method on `BatchPush` to change this behaviour on iOS only:

```dart
BatchPush.instance.setShowForegroundNotificationsOniOS(false);
```

{% hint style="info" %}

* This requires your app to use `BatchUNUserNotificationCenterDelegate` as described in the native integration. If you made your own `UNUserNotificationCenterDelegate` subclass, the Dart API will not do anything and you will have to implement this manually.
* Disabling foreground notifications on iOS will automatically trigger mobile landings when attached to a push received while the App is in foreground. You can have the same behaviour on android by using the native API `Batch.Messaging.setShowForegroundLandings(true)` but the sdk will still display foreground notifications when no landing is attached.
  {% endhint %}

### Managing Android notification display

You can restrict notification display on Android by calling :

```js
BatchPush.instance.setShowNotifications(false);
```

#### Re-enabling notifications:

```js
BatchPush.instance.setShowNotifications(true)
```

{% hint style="info" %}
Batch will remember this value, even if your Application reboots. You can ask to Batch whether notifications are disabled or not with : `BatchPush.instance.shouldShowNotifications()` .
{% endhint %}

### Adding notification actions

Notification actions are supported but they integration differ greatly between iOS and Android. Please see the native documentations for more info:

* [Android](/developer/sdk/android/advanced/customizing-notifications.md#adding-actions-to-notifications)
* [iOS](/developer/sdk/ios/advanced/adding-notification-actions.md)

### Overriding the notification channel on Android

It is possible to override the default notification channel on Android either globally on a per notification basis.

As this is an operation that needs to be done by native code in the background when Flutter isn't running, please follow our [native channels documentation](/developer/sdk/android/advanced/notification-channels.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.batch.com/developer/sdk/flutter/advanced/customizing-notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
