Skip to content
Türkçe

Introducing Magic Notifications 1.2.1

In-app and push, through one facade.

In-app database notifications and OneSignal push for the Magic framework, with polling, realtime delivery, user preferences and a CLI.

Runs on

  • Android
  • iOS
  • Web
  • macOS
  • Windows
  • Linux

Two channels. One facade.

Notifications for a Magic app go through Notify: an in-app database channel and OneSignal push. A backend is required; the docs include a Laravel setup guide.

In-app database channel

Notify.notifications() streams the user's notifications and Notify.markAsRead(id) marks one as read, through NotificationManager.

  • Notify.notifications() answers the cached list at once, then every later change
  • DatabaseChannel.send does nothing, because your backend creates the inbox rows
Read the docs
await Notify.fetchNotifications();
await Notify.markAsRead('550e8400-e29b-41d4-a716-446655440000');

OneSignal push

Push on iOS, Android and the web, with a soft prompt before the system prompt. PushReachability is unavailable, blocked, off or on; elsewhere push is absent.

  • Push runs on iOS, Android and web; elsewhere PushDriver.isSupported is false
  • Push to other people comes from your backend; PushChannel is self-addressed
Read the docs
Future<void> onSignIn(String userId) async {
  await Notify.initializePush('user_$userId');
  await Notify.startRealtime(channel: 'App.Models.User.$userId');
  Notify.startPolling();
}

Polling you control

Use Notify.startPolling(), stopPolling(), pausePolling() and resumePolling(). Your app starts it; the interval is notifications.database.polling_interval.

  • The default interval is 30 seconds, and polling_interval is clamped to 5 to 600
  • startPolling is a no-op while the socket is live; the provider starts none
Read the docs

Realtime delivery

Notify.startRealtime() delivers notifications over a socket through magic_socket, on the notification.created event.

  • startRealtime returns false and changes nothing without broadcasting.default
  • A dropped socket resumes polling, and a repeated frame replaces its row by id
Read the docs

User preferences

NotificationPreferencesView is a ready preferences screen, with a controller and a model for per-user preferences.

  • It needs GET and PUT /notification-preferences on your backend
  • The package ships no translation catalogue; a missing key renders as itself
Read the docs
Notify.view.register('notifications.preferences', () {
  return const NotificationPreferencesView(backRoute: '/settings');
});

Installer and doctor

A dowel CLI with notifications:install and a doctor, plus two read-only MCP tools for AI tools: notifications_doctor and notifications_channels.

  • notifications:doctor exits 1 when a requirement is missing
  • The APNs key upload, iOS App Group and Notification Service Extension stay manual
Read the docs
platforms
6
commands to install
2
license
MIT

Your agent speaks Magic Notifications.

The Magic Notifications skill teaches your coding assistant the Notify facade, the backend-driven inbox and the OneSignal push rules before the first line. One command wires it up.

npx skills add anilcancakir/ai --skill magic-notifications

run in your project other editors

works with

  • Claude Code
  • Cursor
  • OpenCode
  • VS Code Copilot
  • Codex CLI

And checks the docs.

Skills teach the API. The MCP server at mcp.anilcancakir.com/magic_notifications gives your agent live docs lookup while it edits, so it never guesses a signature.

  • Streamable HTTP

    One endpoint, every client.

  • search-docs

    Live query against the source.

  • Public, no auth

    Read-only, free to use.

Connect your editor
mcp.anilcancakir.com/magic_notifications preview

# streamable http, the default

claude mcp add --transport http magic_notifications https://mcp.anilcancakir.com/magic_notifications

# or stdio, for clients without http

npx -y mcp-remote https://mcp.anilcancakir.com/magic_notifications

Public, no auth.

Questions, answered.

What people ask before they add Magic Notifications to a Flutter app.

What is Magic Notifications?

Magic Notifications is the notification plugin for Magic apps. The Notify facade reads your Laravel backend's inbox, ships the inbox and preferences screens, wires OneSignal push on iOS, Android and web, and takes new rows over magic_socket with polling as the fallback.

How do I install Magic Notifications?

Run flutter pub add magic_notifications, then dart run magic:dowel plugin:install magic_notifications and dart run magic:dowel notifications:install. The installer asks for the OneSignal App ID; dart run magic:dowel notifications:doctor reports what is still missing.

Which platforms does Magic Notifications support?

The inbox runs wherever Flutter does. Push runs on iOS and Android through the OneSignal SDK and on the web through the OneSignal Web SDK; elsewhere PushDriver.isSupported is false and reachability reads unavailable.

What backend does Magic Notifications need?

One that serves the notification endpoints: GET /notifications and GET /notifications/unread-count for the inbox, and GET and PUT /notification-preferences for the preferences screen. The docs include a Laravel setup guide.

Can Magic Notifications send email?

No. There is no mail channel; a mail entry in via() is logged as an unknown channel and skipped. Push to other people is sent by your backend, because PushChannel is self-addressed and can only page the signed-in user.

Does Magic Notifications work with AI coding agents?

Yes. Magic Notifications ships an agent skill that teaches your assistant the Notify facade, the backend-driven inbox and the OneSignal push rules, plus a public docs MCP server for live lookup.

Is Magic Notifications open source?

Yes. Magic Notifications is open source under the MIT license.

Add it in seconds

~/my_app
flutter pub add magic_notifications

Or add to pubspec.yaml:

dependencies:
  magic_notifications: ^1.2.1

Or give your AI agent this prompt:

Read https://anilcancakir.com/magic/docs/notifications/llms.txt and install the Magic Notifications package in this project.