Skip to content

ApnsPHP 3.0.0 beta 1

Pre-release
Pre-release
Compare
Choose a tag to compare
@pprkut pprkut released this 06 May 14:16
· 34 commits to master since this release

A lot of work went into this release to cleanup the code base. Old functionality that
is no longer supported by Apple was removed, as well as functionality like the embedded logger
or the push server code that are better served by specialized, external projects.

The remaining functionality is now entirely unit tested, which should make it easier
to maintain going forward. Also helping in this regard is the cleanup on the documentation
side, the codestyle fixes as well as CI checks with phpstan. There is still some more
that can be done on this front, but overall it should be in very good shape for the
future.

We're already using this version of the code in multiple production projects,
so it should be safe to use. Calling it a beta for now just to make sure we didn't miss
anything.

Release highlights:

  • Use PSR-4 namespaces
  • Renamed exception classes
  • Merged SharedConfig/ApnsPHP_Abstract into the Push class
  • Added getRecipientsCount() and deprecated getRecipientsNumber()
  • Added getJsonWebToken() to simplify extending the Push class (Thanks to @BafS)
  • Update payload limit to 4KiB (Thanks to @BafS)
  • Add push-type header (Thanks to @BafS)
  • Add unit tests
  • Improved GitHub actions
  • Use phpdoc instead of doxygen
  • Removed Objective-C demo
  • Dropped support for the binary protocol
  • Dropped push server code
  • Dropped the EmbeddedLogger

Upgrading from m2mobi/apns-php version 2.0.0:

class ApnsPHP_Exception renamed to ApnsPHP\Exception
class ApnsPHP_Message renamed to ApnsPHP\Message
class ApnsPHP_Message_Custom renamed to ApnsPHP\Message\CustomMessage
class ApnsPHP_Message_Exception renamed to ApnsPHP\Message\Exception
class ApnsPHP_Message_Safari renamed to ApnsPHP\Message\SafariMessage
class ApnsPHP_Push renamed to ApnsPHP\Push
class ApnsPHP_Push_Exception renamed to ApnsPHP\Push\Exception
constant ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION renamed to ApnsPHP\Push::ENVIRONMENT_PRODUCTION
constant ApnsPHP_Abstract::ENVIRONMENT_SANDBOX renamed to ApnsPHP\Push::ENVIRONMENT_SANDBOX
constant ApnsPHP_Abstract::DEVICE_BINARY_SIZE renamed to ApnsPHP\Push::DEVICE_BINARY_SIZE
constant ApnsPHP_Abstract::WRITE_INTERVAL renamed to ApnsPHP\Push::WRITE_INTERVAL
constant ApnsPHP_Abstract::CONNECT_RETRY_INTERVAL renamed to ApnsPHP\Push::CONNECT_RETRY_INTERVAL

ApnsPHP_Abstract was merged into ApnsPHP\Push

class ApnsPHP_Feedback removed
class ApnsPHP_Log_Embedded removed
class ApnsPHP_Push_Server removed
class ApnsPHP_Push_Server_Exception removed
constant ApnsPHP_Abstract::PROTOCOL_BINARY removed
constant ApnsPHP_Abstract::PROTOCOL_HTTP removed
constant ApnsPHP_Abstract::SOCKET_SELECT_TIMEOUT removed

method ApnsPHP_Abstract::setLogger() removed
method ApnsPHP_Abstract::getLogger() removed
method ApnsPHP_Abstract::setRootCertificateAuthority() removed
method ApnsPHP_Abstract::getCertificateAuthority removed
method ApnsPHP_Abstract::setSocketSelectTimeout removed
method ApnsPHP_Abstract::getSocketSelectTimeout removed

method ApnsPHP_Abstract::getRecipientsNumber is deprecated. Please use ApnsPHP\Message::getRecipientsCount() instead.

ApnsPHP\Push constructor changed from

public function __construct($nEnvironment, $sProviderCertificateFile, $nProtocol = self::PROTOCOL_BINARY)

to

public function __construct(int $environment, string $providerCertificateFile, Psr\Log\LoggerInterface $logger)

Upgrading from protonlabs/apns-php version 2.2.3:

constant ApnsPHP\SharedConfig::ENVIRONMENT_PRODUCTION renamed to ApnsPHP\Push::ENVIRONMENT_PRODUCTION
constant ApnsPHP\SharedConfig::ENVIRONMENT_SANDBOX renamed to ApnsPHP\Push::ENVIRONMENT_SANDBOX
constant ApnsPHP\SharedConfig::DEVICE_BINARY_SIZE renamed to ApnsPHP\Push::DEVICE_BINARY_SIZE
constant ApnsPHP\SharedConfig::WRITE_INTERVAL renamed to ApnsPHP\Push::WRITE_INTERVAL
constant ApnsPHP\SharedConfig::CONNECT_RETRY_INTERVAL renamed to ApnsPHP\Push::CONNECT_RETRY_INTERVAL

ApnsPHP\SharedConfig was merged into ApnsPHP\Push

class ApnsPHP\Feedback removed
class ApnsPHP\Log\EmbeddedLogger removed
class ApnsPHP\Push\Server removed
class ApnsPHP\Push\Server\Exception removed
constant ApnsPHP\SharedConfig::PROTOCOL_BINARY removed
constant ApnsPHP\SharedConfig::PROTOCOL_HTTP removed
constant ApnsPHP\SharedConfig::SOCKET_SELECT_TIMEOUT removed

method ApnsPHP\SharedConfig::setLogger() removed
method ApnsPHP\SharedConfig::getLogger() removed
method ApnsPHP\SharedConfig::setRootCertificateAuthority() removed
method ApnsPHP\SharedConfig::getCertificateAuthority removed
method ApnsPHP\SharedConfig::setSocketSelectTimeout removed
method ApnsPHP\SharedConfig::getSocketSelectTimeout removed

method ApnsPHP\SharedConfig::getRecipientsNumber is deprecated. Please use ApnsPHP\Message::getRecipientsCount() instead.

ApnsPHP\Push constructor changed from

public function __construct($environment, $providerCertificateFile, $protocol = self::PROTOCOL_BINARY)

to

public function __construct(int $environment, string $providerCertificateFile, Psr\Log\LoggerInterface $logger)