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 Developer
alexeykoval
Posts: 49
Registered: 05-14-2009

Problem with a client push application

Hi.

When I send a push message to "push_all" I get "No Active Subscribers for the Push Service" (a server side)

 

Client side.

I've tried:

1. A code from http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample.... Doesn't work. If I use "deviceside=false" in the http request I get "Invalid Url" exception (reg_url =  http://pushapi.eval.blackberry.com/mss/PD_subReg?serviceid=APP_ID&osversion=5.0.0.822&model=9000;dev... Without "deviceside=false" (or deviceside=true or without CONNECTION_SUFFIX) I get html data:

<html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>nginx</center>
</body>
</html> 

 

2. Without a registration - doesn't work.

 

3. Using net.rim.blackberry.api.push.

public class BlackBerryPush extends UiApplication implements PushApplication    {

          PushApplicationDescriptor pad; 

          public static void main(String[] args) {
                BlackBerryPush theApp = new BlackBerryPush();
                theApp.enterEventDispatcher();
          }

          public BlackBerryPush()    {

                 pad = new PushApplicationDescriptor(Port);

                 pad.setAppId(APP_ID);
                 byte b = PushApplicationRegistry.getStatus(pad).getStatus();
                 if ( b != PushApplicationStatus.STATUS_ACTIVE || b != PushApplicationStatus.STATUS_PENDING ) {
                       try {
                            PushApplicationRegistry.registerApplication(pad);
                       }catch(Exception e) {}
                 }

          }

          public void onMessage(PushInputStream inputStream, StreamConnection conn) {


          }

          public void onStatusChange(PushApplicationStatus status) {

                //Here I get STATUS_ACTIVE
          } 

}

I've tried to set all settings for a PushApplicationDescriptor. But a result the same.

 

Please, Help! 

 

Please use plain text.
Developer
massimo_olive
Posts: 234
Registered: 11-08-2010

Re: Problem with a client push application

Sounds like you are using the server-side push SDK. In that case you must subscribe from the sample application on the device to the push service registered with the server-side SDK you are hosting somewhere on one of your servers.

 

Also, try using Push Essentials to start off with instead of Push Plus.

Please use plain text.
New Developer
alexeykoval
Posts: 49
Registered: 05-14-2009

Re: Problem with a client push application

[ Edited ]

I'm using Push Essentials.

I'm using a server code from http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Push-API-sample-code-needed/td-p/...

The main question - how to register my app. on a push server?

Why a registration doesn't work with net.rim.blackberry.api.push?

Please use plain text.
Developer
massimo_olive
Posts: 234
Registered: 11-08-2010

Re: Problem with a client push application

Oh I thought you were using the SDK based on the error message you got about no active subscribers.

 

Ok, so what client application are you using?

 

Yes, using the net.rim.blackberry.api.push will register you with the BlackBerry Push Server.

Please use plain text.
New Developer
alexeykoval
Posts: 49
Registered: 05-14-2009

Re: Problem with a client push application

As I wrote in a first post I've tried a code from http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Simplified-BIS-Push-client-sample... and based on net.rim.blackberry.api.push.

 

Please use plain text.
New Developer
alexeykoval
Posts: 49
Registered: 05-14-2009

Re: Problem with a client push application

Response from server:

<?xml version="1.0"?>
<!DOCTYPE pap PUBLIC "-//WAPFORUM//DTD PAP 2.1//EN" "http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd"><pap><push-response push-id="1326454898576" sender-address="http://pushapi.eval.blackberry.com/mss/PD_pushRequest" sender-name="RIM Push-Data Service" reply-time="2012-01-13T11:41:42Z"><response-result code="2000" desc="No Active Subscribers for the Push Service"></response-result></push-response></pap> 

Please use plain text.
Developer
massimo_olive
Posts: 234
Registered: 11-08-2010

Re: Problem with a client push application

Sorry I can't be of much assistance then. I am not familiar with that sample code from the link you posted. But from the error you are getting back from the server its pretty obvious your registration call is not successful and I would focus on figuring out if you get can more info from the apis as to why your call is potentially failing
Please use plain text.