I'm using the ApnsPHP library with Codeigniter to send notifications push for iOS. Now, I'm a little desperate here with the next error:
[Mon Jun 15 16:22:59.480063 2015] [:error] [pid 1820] [client 192.168.1.139:4707] PHP Fatal error: Uncaught exception 'Exception' with message 'Class file '/var/www/html/kids_book/application/models/CI/Exceptions.php' does not exists' in /var/www/html/kids_book/application/models/ApnsPHP/Autoload.php:20\nStack trace:\n#0 [internal function]: ApnsPHP_Autoload('CI_Exceptions')\n#1 [internal function]: spl_autoload_call('CI_Exceptions')\n#2 /var/www/html/kids_book/system/core/Common.php(143): class_exists('CI_Exceptions')\n#3 /var/www/html/kids_book/system/core/Common.php(481): load_class('Exceptions', 'core')\n#4 /var/www/html/kids_book/application/views/notificacion/add_notificacion.php(102): _exception_handler(8, 'Undefined varia...', '/var/www/html/k...', 102, Array)\n#5 /var/www/html/kids_book/system/core/Loader.php(833): include('/var/www/html/k...')\n#6 /var/www/html/kids_book/system/core/Loader.php(419): CI_Loader->_ci_load(Array)\n#7 /var/www/html/kids_book/application/controllers/notificacion.php(117): CI_Loader->view('notificacion/ad...', Array)\n#8 [internal function]: Notificacion->add_notificacion()\n#9 /v in /var/www/html/kids_book/application/models/ApnsPHP/Autoload.php on line 20, referer: http://192.168.1.132/kids_book/index.php/notificacion/add_notificacion
This error appears in the moment I add the notification in my DB, and the library try to send the push notification to the device. Honestly, I have no idea why is this happening. I'll appreciate any help here. Thanks in advance.
Model:
class Push_model extends CI_Model {
public function __construct() {
parent::__construct();
$this->load->database();
}
public function push_notificacion_ios($keys) {
$count = count($keys);
date_default_timezone_set("America/Caracas");
require_once 'application/models/ApnsPHP/Autoload.php';
$push = new ApnsPHP_Push(
ApnsPHP_Abstract::ENVIRONMENT_SANDBOX, "application/models/notificacionesPUSH.pem"
);
$push->connect();
for ($i = 0; $i < $count; $i++) {
$message = new ApnsPHP_Message($keys[$i]);
$message->setBadge(1);
$message->setText('Tiene una nueva notificación de Kids Book');
$message->setSound();
$message->setCustomProperty('key', 1);
$message->setExpiry(30);
$push->add($message);
}
$push->send();
$push->disconnect();
}
PD: Sorry for my awful English, not my native language.
in
config.php
fileYou can learn on ellislab tutorial as well