All notable changes to DEV1 Notify Core will be documented in this file.
The format is based on Keep a Changelog.
- First public release of DEV1 Notify Core.
- Contracts and DTOs:
PushClient,PushMessage,PushTarget,PushResult. - Token provider:
AccessTokenProviderandGoogleServiceAccountTokenProvider. FcmHttpV1Clientdriver to send push notifications via Firebase Cloud Messaging HTTP v1.ClientRegistryto manage multiple clients by name.FcmClientFactoryto easily instantiate FCM clients.- Working example in
examples/send_fcm.php.
- Support for custom notification channels in Firebase Cloud Messaging.
- New example in
examples/send_fcm_channels.php. AndroidOptionsandApnsOptionsto configure platform-specific options.platformOverridesinPushMessageto set platform-specific options.
- Corrected APNs payload structure in
ApnsOptionsto comply with FCM v1 requirements. - Fixed Android notification channel handling in
AndroidOptions. - Improved error handling in
FcmHttpV1Client.
- Optional PSR-16 token cache on
GoogleServiceAccountTokenProvider(new?CacheInterface $cacheconstructor arg +cache_keyconfig) so OAuth tokens can be shared across processes/requests. - Automatic retry with exponential backoff + jitter on transient failures (5xx, 429, PSR-18 transport errors) in both the token provider and
FcmHttpV1Client. Configurable viamax_retriesandretry_base_delay_ms. FcmHttpV1Clientnow extractserror.details[*].errorCode(e.g.UNREGISTERED,QUOTA_EXCEEDED) in preference to the genericerror.status.PushResulthelpers:isUnregistered(),isInvalidArgument(),isQuotaExceeded(),isTransient().- Data-only (silent) push support:
notificationblock is omitted whenPushMessagehas empty title and body. Dev1\NotifyCore\Versionconstants + automaticUser-Agent: Dev1-Notify-Core/<ver>header on every FCM and OAuth request.- PHPUnit configuration (
phpunit.xml.dist) and initial test suite covering DTOs, registry, FCM driver, token provider, retry behavior, and Android options. - GitHub Actions CI/CD pipeline (
.github/workflows/ci.yml): matrix tests on PHP 7.4–8.4 with pcov, enforces ≥80% line coverage on every push/PR, and on merges tomasterauto-publishes thev<Version::VERSION>tag (consumed by the Packagist webhook) and refreshes the shields.io coverage badge on thebadgesbranch.
- Breaking:
PushTargetnow throwsInvalidArgumentExceptionwhen more than one oftoken/topic/conditionis provided (previously the driver silently preferredtoken). - Breaking:
AndroidOptions::withPriority()throws on unknown values instead of silently passing them through. FcmHttpV1Clientno longer catches generic\Throwable; only PSR-18ClientExceptionInterfaceis caught and surfaced asTRANSPORT_ERROR.- Token acquisition errors now return a
PushResultwitherrorCode = TOKEN_ERRORinstead of crashing the send. AndroidOptions::toArray()emitschannel_idexactly once.- Missing return types added to
AndroidOptions::withChannelId(),AndroidOptions::merge(), andApnsOptions::merge(). PushResult::$idPHPDoc corrected tostring|null.ClientRegistry::remove()now returnsbool(true if a client was removed, false if unknown) while preserving idempotent semantics.AccessTokenProvider::getToken()PHPDoc now documents the@throwscontract for failed acquisitions.- Widened
psr/logconstraint to^1.1 || ^2.0 || ^3.0for compatibility with modern logger implementations.
FcmClientFactory::createno longer uses a PHP 8-only trailing comma; library parses cleanly on PHP 7.4 again.json_encodefailures inbuildAssertionJwt()and the FCM payload are now surfaced explicitly instead of signing/sending the literalfalse.- Non-scalar values in
PushMessage::$datawhosejson_encodefails fall back to an empty string instead of the literal"false". - Dropped the deprecated
openssl_pkey_free()call (no-op on PHP 8.x, GC handles both 7.4 and 8.x). - Removed an unreachable
return ''inGoogleServiceAccountTokenProvider::getToken().
- Orphan
Dev1\NotifyCore\MessageandDev1\NotifyCore\Builders\MessageBuilderclasses (never wired into the driver). - Undocumented
timeoutconfig key onFcmHttpV1Client(it was never applied).
- Support for additional providers (Twilio Notify, OneSignal, APNs).
- Adapters for Symfony.