# Copyright 2026, Jiri Eischmann <jiri@eischmann.cz> and the meshy contributors
# SPDX-License-Identifier: GPL-3.0-or-later

"""Platform notification facade.

Exports ``NotificationService`` from the platform backend:
- Linux: GIO notification backend using Gio.Notification
- macOS: Native UserNotifications framework (UNUserNotificationCenter)

IMPORTANT - macOS Limitation:
The native UserNotifications framework requires a properly signed Python executable.
Homebrew Python has only ad-hoc signatures which UNUserNotificationCenter rejects.
For notifications to work on macOS, use either:
- Python from python.org (properly signed)
- Bundled Python framework (signed with Developer ID)
"""

import sys

if sys.platform == "darwin":
    from .platforms.macos.notification_native import (
        MacOSNotificationService as NotificationService,
    )
else:
    try:
        from .platforms.linux.notification_gio import (
            GioNotificationService as NotificationService,
        )
    except ImportError:
        from .platforms.notification_base import (
            NotificationService as _Base,
        )

        class NotificationService(_Base):  # type: ignore[no-redef]
            def send_notification(self, title, body, notification_id):
                pass

            def is_supported(self):
                return False


__all__ = ["NotificationService"]
