for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the AppleApnPush package
*
* (c) Vitaliy Zhuk <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code
*/
namespace Apple\ApnPush\Protocol\Http\UriFactory;
use Apple\ApnPush\Model\DeviceToken;
/**
* Default URI factory
class UriFactory implements UriFactoryInterface
{
* Create URI for device
* @param DeviceToken $deviceToken
* @param bool $sandbox
* @return string
public function create(DeviceToken $deviceToken, bool $sandbox) : string
if ($sandbox) {
$uri = 'https://api.development.push.apple.com/3/device/%s';
} else {
$uri = 'https://api.push.apple.com/3/device/%s';
}
return sprintf($uri, $deviceToken);