> ## Documentation Index
> Fetch the complete documentation index at: https://docs.castled.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Default App Inbox

> [!NOTE]
>
> **Prerequisites**
>
> * [SDK integration completed](https://docs.castled.io/developer-resources/sdk-integration/android/getting-started.md)
> * `enableAppInbox` config set to `true` during SDK initialization.

This is the easiest way to add **App Inbox** functionality to your mobile app. In this setup app will be using the default notification
center activity provided by the SDK for displaying inbox messages and managing them. You can also customize the appearance of the notification center activity
to match your app theme.

### Displaying App Inbox Contents

You can lauch notification center activity to display **App Inbox** messages. Following code snippet can be used whenever you want to show inbox messages to the app user.

```kotlin kotlin
CastledNotifications.showAppInbox(context, styleConfig)
```

```java java
CastledNotifications.showAppInbox(context, styleConfig);
```

Acitivity appearance can be customized using `styleConfig`. More details below.

### Customising App Inbox Display

```kotlin kotlin
  // Customise the App Inbox styling using the below mentioned parameters
  val styleConfig = CastledInboxDisplayConfig()
  styleConfig.emptyMessageViewText = "There are no inbox items."
  styleConfig.emptyMessageViewTextColor = "#000000"
  styleConfig.inboxViewBackgroundColor = "#ffffff"
  styleConfig.navigationBarBackgroundColor = "#0000ff"
  styleConfig.navigationBarTitleColor = "#ffffff"
  styleConfig.navigationBarTitle = "Castled Inbox"
  styleConfig.hideNavigationBar = true
  styleConfig.hideBackButton = false                     // Set to true if back button needs to be hidden
  styleConfig.backButtonResourceId = myCustomButtonResId // Required only if you want to override default back button


  // Categories tab styling
  styleConfig.showCategoriesTab = true
  styleConfig.tabBarDefaultBackgroundColor ="#00203F"
  styleConfig.tabBarSelectedBackgroundColor = "#EEA47F"
  styleConfig.tabBarDefaultTextColor = "#ADEFD1"
  styleConfig.tabBarSelectedTextColor = "#00539C"
  styleConfig.tabBarIndicatorBackgroundColor = "#FEE715"

  CastledNotifications.showAppInbox(context, styleConfig)
```

```java java
  // Customise the App Inbox styling using the below mentioned parameters
  CastledInboxDisplayConfig styleConfig = new CastledInboxDisplayConfig();
  styleConfig.setEmptyMessageViewText("There are no inbox items");
  styleConfig.setEmptyMessageViewTextColor("#000000");
  styleConfig.setInboxViewBackgroundColor("#FFFFFF");
  styleConfig.setNavigationBarBackgroundColor("#0000FF");
  styleConfig.setNavigationBarTitleColor("#FFFFFF");
  styleConfig.setNavigationBarTitle("Castled Inbox");
  styleConfig.setHideNavigationBar(false);
  styleConfig.setHideBackButton(false);                     // Set to true if back button needs to be hidden
  styleConfig.setBackButtonResourceId(myCustomButtonResId); // Required only if you want to override default back button

  // Categories tab styling
  styleConfig.setShowCategoriesTab(true);
  styleConfig.setTabBarDefaultBackgroundColor("#00203F");
  styleConfig.setTabBarSelectedBackgroundColor("#EEA47F");
  styleConfig.setTabBarDefaultTextColor("#ADEFD1");
  styleConfig.setTabBarSelectedTextColor("#00539C");
  styleConfig.setTabBarIndicatorBackgroundColor("#FEE715");

  CastledNotifications.showAppInbox(context, styleConfig);

```

### Retrieving Unread Message Count

The SDK offers method to obtain the count of unread messages, suitable for display purposes.
One use case is to show the unread message count as a badge on notification bell icon to prompt user to check on pending inbox items.

```kotlin kotlin
  CastledNotifications.getInboxUnreadCount {
    // do something with unread count $it
  }
```

```java java
  CastledNotifications.getInboxUnreadCount(count -> {
    // do something with unread count
  });
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.