daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $token = '6785c9f3de8f6d11e2dccb876e4c61bed4b7286bf83792be4d5b6b2c335c0b6d';
  2.  
  3. $_SERVER['DOCUMENT_ROOT'] = '/home/web/4lapy.ru/www';
  4.  
  5. include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php');
  6.  
  7.  
  8. $oAutoloader = new \Lapy\Push\Apns\Autoloader();
  9. $localCertPath = "{$_SERVER['DOCUMENT_ROOT']}/local/backend/push_certs/lapy_prod_merge.pem";
  10.  
  11. $oServer = new \ApnsPHP_Push_Server(\ApnsPHP_Abstract::ENVIRONMENT_PRODUCTION, $localCertPath);
  12.  
  13. $oServer->setLogger(new \ApnsPHP_Log_Embedded());
  14. // $oServer->getLogger()->lockSend();
  15. $oServer->setProviderCertificatePassphrase('lapy');
  16. $oServer->setProcesses(5);
  17. $oServer->start();
  18.  
  19.         $oMessage = new \ApnsPHP_Message($token);
  20.         $oMessage->setBadge(1);
  21.         $oMessage->setSound();
  22.         $oMessage->setText('Test push message');
  23.         $oMessage->setCustomProperty('type', 'test');
  24.         $oMessage->setCustomProperty('id', 123);
  25.  
  26.         $oServer->add($oMessage);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top