1 | <?php |
||
19 | class Client |
||
20 | { |
||
21 | const URI_SANDBOX = 'https://api.development.push.apple.com:443'; |
||
22 | const URI_PROD = 'https://api.push.apple.com:443'; |
||
23 | |||
24 | /** |
||
25 | * @var bool |
||
26 | */ |
||
27 | protected $useSandbox; |
||
28 | |||
29 | /** |
||
30 | * Path to a file containing a private SSL key in PEM format. |
||
31 | * If a password is required, then it's an array containing the path to the SSL key in the first array element |
||
32 | * followed by the password required for the certificate in the second element. |
||
33 | * |
||
34 | * @var array|string |
||
35 | */ |
||
36 | protected $sslCert; |
||
37 | |||
38 | /** |
||
39 | * @var callable |
||
40 | */ |
||
41 | private $handler; |
||
42 | |||
43 | /** |
||
44 | * AppleNotification constructor. |
||
45 | * |
||
46 | * @param string|array $sslCert string containing certificate file name or array [<filename>,<password>] |
||
47 | * @param bool $useSandbox |
||
48 | */ |
||
49 | public function __construct($sslCert, $useSandbox = false) |
||
56 | |||
57 | /** |
||
58 | * @param Message $message |
||
59 | * |
||
60 | * @return bool |
||
61 | * |
||
62 | * @throws ApnsException |
||
63 | */ |
||
64 | public function send(Message $message) |
||
70 | |||
71 | /** |
||
72 | * @return array|string |
||
73 | */ |
||
74 | public function getSslCert() |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | public function getServer() |
||
86 | |||
87 | /** |
||
88 | * @param Message $message |
||
89 | * |
||
90 | * @return string |
||
91 | */ |
||
92 | public function getPushURI(Message $message) |
||
96 | } |
||
97 |