Andres
Posted Feb 15, 2012 11:23 AM
user 38482352
Buenos Aires, AR
Post #: 1
Send an Email Post a Greeting
Estoy intentando hacer funcionar el push en una aplicacion y no he podido, por eso recurro a su ayuda.
Los pasos que hice fueron:
1) Baje el SDK y lo instalé en mi pc
2) Me registre en rim para hacer el testing
3) Una vez que recibi los datos por correo de rim empece la aplicacion cliente.
El codigo para registrar de la app cliente es:

ApplicationDescriptor descriptor = ApplicationDescriptor.currentApplicationDescriptor();
PushApplicationDescriptor registeredDescriptor = new PushApplicationDescriptor(ID_RECIBIDO_POR_MAIL, PORT_RECIBIDO_POR_MAIL, "http://pushapi.eval.b..., PushApplicationDescriptor.SERVER_TYPE_BPAS, descriptor);
String unMensaje = "";

try{
PushApplicationRegistry.registerApplication(registeredDescriptor);
unMensaje = "registro OK";
}catch(Exception e1){
unMensaje = "Error al registrar. Fin";
}

Como lei por varios lados que no se puede probar desde el simulador lo corri en un bb. Lo cargue y al ejecutar ese codigo primero pasa a estatus 2 (pending) y luego a 4. Pero al intentar hacer push desde la pagina "https://localhost:844... me dice "ERROR: There are no active subscribers.". Ya no se que mas probar! Aparte de que no termino de entender que rol cumple concretamente el sample push initiator y si debe estar instalado cuando ponga mi sistema en produccion.
Saludos y espero su ayuda!!!
Andres
Posted Feb 15, 2012 11:26 AM
user 38482352
Buenos Aires, AR
Post #: 2
Send an Email Post a Greeting
por cierto, no termino de entender si es necesario que el initiator del sdk debe si o si ser instalado en una ip publica. En caso de ser asi, porque solo funciona con ip publica? debo instalar ese tompcat y el initiator tambien cuando lance mi app a produccion?
Sebastian Kaplun
Posted Feb 24, 2012 3:43 PM
user 13369765
Buenos Aires, AR
Post #: 14
Send an Email Post a Greeting
Te mando el ejemplo que use yo que me funciono,
Como le estas mandando el push para validar si lo recibe?

Espero que te sirva, saludos!!




private static final String REGISTER_URL = BBP_SERVER + "/mss/PD_subReg?serviceid=" + APP_ID + "&osversion=" + getDeviceSoftwareVersion() + "&model=" + DeviceInfo.getDeviceName() + ";ConnectionType=mds-public;deviceside=false";

private ListeningThread _dataListener;


byte[] encryptedData = connectAndRead(REGISTER_URL);

final String encryptedParam = new String(encryptedData);

String encryptedUrl = BBP_SERVER + "/mss/PD_subReg?osversion=" + getDeviceSoftwareVersion() + "&model=" + DeviceInfo.getDeviceName() + "&" + encryptedParam + ";ConnectionType=mds-public;deviceside=false";

byte[] statusCodeData = connectAndRead(encryptedUrl);

final String statusCode = new String(statusCodeData);

if ((statusCode.equals(StatusCode.REGISTER_SUCCESSFUL) || statusCode.equals(StatusCode.USER_ALREADY_SUSCRIBED))) {
_dataListener = new ListeningThread();
_dataListener.start();

showDialogAndWait("Registration Succeeded.");
return true;
} else {
showDialogAndWait("Registration Failed\nStatus Code: " + statusCode);
return false;
}
Powered by mvnForum

Offer a perk for our members and get exposure.

Offer a perk →
People in this
Meetup are also in:

Log in

Not registered with us yet?

Sign up

Meetup members, Log in

or
By clicking the "Sign up using Facebook" or "Sign up" buttons above, you agree to Meetup's Terms of Service