NotificationServiceProvider class

Binds notifications into magic's container and wires the push driver.

Register it in your app's kernel:

(app) => NotificationServiceProvider(app),

The register / boot split

register binds ONE string-keyed singleton and does nothing else. It runs the moment the provider is registered, which is before every other provider has bound anything, so a driver resolved there would be resolved against a half-built container. boot runs after all of them and is where the driver, the channels and the first identity reconcile are wired.

The configuration root, and the one key that selects a driver

This package reads notifications.* and nothing else. notifications.push.driver names a driver by the name it was REGISTERED under, and onesignal is the only one this package ships.

An ABSENT key is an answer: an app with no push configured is a supported build, it stays quiet, and everything except push keeps working. A value this package cannot serve is the opposite and is reported at error level before boot degrades, because a silent acceptance leaves the operator believing push was wired when nothing was.

A driver of your own is installed in code, with Notify.extend(name, factory) before this provider boots; the container has no reflection to turn a string into a constructor. The built-in goes through that same registry rather than being constructed here, so the shipped driver and an override travel one path.

Constructors

NotificationServiceProvider(MagicApp app)
Creates the provider against app, magic's container.

Properties

app → MagicApp
Reference to the application container.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

boot() → Future<void>
Bootstrap any application services.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register() → void
Register any application services.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

pushInitializationError → Object?
The failure of the last push initialisation, or null when the last boot initialised cleanly or had no push driver to initialise.
no setter