Overview
The@sirenapp/react-native-inbox SDK is a comprehensive and customizable React Native UI kit for displaying and managing notifications. This documentation provides comprehensive information on how to install, configure, and use the SDK effectively.
Installation
Configuration
Initialization
Initialize the SDK with the user token and recipient ID. Wrap the provider around your App’s root.Configure Notification Icon
This component consists of a notification icon along with a badge to display the number of unviewed notifications.Icon Props
| Prop | Description | Type | Default | 
|---|---|---|---|
| theme | Object for custom themes | Theme | {} | 
| customStyles | Object for custom styling | CustomStyleProps | {} | 
| notificationIcon | Option to use custom notification icon | JSX.Element | null | 
| darkMode | Toggle to enable dark mode | boolean | false | 
| onError | Callback for handling errors | (error: SirenErrorType) => void | null | 
| onPress | Custom click handler | () => void | null | 
| disabled | Disable click on icon | boolean | false | 
| hideBadge | Hide unviewed count badge | boolean | false | 
Customization
Theme Customization
Style Customization
Configure Notification Inbox
Inbox is a paginated list view for displaying notifications.Inbox Props
| Prop | Description | Type | Default | 
|---|---|---|---|
| theme | Object for custom themes | Theme | {} | 
| customStyles | Object for custom styling | CustomStyleProps | {} | 
| darkMode | Toggle dark mode | boolean | false | 
| itemsPerFetch | Notifications per request (max 50) | number | 20 | 
| cardProps | Card customization | CardProps | See below | 
| customCard | Custom card renderer | (notification) => JSX.Element | null | 
| onCardClick | Card click handler | (notification) => void | () => null | 
| listEmptyComponent | Empty state component | JSX.Element | null | 
| headerProps | Header customization | HeaderProps | See below | 
| customFooter | Custom footer component | JSX.Element | null | 
| customLoader | Custom loading component | JSX.Element | null | 
| customErrorWindow | Custom error component | JSX.Element | null | 
| onError | Error handler | (error: SirenErrorType) => void | null | 
Customization
Theme Customization
Style Customization
CardProps
HeaderProps
Hooks
useSiren
useSiren is a hook that provides utility functions for modifying notifications.
useSiren Functions
| Function | Parameters | Type | Description | 
|---|---|---|---|
| markAsReadByDate | startDate | string(ISO date) | Marks notifications as read until given date | 
| markAsReadById | id | string | Marks a notification as read | 
| deleteById | id | string | Deletes a notification by ID | 
| deleteByDate | startDate | string(ISO date) | Deletes notifications until given date | 
| markAllAsViewed | startDate | string(ISO date) | Marks notifications as viewed until given date |