/** * Returns a singleton instance of InstaPush * @param $appId Instapush Applciation Id. * @param $appSecret Instapush Application Secret. * @return InstaPush */ public static function getInstance($appId, $appSecret, $options = array()) { if (!isset(self::$_instance)) { self::$_instance = new InstaPush($appId, $appSecret, $options); } return self::$_instance; }
function instapush_notify($ipappid, $ipappsecret, $event, $time, $reason) { echo "\ninstapush \n"; //Send notification to instapush, man $ip = InstaPush::getInstance($ipappid, $ipappsecret); $ip->track($event, array("time" => $time, "reason" => $reason)); }