Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

BlackBerry Push Development

Reply
New Contributor
congkinh
Posts: 8
Registered: 01-20-2012
My Carrier: SFR

STATUS_PENDING after registering application even though it takes some minutes

Hi everybody,

 

I use code as the following to register my application (BIS + service type Essentials). I always receive the status STATUS_PENDING (status value after using PushApplicationRegistry.registerApplication is 2) after registering my application, even though I wait for some minutes. Could someone know why? If so, could you help me solve my issue?

 

int port = // value received by form registration;
String appId = // value received by form registration;
String bpasUrl ="http://pushapi.eval.blackberry.com";
byte serverType = PushApplicationDescriptor.SERVER_TYPE_BPAS;

ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor();
PushApplicationDescriptor pad = new PushApplicationDescriptor(appId, port, bpasUrl, serverType, ad);

// check whether already registered or registration pending
PushApplicationStatus pushApplicationStatus = PushApplicationRegistry.getStatus(pad);
byte pasStatus = pushApplicationStatus.getStatus();
if (pasStatus == PushApplicationStatus.STATUS_ACTIVE) {
//Dialog.alert("register STATUS_ACTIVE.");

// we already registered, update the statuses
Logger.log("Already registered with BPAS");
return;
} else if (pasStatus == PushApplicationStatus.STATUS_PENDING) {
//Dialog.alert("register STATUS_PENDING.");
// we already scheduled registration, wait for its result
Logger.log("Registration with BPAS already scheduled");
} else if (pasStatus == PushApplicationStatus.STATUS_NOT_REGISTERED) {
//Dialog.alert("register STATUS_NOT_REGISTERED.");
// not registered yet, register
Logger.log("Scheduled registration with BPAS");
PushApplicationRegistry.registerApplication(pad);
PushApplicationStatus pushApplicationStatus1 = PushApplicationRegistry.getStatus(pad);

Logger.log("active: " + (pushApplicationStatus1.getStatus() == PushApplicationStatus.STATUS_ACTIVE) );
Logger.log("status value: " + pushApplicationStatus1.getStatus());
} else if (pasStatus == PushApplicationStatus.STATUS_FAILED) {
//Dialog.alert("register STATUS_FAILED.");
// failed registration, retry
Logger.log("Registration failed with BPAS, try again");
PushApplicationRegistry.registerApplication(pad);
}

 

 

Thanks in advance,

Kinh

Please use plain text.
New Contributor
congkinh
Posts: 8
Registered: 01-20-2012
My Carrier: SFR

Re: STATUS_PENDING after registering application even though it takes some minutes

Hi,

 

Finally I knew what happened for my case. In fact, I have to use the Internet service 3G instead of wifi to register my application. Thank you anyway.

 

Kinh

Please use plain text.