SBAttachments

23 views
Skip to first unread message

JCajama

unread,
Jun 13, 2013, 11:27:26 AM6/13/13
to sbpo...@googlegroups.com
Hola!

Estoy empezando con los ejemplos de spotbros y al probar del de SBAttachments, no me meustra nada adjunto, simplemente me dice Plaza de cibeles. Alguien sabe por qué puede ser?

Gracias

Guillermo Barbero

unread,
Jun 14, 2013, 8:09:45 AM6/14/13
to sbpo...@googlegroups.com
¿Podrías poner el código que estás utilizando?

--
Has recibido este mensaje porque estás suscrito al grupo "sbportal" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus correos electrónicos, envía un correo electrónico a sbportal+u...@googlegroups.com.
Para obtener más opciones, visita https://groups.google.com/groups/opt_out.
 
 



--
 
Guillermo Barbero - Backend Team

Spotbros Technologies

  

elArkero

unread,
Jun 14, 2013, 8:26:21 AM6/14/13
to sbpo...@googlegroups.com
Gracias por responder, te dejo el código, es casi igual que el que venía en los ejemplos 

<?php 
require_once('SBClientSDK/SBApp.php');
/**
 * Attachment tester application
 *
 * Sends a message with all the possible attachments to the user who writes to the application
 * @author Spotbros <sup...@spotbros.com>
 */
class AttachmentTesterApp extends SBApp
{
protected function onError($errorType_){
error_log($errorType_);
$archivo = 'log_error.txt';
$fp = fopen($archivo, "w");
$write = fputs($fp, $errorType_);
fclose($fp);
}
protected function onNewVote(SBUser $sbUser_, $newVote_, $oldRating_, $newRating_){}
protected function onNewContactSubscription(SBUser $sbUser_){}
protected function onNewContactUnSubscription(SBUser $sbUser_){}
protected function onNewMessage(SBMessage $message_)
{
// add title
$this->_SBAttachments->addTitleOrFalse("Plaza de Cibeles");
// download image so it can be attached
$cibelesImagePath = $this->_curlMngr->downloadFileOrFalse("http://upload.wikimedia.org/wikipedia/commons/0/03/Cibeles_con_Palacio_de_Linares_al_fondo.jpg");
// add image attachment, set timeout to 10 seconds and delete after being uploaded
$this->_SBAttachments->addImageOrFalse($cibelesImagePath,100000,true);
// add paragraph with some information from wikipedia
$this->_SBAttachments->addParagraphOrFalse("The Plaza de Cibeles is a square with a neo-classical complex of marble sculptures with fountains that has become an iconic symbol for the city of Madrid. It sits at the intersection of Calle de Alcalá (running from east to west), Paseo de Recoletos (to the North) and Paseo del Prado (to the south). Plaza de Cibeles was originally named Plaza de Madrid, but in 1900, the City Council named it Plaza de Castelar, which was eventually replaced by its current name");
// add map showing where "Plaza de Cibeles" is
$this->_SBAttachments->addMapOrFalse(40.4192, -3.6931);
// add link to the Wikipedia article about it
$this->_SBAttachments->addLinkOrFalse("http://en.wikipedia.org/wiki/Plaza_de_Cibeles");
// add quote
$this->_SBAttachments->addQuoteOrFalse("From Wikipedia, the free encyclopedia");
// send message to recipient A
$archivo = 'log_error.txt';
$fp = fopen($archivo, "w");
$write = fputs($fp, print_r($this->_SBAttachments->getAttachmentRefs()));
fclose($fp);
if (!$this->replyOrFalse("Plaza de cibeles"))
{
error_log($errorType_);
$archivo = 'log_error.txt';
$fp = fopen($archivo, "w");
$write = fputs($fp, "Could not send message to the user");
fclose($fp);
error_log ("Could not send message to the user");
}
}
}
$attachmentTesterApp = new AttachmentTesterApp("U6YO2Q2","649ed87d2cddda5408ac3bfee263990f18f696574bbd066960246cc081d213cd");
$attachmentTesterApp->serveRequest($_GET["params"]);
?>


jesus.h...@spotbros.com

unread,
Jun 18, 2013, 8:23:27 AM6/18/13
to sbpo...@googlegroups.com
Dices que te envía el mensaje, ¿es así?. Cuando dices que no te llegan adjuntos, ¿te refieres a la imagen?
Reply all
Reply to author
Forward
0 new messages