stocarul/urban-airship-bundle
Symfony bundle for integrating Urban Airship push notifications into PHP apps, with service configuration and convenient APIs for sending mobile notifications.
First, an honest framing: this is a Symfony bundle, not a Laravel package. There is no service provider auto-discovery, no config/ publish tag, and no facade. The bundle's actual value is thin — it mostly wires the underlying Urban Airship PHP SDK (urbanairship/php-library or the newer REST wrapper) into Symfony's DI container with config-driven credentials. For a day-to-day Laravel workflow you will almost certainly skip the bundle and depend on the SDK directly, then reproduce the bundle's service wiring inside your own service provider.
Minimal path:
composer require urbanairship/php-library (or whatever the bundle's composer.json pins — check that file first; it is the single source of truth for what library version you are actually getting).DependencyInjection/Configuration.php — it enumerates the config keys the bundle expects (typically app_key, master_secret, and an environment/development/production switch). Mirror these as config/urbanairship.php + .env entries.Resources/config/services.yml to see the service ID and class the bundle exposes (usually a single UrbanAirship\Airship-style client). Bind that same class as a singleton in AppServiceProvider or a dedicated UrbanAirshipServiceProvider.config('urbanairship.app_key') and config('urbanairship.master_secret'), build a push with a notification payload and an audience selector, and call send(). Use the sandbox/dev environment flag first; you do not want to wake up 50k real devices while testing.If you insist on using the bundle itself, you will need Symfony's kernel or a micro-Symfony alongside Laravel, which is not worth it for the ~50 lines of glue it provides.
config/urbanairship.php returning ['app_key' => env('UA_APP_KEY'), 'master_secret' => env('UA_MASTER_SECRET'), 'environment' => env('UA_ENV', 'development')]. Cache-safe because you only read env inside the config file.$this->app->singleton(UrbanAirshipClient::class, fn () => new Airship(config(...))). The SDK client holds the HTTP transport; there is no reason to build one per request.$client->push()->setAudience(...) directly. Create App\Services\PushNotifier with methods like notifyUser(User $user, string $title, string $body) and notifyTag(string $tag, ...). This keeps the UA-specific audience/payload shapes out of your app code and makes swapping providers trivial.devices table keyed by user_id + platform + token, with a last_seen_at. You need this for targeted pushes. The bundle does not manage device registration for you — it is purely server-side push sending.ShouldQueue job (SendPushNotification). UA calls are network-bound and occasionally slow; doing them synchronously in a web request degrades UX and risks timeouts. Use a dedicated queue connection and a retryUntil tuned to your SLA.tag:user-{id}, tag:pref-news. UA supports named users and tags — the API wrapper exposes both audiences. Prefer tags/named users over maintaining a local subscriber list, since UA handles the intersection logic for you.@group integration for real credentials.php artisan vendor:publish will not find it. Any tutorial mentioning app/AppKernel.php or services: urban_airship: is Symfony-only. Budget an hour to translate; it is small.urbanairship/php-library commit in composer.lock and read its source once to know the method names — the bundle only exposes what the SDK already does.app_key:master_secret), newer REST endpoints use an OAuth bearer token. If auth fails with a 401, first confirm which auth scheme the pinned SDK uses — the bundle's config keys may not map cleanly to a token flow.202 Accepted, not 200. UA queues pushes; a queued response does not mean the push was delivered. If you need delivery confirmation, use the push ID returned and poll the reports endpoint — this is out of scope for the bundle, so wire it yourself if it matters.extra/custom data silently truncates or errors depending on device type. Validate payload size in your service wrapper before calling UA.php artisan config:cache, editing .env is a no-op. Add config:clear to your deploy script before config changes, and never call env() outside config files.config/urbanairship.php with secrets baked in from copying the bundle's example Symfony config. Use env() only.Log::info the push ID, wrap the call in retry(3, ...) with backoff), not in the bundle.send() and compare against UA's API reference. The bundle adds no logic that could be the culprit — it is only wiring.How can I help you explore Laravel packages today?