reliefapps/notification-bundle
Symfony bundle that adds a flexible notification system to your app: create, persist, and deliver notifications to users through configurable channels. Includes Doctrine integration, Twig templates, and simple setup so you can wire notifications into existing projects quickly.
symfony/symfony: ^3.0-era conventions: AppKernel registration, manual app/config/config.yml import). There is no Flex recipe, no config/bundles.php, and autowiring is not assumed. If you're on Symfony 4+, budget time for a fork or a Symfony 3 service container compatibility layer before doing anything else.composer require reliefapps/notification-bundle:@dev
If Packagist resolution fails, add it as a VCS repository in composer.json and pin a specific commit.AppKernel. Add new Relief\NotificationsBundle\AppNotificationsBundle() to registerBundles(). There is likely no routing to import if the bundle is purely a service layer.DependencyInjection/Configuration.php before anything else. With 3 stars, no dependents, and no maintained documentation, the config tree is the documentation. Open it and note the exact keys for the APNs certificate path/passphrase and the GCM/FCM API key, plus any host/sandbox flags.# app/config/config.yml
app_notifications:
apns:
certificate: "%kernel.root_dir%/config/certs/apns_prod.pem"
passphrase: "%apns_passphrase%"
sandbox: false
gcm:
api_key: "%gcm_api_key%"
Keep the .pem and the API key out of version control; load the passphrase from parameters.yml/env.Command that resolves the bundle's notification service and pushes a single test payload to one hardcoded device token per platform. Don't wire it into domain logic until both APNs and GCM return success. Verify the service ID with bin/console debug:container | grep -i notif since the public service name isn't documented.AppNotificationDispatcher that injects the bundle's sender(s) and exposes domain-level methods (notifyUser(User $u, string $title, array $data)). When you eventually need to swap in a maintained library, you change one class instead of every caller.device_token + platform in your own table and loop, calling the correct sender for each row. Do not expect the bundle to know your user model.foreach ($tokens as $token) {
try {
$sender->send($token, $payload);
} catch (\Exception $e) {
$this->logger->warning('push failed', ['token' => $token, 'err' => $e->getMessage()]);
// mark token stale for later pruning
}
}
A single expired token should never abort the rest of the batch.sandbox: true in dev and test, false in prod. The most common day-to-day bug is a developer testing against production APNs with a sandbox token (or vice versa) and getting silent "success but nothing arrives."services_test.yml, decorate or alias the bundle's sender with a fake that records payloads, so functional tests can assert "a notification was queued for user X" without hitting Apple or Google.aps/data array yourself and hand it to the sender. This keeps you portable and lets you assert on payload shape in unit tests.vendor/ via a Composer patch plugin. Do not build a long-term roadmap on it.symfony/notifier covers push transports and is maintained) rather than adopt this..pem + passphrase), it will still work for legacy certs but not with the modern .p8 token-based flow (JWT). Certificate expiry is a classic 3 a.m. page — put an expiry reminder on the cert and monitor APNs response codes, not just exceptions.200 even for some rejected payloads; GCM returns 200 with an error body. Log the raw response body and HTTP status for every send, not just thrown exceptions. If the bundle swallows responses, wrap the call and inspect what you can.data blobs (image URLs are fine, base64 images are not) get dropped silently. Validate size in your dispatcher before calling.debug:container and reference it by ID in your services.yml.vendor/.curl against api.push.apple.com or the FCM endpoint using the same credentials. If curl succeeds and the bundle fails, the problem is config resolution or the payload; if both fail, it's credentials or network — that split saves hours.How can I help you explore Laravel packages today?