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
Contributor
Posts: 10
Registered: ‎02-14-2013
My Device: BlackBerry Bold 9700
My Carrier: Vodafone
Accepted Solution

Problems registering with the Push Service APIs

Hi to all,

first I want to thank any answer, im too lost here and any information is welcome.

 

I'm trying to develop the example given by RIM on the link: http://developer.blackberry.com/java/documentation/registering_to_receive_push_messages.html

 

But not the subscription's part to the content provider because i will implement it in my own way.
Right now the most important thing is the registry that i can't do.


I follow this Steps:

 

1) After applying the configuration:


public class PushConfig implements Persistable {

// Default properties used for the demo.
// You should register with BlackBerry Push API server and obtain
// similar values for your application.

// TCP port to listen for push messages
private int port = PORTNUMBER;
// Application ID generated during Push API registration
private String appId ="APPID";
// URL to the Push BPS server
private String bpsUrl = "http://cp<CPID>.pushapi.eval.blackberry.com";

 

2a) Debbuging using PushLib50 the app waits notification by the service and the Push Service APIs dont response:

 

(Seeing part of the code, in register() method)
// not registered yet, perform registeration
// final outcome will be available via
// PushApplication#onStatusChange() callback

Logger.log( "Scheduled registration with Push API");
PushApplicationRegistry.registerApplication( pad );
setCurrentTransaction( tx );
tx.waitForNotification(); <<<--- IN THIS LINE STAY WAITING


In the log, the command return:
“Scheduled registration with Push API”

 

2b) Debbuging using PushLib43 return an IOException of invalid parameter.

3b) Suppressing the HTTP request suffix of PushUtils:

 

private static String getConnectionSuffix() {
return ";deviceside=false;ConnectionType=mds<hyphen>public";
}

 

The Push Service APIs dont response again and and i get a TimeOut. In the log, the command return:
“java.io.InterruptedIOException: Local connection timed out after ~ 130000”


At last, if i try this url in the browser:
https://pushapi.eval.blackberry.com/mss/PD_subReg


(I know that is not the registration URL because should be http and not https but it seems curious)

i get this:

 

"Error

 

The content you have requested is not available

 

PD_subReg command is not currently in service! "

 

In this point:

 

  1. What I can do to register successfully?
  2. Someone can paste some sample code?

 

 

Be grateful for any kind of help.
Regards.

Retired
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Problems registering with the Push Service APIs

Are you using a real BlackBerry device (i.e. not simulator) to test with? It must have a valid BIS internet service book (provisioned for BIS) - double check your service books to ensure you have one. You should see a white BlackBerry icon in the home screen top ribbon if you are connected to the BlackBerry network.

 

You can download sample push-enabled applications as signed cod files that you can use directly for testing and includes the source code for the applications. They are developed by BlackBerry and known to be working. If the pre-compiled cod files don't work on your device then your device is not provisioned properly for BIS or push:

http://developer.blackberry.com/devzone/develop/platform_services/push_apps.html

Contributor
Posts: 10
Registered: ‎02-14-2013
My Device: BlackBerry Bold 9700
My Carrier: Vodafone

Re: Problems registering with the Push Service APIs

I am debbuging on a BB BOLD 9700 updated to OS 6 (v6.0.0.666).
I used the source files that come in the zip (PushDemo-src), signed with my own keys generated on RIM page.

 

Also need the internet servce book? 

Retired
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Problems registering with the Push Service APIs

Yes push requires a BIS service book.

 

Again, feel fee to try the pre-compiled and signed cod files for the sample. If the sample doesn't work then it is likely there is a problem with the device configuration. 

Contributor
Posts: 10
Registered: ‎02-14-2013
My Device: BlackBerry Bold 9700
My Carrier: Vodafone

Re: Problems registering with the Push Service APIs

In the example, the RegisterCommad do the subscription too.

 

 

I don't want to subscribe to the server, I just want to try to register the device to PUSH SERVICE, so i comment this code part:

//ContentProviderProtocol.performCommand( ContentProviderProtocol.CMD_SUBSCRIBE, "username", "password", isEnterprise, tx );

 

That makes difficult to use the pre-compiled examples directly.

 

 

Retired
Posts: 76
Registered: ‎08-08-2012
My Device: BlackBerry Z10
My Carrier: Rogers

Re: Problems registering with the Push Service APIs

Ah I see. Yes the subscription to the push initiator is required with those samples. But using the Push Service SDK makes it easy. As well you can easily write a push initaitor server-side application that will accept the http subscription request and just short circuit and return a rc=200 http response body.

 

Otherwise, your approach of modifying the samples are ok too just thought that if you rule out any changes you made it would give you a good sanity test.

 

Were you able to confirm you have BIS service books and the little white BlackBerry logo on the home screen status bar?

Highlighted
Contributor
Posts: 10
Registered: ‎02-14-2013
My Device: BlackBerry Bold 9700
My Carrier: Vodafone

Re: Problems registering with the Push Service APIs

That was, finally worked!  

 

Thx for all