public function lastmessagesAction()
 {
     $data = array();
     if ($device_uid = $this->getRequest()->getParam('device_uid')) {
         $message = new Push_Model_Message();
         $message->findLastPushMessage($device_uid);
         if ($message->getId()) {
             //We read this push
             $message->markAsRead($device_uid, $message->getMessageId());
             if (is_numeric($message->getActionValue())) {
                 $option_value = new Application_Model_Option_Value();
                 $option_value->find($message->getActionValue());
                 $action_url = $option_value->getPath(null, array('value_id' => $option_value->getId()), false);
             } else {
                 $action_url = $message->getActionValue();
             }
             $data["push_message"] = array("title" => $message->getTitle(), "text" => $message->getText(), "cover" => $message->getCoverUrl(), "action_value" => $action_url, "open_webview" => !is_numeric($message->getActionValue()));
         }
         $message = new Push_Model_Message();
         $message->findLastInAppMessage($this->getApplication()->getId(), $device_uid);
         if ($message->getId()) {
             $data["inapp_message"] = array("title" => $message->getTitle(), "text" => $message->getText(), "cover" => $message->getCoverUrl());
         }
     }
     $this->_sendHtml($data);
 }