- Does duccio/apns-php work with Laravel?
- It can be installed with Composer inside a Laravel app, but it is not a Laravel package in any practical sense. There is no service provider, config file, facade, notification channel, or queue integration, so credentials, connection lifecycle, and error handling all have to be wired manually. More importantly, it targets Apple's legacy binary APNs gateway, which Apple shut down on March 31, 2021, so it cannot deliver a notification to a production device today. For new Laravel work, use an HTTP/2 client with JWT token authentication instead.
- Why is duccio/apns-php considered obsolete?
- The library speaks Apple's legacy binary provider protocol over TLS, connecting to gateway.push.apple.com on port 2195 and feedback.push.apple.com on port 2196. Apple decommissioned those endpoints on March 31, 2021 in favor of the HTTP/2 provider API. Connections to the old gateways now fail, so the package cannot send a single push in production. Its last tagged release was June 2016, before PHP 7.2 and 8.x existed.
- What PHP and Laravel versions does duccio/apns-php support?
- The last release dates to June 2016, so it predates PHP 7.2 and has no explicit PHP 8 support. Under Laravel 9 or later, which require PHP 8.0+, expect deprecation notices, dynamic property warnings, and possible runtime errors in string-offset and TLS handling. Any fix becomes an unsupported local fork that your team owns and maintains. That alone is usually enough reason to skip it for greenfield work.
- Does duccio/apns-php support HTTP/2, JWT provider tokens, or .p8 keys?
- No. Authentication is certificate-only, using a .pem file that contains both the certificate and the private key, sent over the legacy binary protocol. There is no HTTP/2 transport, no JWT provider token signing, and no support for .p8 keys. Certificate rotation therefore becomes a recurring manual operational task with hard expiry failure if it is missed.
- How do I send a push notification with duccio/apns-php?
- The typical pattern is to construct an ApnsPHP\Push instance with a certificate path and environment, add one or more ApnsPHP\Message recipients, then call connect, send, and disconnect. It is a stateful per-process client designed for long-running scripts, which maps poorly onto Laravel request handlers and short-lived queue workers. In practice it encourages synchronous network I/O inside a request, which you should avoid regardless of protocol.
- How do I handle invalid or expired device tokens with duccio/apns-php?
- The package relies on Apple's feedback service at feedback.push.apple.com:2196 to discover tokens that should be pruned from your database. That service is decommissioned as well, and modern APNs instead returns per-request error codes such as 410 Unregistered or BadDeviceToken. Because the library does not surface per-notification responses, token hygiene logic has to be rebuilt from scratch during any migration. Budget for that work explicitly.
- What is a good alternative to duccio/apns-php for Laravel?
- Use a client built on Apple's current HTTP/2 provider API, ideally with .p8 JWT token authentication. Common options include edamov/pushok, the laravel-notification-channels/apn notification channel, or a thin wrapper around Laravel's HTTP client if you want full control over headers such as apns-topic, apns-push-type, and apns-priority. Verify that whichever package you choose is actively maintained and supports PHP 8.x and current Laravel releases before committing to it.
- What are the payload size limits in duccio/apns-php?
- It follows the legacy enhanced binary format, which caps payloads at 2 KB. The current HTTP/2 API allows 4 KB, so reusing existing message-building code will silently truncate or reject larger payloads such as rich media and VoIP notifications. Headers for collapse IDs, push type, and priority are also either missing or hand-rolled as binary frames.
- Can duccio/apns-php send VoIP, critical alerts, or Live Activities pushes?
- Not reliably. Anything beyond a basic alert push, including background and silent pushes, VoIP, critical alerts, rich media, and Live Activities, is either unsupported or requires hand-rolled binary frames against a protocol Apple no longer accepts. Modern push types depend on HTTP/2 headers like apns-push-type and apns-priority, which this package does not implement. Treat it as a migration target rather than something to extend.
- Is duccio/apns-php maintained and safe to use in production?
- It has been unmaintained since its June 2016 release, with no security patches, no TLS or cipher updates, and no maintainer response path if Apple changes something again. The license is permissive BSD-3-Clause, so forking and internal patching are legally clean, but you would be maintaining a dead protocol implementation. The only defensible reason to adopt it is time-boxed remediation of an existing system that already depends on it.