{"id":231727,"date":"2014-07-31T15:55:02","date_gmt":"2014-07-31T11:55:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=231727"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=231727","title":{"rendered":"<span class=\"post_title\">Push \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 PHP (Android \u0438 IOS). \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0433\u043e\u0442\u043e\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/developer.android.com\/images\/gcm\/gcm-logo.png\" alt=\"GCM\"\/><\/p>\n<p>  \u041e \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0435 Push \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/habrahabr.ru\/post\/157481\/\" title=\"\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Apple push notification service\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/200216\/\" title=\"\u041e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u0443\u0448-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445\">\u0442\u0443\u0442<\/a>, \u043d\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0435\u0442. \u0418\u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432<\/h1>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0432\u043e\u0440\u0438\u0442 \u043c\u0430\u0433\u0438\u044e, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u0434\u0440\u0435\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u043c: htpp:\/\/test.ru\/secret\/android?token=value \u0438 htpp:\/\/test.ru\/secret\/ios?token=value. <br \/>  \u0421\u0430\u043c\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0442\u043e \u0437\u0430\u0449\u0438\u0442\u044b \u043e\u0442 \u043b\u0435\u0432\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u0442, \u0445\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u043c\u0430\u0433\u0438\u044f \u043f\u043e\u0434\u0432\u0435\u043b\u0430 \u043b\u0438\u0431\u043e \u0431\u044b\u043b\u0430 \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0442\u0430\u043a\u0438 \u0437\u0430\u0449\u0438\u0442\u0430 \u0435\u0441\u0442\u044c, \u043e\u0442\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u044e \u0441\u0442\u0430\u0442\u044c\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0441\u043e\u0432\u0435\u0442\u043e\u043c.<\/p>\n<p>  \u041d\u0430 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438, \u043d\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e 10-20 \u0441\u0435\u043a\u0443\u043d\u0434. \u0422\u043e\u043a\u0435\u043d\u044b \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u043a\u0435\u043d\u0430 \u0434\u043b\u044f android:<\/p>\n<blockquote><p>APA91bFY-2CYrriS-Dt6y9_dGHhkPVwy7njqFpfgpzGYlDT4l0SQeqKr-lc1OM0a2DQ33S3EKwy2YJn-upKxOT6rNwgk350xUM3g8VX65rkGocOQX80Ta34pwXo6fyn-usoaGUAm4lzsqbCL-gkzHZZXRX39kUQfnA   <\/p><\/blockquote>\n<p>  IOS:<\/p>\n<blockquote><p>628a3f4a28bb994bb7c9a4143950d240c6d5a1dab8621e9ed61a2109a074f832  <\/p><\/blockquote>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0435\u0439 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043c\u044b \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438.<\/p>\n<h1>\u0420\u0430\u0441\u0441\u044b\u043b\u043a\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439<\/h1>\n<p>  Apple \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 <a href=\"https:\/\/developer.apple.com\/library\/ios\/documentation\/NetworkingInternet\/Conceptual\/RemoteNotificationsPG\/Chapters\/ApplePushService.html\" title=\"APNS\">APNS<\/a>, \u0430 Google <a href=\"http:\/\/developer.android.com\/google\/gcm\/index.html\" title=\"GCM\">GCM<\/a> (C2DM \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u043c, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0439\u0442\u0435 \u044d\u0442\u043e) \u0438 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043b\u044e\u0431\u0438\u043c\u043e\u043c\u0443 \u0434\u0435\u043b\u0443, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044e, \u043d\u043e \u0431\u044e\u0434\u0436\u0435\u0442 \u0431\u044b\u043b \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0438 \u044f \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0438\u0441\u043a\u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0421\u0430\u043c\u043e\u0435 \u0433\u043e\u0434\u043d\u043e\u0435 \u0447\u0442\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u043b\u043e\u0441\u044c \u044d\u0442\u043e <a href=\"https:\/\/github.com\/duccio\/ApnsPHP\" title=\"ApnsPHP\">ApnsPHP<\/a> \u0438 <a href=\"https:\/\/github.com\/CodeMonkeysRu\/GCMMessage\" title=\"GCMMessage\">GCMMessage<\/a>, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043a\u0430\u043a \u043d\u0430 5.3+ \u0442\u0430\u043a \u0438 \u043d\u0430 5.4+.<\/p>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u0443\u044e \u0444\u0440\u0430\u0437\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 APNS \u0438 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GCM.<\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0434\u043b\u044f GCM, \u0442\u043e\u043a\u0435\u043d\u044b \u0441\u043e\u0432\u0435\u0442\u0443\u044e\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u0447\u043a\u043e\u0439, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430\u0445 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u0438 \u0431\u044b\u0441\u0442\u0440\u043e, \u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0443\u0434\u0430\u043b\u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435), \u0438\u0445 \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u0438\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c. <\/p>\n<pre><code class=\"php\">function fnSendAndroid($tokens, $text, $config) {     $sender = new CodeMonkeysRu\\GCM\\Sender($config['androidTokenAuth']);     $message = new CodeMonkeysRu\\GCM\\Message($tokens, array(&quot;message&quot; =&gt; $text));      try {         $response = $sender-&gt;send($message);          if ($response-&gt;getFailureCount() &gt; 0) {             $invalidRegistrationIds = $response-&gt;getInvalidRegistrationIds();             foreach($invalidRegistrationIds as $invalidRegistrationId) {                 \/\/Remove $invalidRegistrationId from DB                 \/\/ \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 APS91bFY-2CYrriS-Dt6y9_dGHhkPVwy7njqFpfgpzGYlDT4l0SQeqKr-lc1OM0a2DQ33S3EKwy2YJn-upKxOT6rNwgk350xUM3g8VX65rkGocOQX80Ta34pwXo6fyn-usoaGUAm4lzsqbCL-gkzHZZXRX39kUQfnA                   fnDeleteToken($invalidRegistrationId);             }         }         if ($response-&gt;getSuccessCount()) {             echo '\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043d\u0430 ' . $response-&gt;getSuccessCount() . ' \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432';         }     } catch (CodeMonkeysRu\\GCM\\Exception $e) {          switch ($e-&gt;getCode()) {             case CodeMonkeysRu\\GCM\\Exception::ILLEGAL_API_KEY:             case CodeMonkeysRu\\GCM\\Exception::AUTHENTICATION_ERROR:             case CodeMonkeysRu\\GCM\\Exception::MALFORMED_REQUEST:             case CodeMonkeysRu\\GCM\\Exception::UNKNOWN_ERROR:             case CodeMonkeysRu\\GCM\\Exception::MALFORMED_RESPONSE:                 fnLog('\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0430\u043d\u0434\u0440\u043e\u0438\u0434 ' . $e-&gt;getCode() . ' ' . $e-&gt;getMessage());                 break;         }     } }  <\/code><\/pre>\n<p>  \u0412\u0435\u0437\u0434\u0435 \u043f\u0438\u0448\u0443\u0442 \u0447\u0442\u043e APNS \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0441\u0442 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438, \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u044d\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0430 \u0438 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0430, \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0443\u0436\u0435\u043d \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0444\u0440\u0430\u0437\u0430 \u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442, \u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043b\u0438\u0447\u043d\u043e\u043c \u043a\u0430\u0431\u0438\u043d\u0435\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430.<\/p>\n<p>  \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043d\u0430\u0437\u043e\u0439\u043b\u0438\u0432\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439 \u0441\u0442\u043e\u0438\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043c\u0435\u0440\u0442\u0432\u044b\u0435 \u0442\u043e\u043a\u0435\u043d\u044b.<\/p>\n<pre><code class=\"php\">function feedback($config) {     $feedback = new ApnsPHP_Feedback(         ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, $config['apn']['sert']     );     $feedback-&gt;setProviderCertificatePassphrase($config['apn']['passphrase']);     $feedback-&gt;setRootCertificationAuthority($config['apn']['RootCertificat']);      $feedback-&gt;connect();      $aDeviceTokens = $feedback-&gt;receive();     if (!empty($aDeviceTokens)) {         foreach ($aDeviceTokens as $DeviceToken) {             \/**              * \u0444\u043e\u0440\u043c\u0430\u0442              * [timestamp] =&gt; 1406040206              * [tokenLength] =&gt; 32              * [deviceToken] =&gt; 738d005a11bca268e2f1bffbfed88a456e261020b9277883cde14d9c8f47cde0              *\/             \/\/'DELETE LOW_PRIORITY FROM tokens WHERE token=:token';             fnLog('Feedback - \u0423\u0434\u0430\u043b\u0435\u043d \u0442\u043e\u043a\u0435\u043d ' . $DeviceToken[deviceToken]);         }     }      $feedback-&gt;disconnect(); }  <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0441\u0430\u043c\u0430 \u043e\u0442\u0441\u044b\u043b\u043a\u0430:<\/p>\n<pre><code class=\"php\">function fnSendIos($tokens, $text, $config) {     $push = new ApnsPHP_Push(         ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, $config['apn']['sert']);      \/\/ Set the Provider Certificate passphrase     $push-&gt;setProviderCertificatePassphrase($config['apn']['passphrase']);      $push-&gt;setRootCertificationAuthority($config['apn']['RootCertificat']);      $message = new ApnsPHP_Message();     $listTokens = array();     foreach ($tokens as $token) {         $message-&gt;addRecipient($token);         $listTokens[] = $token;     }      $push-&gt;connect();      $message-&gt;setText($text);     $push-&gt;add($message);     $push-&gt;send();     $push-&gt;disconnect();      $aErrorQueue = $push-&gt;getErrors();     if (!empty($aErrorQueue)) {         fnLog('\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 ios  -  ' . print_r($aErrorQueue, true));         if (is_array($aErrorQueue)) {             foreach($aErrorQueue as $error) {                 if (isset($error['ERRORS']) && is_array($error['ERRORS'])) {                     foreach ($error['ERRORS'] as $m) {                         if (isset($m['statusMessage']) && $m['statusMessage'] == 'Invalid token') {                             $arrayID = $m['identifier'] - 1;                             if (isset($listTokens[$arrayID])) {                                 \/\/DELETE LOW_PRIORITY FROM tokens WHERE token=:token'                                 fnLog('\u0423\u0434\u0430\u043b\u0435\u043d \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d ' . $listTokens[$arrayID]);                             }                         }                      }                 }             }         }     } }  <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0412\u044b \u043d\u0435 \u043d\u0430\u043f\u0443\u0442\u0430\u043b\u0438 \u0441 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430\u043c\u0438, \u0442\u043e \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0434\u043e\u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/231727\/\"> http:\/\/habrahabr.ru\/post\/231727\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<img decoding=\"async\" src=\"http:\/\/developer.android.com\/images\/gcm\/gcm-logo.png\" alt=\"GCM\"\/><\/p>\n<p>  \u041e \u0440\u0430\u0441\u0441\u044b\u043b\u043a\u0435 Push \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/habrahabr.ru\/post\/157481\/\" title=\"\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Apple push notification service\">\u0442\u0443\u0442<\/a> \u0438 <a href=\"http:\/\/habrahabr.ru\/post\/200216\/\" title=\"\u041e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043f\u0443\u0448-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0439 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445\">\u0442\u0443\u0442<\/a>, \u043d\u043e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043d\u0435\u0442. \u0418\u0442\u0430\u043a, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u043e\u0448\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-231727","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/231727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=231727"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/231727\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=231727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=231727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=231727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}