Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

BlackBerry Push Development

Reply
New Contributor
marcominerva
Posts: 5
Registered: ‎07-06-2011
My Device: Developer

Unable to register for push notifications

[ Edited ]

Hi all!

 

I'm trying to register my client application for push notifications. I'm using SDK version 5.0 and trying to connect to eval server. However, the registration process always fails with a netowrk error. The error is the same if I try in the simulator or in a real device.

 

If I try to insert the registration link in the browser:

 

https://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=xxxxx&osversion=5.0.0.592&model=9000

 

I obtain the following message (the service ID is correct, I'm sure):

 

Error

The content you have requested is not available

PD_subReg command is not currently in service! 

 

What is wrong? Am I missing something or the push eval server is down?

 

Thanks in advance for the attention.

--

Marco Minerva

Please use plain text.
Developer
massimo_olive
Posts: 235
Registered: ‎11-08-2010
My Device: Not Specified

Re: Unable to register for push notifications

First off use http not https and you must register from a real device that has BIS browsing.

Please use plain text.
New Contributor
marcominerva
Posts: 5
Registered: ‎07-06-2011
My Device: Developer

Re: Unable to register for push notifications

Hi! Thanks for the reply!

 

The URL https://pushapi.eval.blackberry was sent me in the confirmation mail for the push evaluation request. So is the URL I received incorrect? And there is a way to programmatically check if the device supports BIS browsing?

 

Thanks again.

--

Marco Minerva

Please use plain text.
Developer
massimo_olive
Posts: 235
Registered: ‎11-08-2010
My Device: Not Specified

Re: Unable to register for push notifications

I know its not very clear but that is the URL (with https) you need to use to push with but for registration use http instead of https.

 

I think there are APIs to check if there is an IPPP service book or if the BIS transport is available - don't have code to share though, sorry.

Please use plain text.
New Contributor
marcominerva
Posts: 5
Registered: ‎07-06-2011
My Device: Developer

Re: Unable to register for push notifications

Hi!

 

OK, now it's a bit clearer. The last question. I'm using BlackBerry Push API, so for example I'm invoking the method PushApplicationRegistry.registerApplication. In this method must I use the url with HTTP, right? If this is the case, when is it necessary to use the url with HTTPS? After registration, I automatically receive notification for every received message and status change, or I'm missing something?

 

Thanks again.

--

Marco Minerva

Please use plain text.
Regular Contributor
mazmellow
Posts: 77
Registered: ‎01-27-2010
My Device: Dev Alpha

Re: Unable to register for push notifications

This is an example for using PushApplicationRegistry.registerApplication() method.


int port = <the port you get from confirm email >;       

String appId = <the appId you get from confirm email >;       

String bpasUrl = "http://pushapi.eval.blackberry.com";    //use "http"       

ApplicationDescriptor ad = ApplicationDescriptor.currentApplicationDescriptor();         

byte serverType = PushApplicationDescriptor.SERVER_TYPE_BPAS;

 

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 ) {           

// we already registered, update the statuses       

Debug.log( "Already registered with BPAS" );           

return;                   

} else if( pasStatus == PushApplicationStatus.STATUS_PENDING ) {           

// we already scheduled registration, wait for its result       

Debug.log( "Registration with BPAS already scheduled");           

} else {           

// not registered yet, register       

Debug.log( "Scheduled registration with BPAS");           

PushApplicationRegistry.registerApplication( pad );                  

}


Maz

Please use plain text.