You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: src/JWage/APNS/SocketClient.php
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@
6
6
7
7
class SocketClient
8
8
{
9
+
constPAYLOAD_MAX_BYTES = 256;
10
+
9
11
/**
10
12
* @var \JWage\APNS\Certificate
11
13
*/
@@ -65,6 +67,12 @@ public function __destruct()
65
67
*/
66
68
publicfunctionwrite($binaryMessage)
67
69
{
70
+
if (strlen($binaryMessage) > self::PAYLOAD_MAX_BYTES) {
71
+
thrownew \InvalidArgumentException(
72
+
sprintf('The maximum size allowed for a notification payload is %s bytes; Apple Push Notification Service refuses any notification that exceeds this limit.', self::PAYLOAD_MAX_BYTES)
* @expectedExceptionMessage The maximum size allowed for a notification payload is 256 bytes; Apple Push Notification Service refuses any notification that exceeds this limit.
'body' => 'Jonathan H. Wage joined your website. This is a really long push notification body. So long it probably won\'t work! Not long enough! Perfect!',
0 commit comments