{"id":18876212,"url":"https://github.com/keyvaluesoftwaresystems/siren-android-inbox","last_synced_at":"2026-02-18T11:30:16.664Z","repository":{"id":227615444,"uuid":"761023252","full_name":"KeyValueSoftwareSystems/siren-android-inbox","owner":"KeyValueSoftwareSystems","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-12T12:50:34.000Z","size":247,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-04-14T02:13:38.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeyValueSoftwareSystems.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-21T05:00:59.000Z","updated_at":"2024-04-15T13:33:03.298Z","dependencies_parsed_at":"2024-04-15T13:33:00.554Z","dependency_job_id":"0b2f92e5-fb58-456c-b5cc-a73990ee9c6b","html_url":"https://github.com/KeyValueSoftwareSystems/siren-android-inbox","commit_stats":null,"previous_names":["keyvaluesoftwaresystems/siren-android-inbox"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-android-inbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-android-inbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-android-inbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeyValueSoftwareSystems%2Fsiren-android-inbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeyValueSoftwareSystems","download_url":"https://codeload.github.com/KeyValueSoftwareSystems/siren-android-inbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239832409,"owners_count":19704607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T06:11:41.373Z","updated_at":"2026-02-18T11:30:16.615Z","avatar_url":"https://github.com/KeyValueSoftwareSystems.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Siren Android Inbox\n\n## Overview\n\nThe `siren-android-inbox` sdk is a comprehensive and customizable android UI kit for displaying and managing notifications. This documentation provides comprehensive information on how to install, configure, and use the sdk effectively.\n\n## 1. Installation\n\nYou will need your sdk token for initializing your library.\n\n1. Add the JitPack repository to your build file\n```kotlin\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n2. Add the dependency\n\n```kotlin\ndependencies {\n    implementation 'com.github.KeyValueSoftwareSystems:siren-android-inbox:1.0.1'\n}\n```\n\n## 2. Configuration\n### 2.1 Initialization\n\nInitialize `SirenSDK` in `MainActivity` by passing the context, token, recipientId and errorCallback\n\n```kotlin\nimport com.keyvalue.siren.androidsdk.helper.client.SirenSDK\n\nclass MainActivity {\n    ...\n\n    val sirenSDK =\n        SirenSDK.getInstance(\n            context = applicationContext,\n            token = \"USER_TOKEN\",\n            recipientId = \"RECIPIENT_ID\",\n            object : ErrorCallback {\n                override fun onError(jsonObject: JSONObject) {\n                }\n            },\n        )\n    ...\n}\n```\n\n### 2.2 Configure notification icon\n\nThis composable function consists of a notification icon along with a badge to display the number of unviewed notifications.\n\n```kotlin\nimport com.keyvalue.siren.androidsdk.helper.customization.SirenInboxIconProps\n\nsirenSDK.SirenInboxIcon(\n    SirenInboxIconProps(\n        theme = customTheme,\n        darkMode = true,\n        customStyles = customStyles,\n        notificationIcon = CustomIcon(),\n    ),\n    object : SirenInboxIconCallback {\n        override fun onError(jsonObject: JSONObject) {\n        }\n\n        override fun onClick() {\n        }\n    },\n)\n\n```\n\n#### Parameters for notification icon\nBelow are optional parameters available for the icon composable function:\n\nParameter | Description | Type | Default value |\n--- | --- | --- | --- |\ntheme | Data class defining the theme configuration |  Theme | null |\ncustomStyles | Data class defining the customizable styles |  CustomStyles | null |\nnotificationIcon | Option to use custom notification icon | @Composable (() -\u003e Unit)? | null |\ndarkMode | Toggle to enable dark mode |  Boolean | false |\ndisabled | Toggle to disable click on icon |  Boolean | false |\nhideBadge | Toggle to hide the badge displayed on the notification icon | Boolean | false |\n\n### 2.3 Configure notification inbox\n\nInbox is a paginated list view for displaying notifications.\n\n```kotlin\nimport com.keyvalue.siren.androidsdk.helper.customization.SirenInboxProps\nimport com.keyvalue.siren.androidsdk.data.model.AllNotificationResponseData\n\nsirenSDK.SirenInbox(\n    SirenInboxProps(\n        theme = customTheme,\n        title = \"Notifications\",\n        hideHeader = false,\n        darkMode = true,\n    ),\n    object : SirenInboxCallback {\n        override fun onCardClick(notificationItem: AllNotificationResponseData) {\n        }\n\n        override fun onError(jsonObject: JSONObject) {\n        }\n    },\n)\n\n```\n\n#### Siren Inbox parameters\n\nGiven below are the list of parameters of the Siren inbox composable function:\n\nParameter | Description | Type | Default value |\n--- | --- | --- | --- |\ntheme | Data class defining the theme configuration |  Theme | null |\ncustomStyles | Data class defining the customizable styles |  Theme | null |\ntitle |  Title of the notification inbox |  String | \"Notifications\" |\nhideHeader | Toggle to hide the header section |  Boolean | false |\nhideClearAll | Toggle to hide the clear all button |  Boolean | false |\ndarkMode | Toggle to enable dark mode |  Boolean | false |\ncardProps | Props for customizing the notification cards | CardProps | null |\nlistEmptyComponent | Custom composable function for empty notification list | (@Composable () -\u003e Unit) | null |\ncustomHeader | Custom header composable function | (@Composable () -\u003e Unit) | null |\ncustomFooter | Custom footer composable function | (@Composable () -\u003e Unit) | null |\ncustomNotificationCard | Custom click handler for notification cards | (@Composable (AllNotificationResponseData) -\u003e Unit) | null |\ncustomLoader | Custom composable function to display the initial loading state | (@Composable () -\u003e Unit) | null |\ncustomErrorWindow | Custom error window | (@Composable () -\u003e Unit) | null |\nitemsPerFetch | Number of notifications fetch per api request (have a max cap of 50) | Int | 20\n\n##### CardProps\n```kotlin\ndata class CardProps(\n    val hideAvatar: Boolean? = false,\n)\n```\n#### Theme customization\n\nHere are the available theme options:\n\n\n```kotlin\nimport androidx.compose.ui.graphics.Color\n\ndata class Theme(\n    val dark: ThemeProps? = null,\n    val light: ThemeProps? = null,\n)\n\ndata class ThemeProps(\n    val colors: ThemeColors? = null,\n    val badgeStyle: BadgeThemeProps? = null,\n    val windowHeader: WindowHeaderThemeProps? = null,\n    val windowContainer: WindowContainerThemeProps? = null,\n    val notificationCard: NotificationCardThemeProps? = null,\n)\n\ndata class ThemeColors(\n    val primaryColor: Color? = null,\n    val textColor: Color? = null,\n    val neutralColor: Color? = null,\n    val borderColor: Color? = null,\n    val highlightedCardColor: Color? = null,\n    val dateColor: Color? = null,\n    val deleteIcon: Color? = null,\n    val timerIcon: Color? = null,\n    val clearAllIcon: Color? = null,\n    val infiniteLoader: Color? = null,\n)\n\ndata class BadgeThemeProps(\n    val color: Color? = null,\n    val textColor: Color? = null,\n)\n\ndata class WindowHeaderThemeProps(\n    val background: Color? = null,\n    val titleColor: Color? = null,\n    val headerActionColor: Color? = null,\n    val borderColor: Color? = null,\n)\n\ndata class WindowContainerThemeProps(\n    val background: Color? = null,\n)\n\ndata class NotificationCardThemeProps(\n    val borderColor: Color? = null,\n    val background: Color? = null,\n    val titleColor: Color? = null,\n    val descriptionColor: Color? = null,\n)\n```\n\n#### Style options\n\nHere are the custom style options:\n\n```js\nimport androidx.compose.ui.unit.Dp\nimport androidx.compose.ui.text.font.FontWeight\nimport androidx.compose.ui.unit.TextUnit\nimport androidx.compose.ui.graphics.Shape\n\ndata class CustomStyles(\n    val notificationIcon: NotificationIconStyle? = null,\n    val window: WindowStyle? = null,\n    val windowHeader: WindowHeaderStyle? = null,\n    val windowContainer: WindowContainerStyle? = null,\n    val notificationCard: NotificationCardStyle? = null,\n    val badgeStyle: BadgeStyle? = null,\n    val deleteIcon: DeleteIconStyle? = null,\n    val dateIcon: DateIconStyle? = null,\n    val clearAllIcon: ClearAllIconStyle? = null,\n)\n\ndata class NotificationIconStyle(\n    val size: Dp? = null,\n)\n\ndata class WindowStyle(\n    val width: Dp? = null,\n    val height: Dp? = null,\n)\n\ndata class WindowHeaderStyle(\n    val height: Dp? = null,\n    val titleFontWeight: FontWeight? = null,\n    val titleSize: TextUnit? = null,\n    val closeIconSize: Dp? = null,\n    val titlePadding: Dp? = null,\n)\n\ndata class WindowContainerStyle(\n    val padding: Dp? = null,\n)\n\ndata class NotificationCardStyle(\n    val padding: Dp? = null,\n    val borderWidth: Dp? = null,\n    val avatarSize: Dp? = null,\n    val titleFontWeight: FontWeight? = null,\n    val titleSize: TextUnit? = null,\n    val descriptionSize: TextUnit? = null,\n    val dateSize: TextUnit? = null,\n)\n\ndata class BadgeStyle(\n    val size: Dp? = null,\n    val textSize: TextUnit? = null,\n    val borderShape: Shape? = null,\n    val top: Int? = null,\n    val right: Int? = null,\n)\n\ndata class DeleteIconStyle(\n    val size: Dp? = null,\n)\n\ndata class DateIconStyle(\n    val size: Dp? = null,\n)\n\ndata class ClearAllIconStyle(\n    val size: Dp? = null,\n)\n\n```\n\n## 3. Functions\n\nUtility functions for modifying notifications:\n\nFunctions | Parameters | Type | Description |\n----------|------------|-------|------------|\nmarkNotificationsAsReadByDate | startDate | ISO date string | Sets the read status of notifications to true until the given date |\nmarkAsRead | id | string | Set read status of a notification to true          |\ndeleteNotification |  id | string  | Delete a notification by id |\ndeleteNotificationsByDate | startDate | ISO date string | Delete all notifications until given date |\nmarkNotificationsAsViewed | startDate | ISO date string |Sets the viewed status of notifications to true until the given date |\nupdateToken | userToken, recipientId | string | To change the tokens\n\nSample code:\n```kotlin\nimport com.keyvalue.siren.androidsdk.helper.client.SirenSDK\nimport com.keyvalue.siren.androidsdk.helper.client.callbacks.ErrorCallback\nimport com.keyvalue.siren.androidsdk.data.model.MarkAsReadByIdResponseData\nimport com.keyvalue.siren.androidsdk.helper.client.callbacks.MarkAsReadByIdCallback\n...\n    val sirenSDK =\n        SirenSDK.getInstance(\n            this,\n            \"userToken\",\n            \"recipientId\",\n            object : ErrorCallback {\n                override fun onError(jsonObject: JSONObject) {\n                }\n            },\n        )\n    fun markAsRead() {\n        sirenSDK.markAsRead(\n            notificationId = \"notificationId\",\n            callback = object : MarkAsReadByIdCallback {\n                override fun onSuccess(responseData: MarkAsReadByIdResponseData?) {\n                    // onSuccess\n                }\n                override fun onError(jsonObject: JSONObject) {\n                    // onError\n                }\n            }\n        )\n    }\n```\n\n## 4. Error codes\n\nGiven below are all possible error codes thrown by sdk.\n\nError code  | Description |\n--- | --- |\nTIMED_OUT  | Request timed out|\nINVALID_TOKEN  | The token passed is invalid |\nINVALID_RECIPIENT_ID  | The recipient id passed is invalid |\nTOKEN_VERIFICATION_FAILED | Verification of the given tokens has failed |\nGENERIC_API_ERROR  | Occurrence of an unexpected api error |\n\n## Example\n\nHere's a basic example to help you get started\n\n```kotlin\n\npackage com.keyvalue.sirensampleapp\n\n// Add all necessary imports\n...\nimport com.keyvalue.siren.androidsdk.data.model.AllNotificationResponseData\nimport com.keyvalue.siren.androidsdk.data.model.DataStatus\nimport com.keyvalue.siren.androidsdk.helper.client.SirenSDK\nimport com.keyvalue.siren.androidsdk.helper.client.callbacks.ErrorCallback\nimport com.keyvalue.siren.androidsdk.helper.client.callbacks.SirenAllNotificationUpdateCallback\nimport com.keyvalue.siren.androidsdk.helper.client.callbacks.SirenInboxCallback\nimport com.keyvalue.siren.androidsdk.helper.client.callbacks.SirenInboxIconCallback\nimport com.keyvalue.siren.androidsdk.helper.customization.SirenInboxIconProps\nimport com.keyvalue.siren.androidsdk.helper.customization.SirenInboxProps\n\n    // replace with userToken and recipientId\n\n    val sirenSDK =\n        SirenSDK.getInstance(\n            this,\n            \"userToken\",\n            \"recipientId\",\n            object : ErrorCallback {\n                override fun onError(jsonObject: JSONObject) {\n                }\n            },\n        )\n        \n    sirenSDK.SirenInboxIcon(\n        SirenInboxIconProps(\n            darkMode = true,\n            notificationIcon = {\n                Icon(\n                    imageVector = Icons.Default.Notifications,\n                    tint = Color(236, 155, 112, 255),\n                    modifier = Modifier.size(100.dp),\n                )\n            },\n        ),\n        object : SirenInboxIconCallback {\n            override fun onError(jsonObject: JSONObject) {\n                // onError\n            }\n\n            override fun onClick() {\n                // onClick\n            }\n        },\n    )\n\n    sirenSDK.SirenInbox(\n        SirenInboxProps(),\n        object : SirenInboxCallback {\n            override fun onCardClick(notificationItem: AllNotificationResponseData) {\n                // onClick\n            }\n\n            override fun onError(jsonObject: JSONObject) {\n                // onError\n            }\n        },\n    )\n\n    fun deleteNotification() {\n        sirenSDK.deleteNotification(\n            notificationId = \"notificationId\",\n            callback = object : SirenAllNotificationUpdateCallback {\n                override fun onSuccess(dataStatus: DataStatus?) {\n                    // onSuccess\n                }\n\n                override fun onError(jsonObject: JSONObject) {\n                    // onError\n                }\n            }\n        )\n    }\n\n    fun updateToken() {\n        sirenSDK.updateToken(\n            userToken = \"userToken\",\n            recipientId = \"recipientId\"\n        )\n    }\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvaluesoftwaresystems%2Fsiren-android-inbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyvaluesoftwaresystems%2Fsiren-android-inbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyvaluesoftwaresystems%2Fsiren-android-inbox/lists"}