# stringsaeed/react-native-notifications-utils architecture

> Architecture diagram of the GitHub repository stringsaeed/react-native-notifications-utils, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stringsaeed/react-native-notifications-utils
- Repository: https://github.com/stringsaeed/react-native-notifications-utils

## Overview

##### Main Components

a. JavaScript/TypeScript Layer
- Entry point (index.ts)
- NotificationsUtilsModule.ts
- Type definitions

b. Native Bridges
- iOS Bridge (Swift/Objective-C)
- Android Bridge (Java)

c. Platform-specific Settings
- iOS Settings App Integration
- Android Settings App Integration
- Android Notification Channel Support

**┌─────────────────────────────────────────┐**
- React Native Layer            │
- ┘
- ↕
**┌─────────────────────────────────────────┐**
- Native Bridge Interface         │
- ┘
- ↕
**┌───────────────────┐     ┌───────────────┐**
- iOS Platform    │     │Android Platform│
- ┘     └───────────────┘

##### Component Details

a. React Native Layer:
- Main module export
- TypeScript interfaces
- Public API methods (openSettings)

b. Native Bridge Interface:
- NotificationsUtilsModule bridge definition
- Platform-specific method mapping

c. Platform-specific Implementation:
- iOS: UIKit integration (openNotificationSettingsURLString)
- Android: Intent system for settings navigation
- Android: Notification Channel support for API 26+

##### Flow Indicators
- Version-specific branching logic

##### Additional Elements

- iOS: Xcode 14+ (iOS 16)
- Android: API level branching (26+)

##### Public API simplicity

Keep the abstraction level focused on the architectural components while showing the key integration points with the native platform settings. This will help developers understand both the high-level structure and the platform-specific implementation details.

- Rectangles for modules
- Rhombuses for decision points
- Clear labels for all components and versions

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and classes
    classDef jsLayer fill:#3498db,color:white
    classDef nativeBridge fill:#2ecc71,color:white
    classDef ios fill:#e67e22,color:white
    classDef android fill:#e74c3c,color:white
    classDef config fill:#95a5a6,color:white
    classDef test fill:#9b59b6,color:white

    %% React Native / JavaScript Layer
    subgraph RNLayer["React Native Layer"]
        Entry["Entry Point (index.ts)"]
        ModuleDef["NotificationsUtilsModule.ts"]
        TypeDefs["Type Definitions"]
        Tests["Type Testing"]
    end

    %% Native Bridge Interface
    subgraph Bridge["Native Bridge Interface"]
        NativeBridge["Native Module Bridge"]
        ModuleConfig["Native Module Configuration"]
    end

    %% iOS Implementation
    subgraph iOS["iOS Platform"]
        iOSBridge["iOS Native Bridge (Swift/Obj-C)"]
        iOSConfig["iOS Platform Config"]
        iOSSettings["iOS Settings Integration"]
    end

    %% Android Implementation
    subgraph Android["Android Platform"]
        AndroidBridge["Android Native Bridge (Java)"]
        AndroidConfig["Android Platform Config"]
        AndroidSettings["Android Settings Integration"]
        NotificationChannel["Notification Channel Support"]
    end

    %% Relationships
    Entry --> ModuleDef
    ModuleDef --> NativeBridge
    TypeDefs --> ModuleDef
    Tests --> Entry

    NativeBridge --> iOSBridge
    NativeBridge --> AndroidBridge
    ModuleConfig --> iOSBridge
    ModuleConfig --> AndroidBridge

    iOSBridge --> iOSSettings
    AndroidBridge --> AndroidSettings
    AndroidBridge --> NotificationChannel

    %% Style Applications
    class Entry,ModuleDef,TypeDefs jsLayer
    class NativeBridge,ModuleConfig nativeBridge
    class iOSBridge,iOSConfig,iOSSettings ios
    class AndroidBridge,AndroidConfig,AndroidSettings,NotificationChannel android
    class Tests test

    %% Click Events
    click Entry "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/src/index.ts"
    click ModuleDef "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/src/NotificationsUtilsModule.ts"
    click Tests "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/src/__tests__/index.test.tsx"
    click iOSBridge "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/ios/NotificationsUtils.swift"
    click AndroidBridge "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/android/src/main/java/com/reactnativenotificationsutils/NotificationsUtilsModule.java"
    click AndroidConfig "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/android/src/main/AndroidManifest.xml"
    click iOSConfig "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/ios/NotificationsUtils.xcodeproj/project.pbxproj"
    click ModuleConfig "https://github.com/stringsaeed/react-native-notifications-utils/blob/main/react-native-notifications-utils.podspec"

    %% Legend
    subgraph Legend
        JS["JavaScript Layer"]:::jsLayer
        NB["Native Bridge"]:::nativeBridge
        IOS["iOS Components"]:::ios
        AND["Android Components"]:::android
        TST["Testing"]:::test
    end
```
